Back

An internal curl error has occurred within the executor! 1.4.2 function

  • 0
  • Self Hosted
  • Functions
obiwanzenobi
14 Sep, 2023, 21:00

Executor logs:

TypeScript
[Error] Type: Exception
[Error] Message: An internal curl error has occurred within the executor! Error Msg: Http invalid protocol
[Error] File: /usr/local/app/http.php
[Error] Line: 1021

There is no other logs from function. How can I observe live function runtime logs?

TL;DR
TL;DR: User encountered an internal curl error within the executor while using the dio package for HTTP connection in a Dart 3.0 runtime. They discovered that logging the HTTP traffic into the console caused the error. The solution was to use context.log instead of console.log for logging. If the issue persists, the user is looking for a way to observe live function runtime logs.
obiwanzenobi
14 Sep, 2023, 21:35

Ok - for anybody that will experience the same problem:

I have integration with external api. All of my network traffic with http client was logged into console. New open runtimes do not like logging into console - use context.log

Drake
15 Sep, 2023, 20:21

[SOLVED] An internal curl error has occurred within the executor! 1.4.2 function

obiwanzenobi
19 Sep, 2023, 21:55

I think we could open it again - I changed my http client logging to use context.log but it still fails with the same error

obiwanzenobi
19 Sep, 2023, 21:55

An internal curl error has occurred within the executor! 1.4.2 function

obiwanzenobi
19 Sep, 2023, 21:55

I know that this is a lot of logs

obiwanzenobi
19 Sep, 2023, 21:56

but I dont see information about any limit

obiwanzenobi
19 Sep, 2023, 22:11

removing http logs (body, headers etc) and keeping a few lines of logs works fine

Drake
19 Sep, 2023, 22:14

what were you logging exactly?

obiwanzenobi
19 Sep, 2023, 22:15

request body and response body of a 2 requests

obiwanzenobi
19 Sep, 2023, 22:15

Im using dio package for http connection in dart 3.0 runtime

obiwanzenobi
19 Sep, 2023, 22:16

and a PrettyDioLogger package configured like this

TypeScript
 final dio = Dio();

    dio.interceptors.add(
      PrettyDioLogger(
        requestHeader: true,
        requestBody: true,
        responseHeader: true,
        logPrint: (object) => logger.log(object.toString()),
      ),
    );
obiwanzenobi
19 Sep, 2023, 22:17

logger object is an appwrite function context "wrapper"

Drake
19 Sep, 2023, 22:34

hmm i wonder if the body, headers, etc are simple json encodable objects. if not, that could be a problem.

Drake
19 Sep, 2023, 22:34

if you only remove the body, headers, etc but keep all the logs, does it work?

obiwanzenobi
19 Sep, 2023, 22:35

yes, removing this logger fixes the thing

obiwanzenobi
19 Sep, 2023, 22:36

so there could be some json unescapable chars in my logs?

Drake
19 Sep, 2023, 22:38

possibly...im not sure.

Drake
19 Sep, 2023, 22:38

any logs in the runtime container?

obiwanzenobi
19 Sep, 2023, 22:49
TypeScript
root@zdayProdAppwrite:~# docker logs 131104dd233c
Preparing for start ...
Starting ...
root@zdayProdAppwrite:~# docker logs 43e64ca0b5df
Preparing for start ...
Starting ...
obiwanzenobi
19 Sep, 2023, 22:49

but I have disabled development mode there

obiwanzenobi
19 Sep, 2023, 22:49

I mean _APP_ENV=production

obiwanzenobi
19 Sep, 2023, 22:50

These are containers that I check

Drake
20 Sep, 2023, 01:11

ya doesn't look like there's anything

Drake
20 Sep, 2023, 01:12

The only other thing i can think of is if something is being truncated in transit between one of the containers that's causing a problem 🤷🏼‍♂️

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more