8000 🐛 Bug Report: Curl error after 30 seconds even if limit is set to 300 · Issue #6328 · appwrite/appwrite · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

🐛 Bug Report: Curl error after 30 seconds even if limit is set to 300 #6328

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
2 tasks done
sergeycherepanov opened this issue Sep 25, 2023 · 4 comments
Open
2 tasks done
Assignees
Labels
bug Something isn't working product / functions Fixes and upgrades for the Appwrite Functions.

Comments

@sergeycherepanov
Copy link
sergeycherepanov commented Sep 25, 2023

👟 Reproduction steps

Hi!

I created a JAVA-18.0 function that should work for a couple of minutes. It depends on the third party API and waiting for it to complete. The timeout of function is set to 300.

But after ~35 seconds the functions fails with a php internal error.

An internal curl error has occurred within the executor! Error Msg: Connection reset by peer\nError Code: 500

To reproduce the issue just need to create new java function with a sleep for 90 seconds.

package io.openruntimes.java.src;

import io.openruntimes.java.RuntimeContext;
import io.openruntimes.java.RuntimeOutput;
import java.util.HashMap;
import io.appwrite.Client;

public class Main {

    // This is your Appwrite function
    // It's executed each time we get a request
    public RuntimeOutput main(RuntimeContext context) throws Exception {
        
        Thread.sleep(90000);
        
        HashMap<String, Object> json = new HashMap<>();
        json.put("motto", "Build Fast. Scale Big. All in One Place.");
        json.put("learn", "https://appwrite.io/docs");
        json.put("connect", "https://appwrite.io/discord");
        json.put("getInspired", "https://builtwith.appwrite.io");
        
        // `context.getRes().json()` is a handy helper for sending JSON
        return context.getRes().json(json);
    }
}

👍 Expected behavior

Function should run as long as configured in the timeout parameter.

👎 Actual Behavior

Function fails after ~35 seconds

🎲 Appwrite version

Version 1.4.x

💻 Operating system

Linux

🧱 Your Environment

No response

👀 Have you spent some time to check if this issue has been raised before?

  • I checked and didn't find similar issue

🏢 Have you read the Code of Conduct?

@sergeycherepanov sergeycherepanov added the bug Something isn't working label Sep 25, 2023
@stnguyen90 stnguyen90 added the product / functions Fixes and upgrades for the Appwrite Functions. label Sep 26, 2023
@stnguyen90
Copy link
Contributor

@sergeycherepanov, thanks for creating this issue! 🙏🏼 A few questions:

  1. Are you on version 1.4.3 of Appwrite?
  2. Was it a clean install, or did you upgrade?

@stnguyen90 stnguyen90 self-assigned this Sep 26, 2023
@sergeycherepanov
Copy link
Author

Hi @stnguyen90

    • yes the version is 1.4.3
    • it is fresh install of 1.4.3 (not an update from previous versions)

I gues it can be the java related issue, I have no time to invetigate it for now and compare with nodejs. But I thinking the webserver implementation can stuck in case when block statment like sleep or another io call was used. In this case curl will down by connect timeout.

@stnguyen90
Copy link
Contributor

@sergeycherepanov, how are you executing the function?

@sergeycherepanov
Copy link
Author
sergeycherepanov commented Jan 3, 2024

hi @stnguyen90, for now I using the event trigger for documents and cron schedule. Also I switched to the native client what I created by swagger-codegen tool.

But the issue still present I can't run function longer than 30 seconds, after that the php fails by the Curl error (Connection reset by peer).

Actually it looks like a timeout in the middle, maybe the http server or something else.

Could you explain how the connection done betwen the appwrite and fucntion http? Is it works via internal connection or use public api endpoint? I use the Appwrite behind Cloudflare, maybe it is can be the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working product / functions Fixes and upgrades for the Appwrite Functions.
Projects
None yet
Development

No branches or pull requests

2 participants
0