Skip to content
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

appwrite functions createExecution prints 40 kb strange output #64

Closed
2 tasks done
schilken opened this issue Oct 18, 2022 · 0 comments
Closed
2 tasks done

appwrite functions createExecution prints 40 kb strange output #64

schilken opened this issue Oct 18, 2022 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@schilken
Copy link

schilken commented Oct 18, 2022

👟 Reproduction steps

I create a new function in an flutter project on macOS 12.6 on MacBook Air (M1, 2020)

$ appwrite login
$ appwrite init project
$ appwrite init function
$ appwrite deploy function

$ appwrite functions createExecution --functionId standardFunction >stdout.log

stdout.log contains 40 kb !

👍 Expected behavior

The result should contain only the first 14 lines of the stdout.log:

$id : 634ede62b964c6342d04
$createdAt : 2022-10-18T17:12:02.759+00:00
$updatedAt : 2022-10-18T17:12:02.765+00:00
$permissions
[
  "read(\"user:634289b0bdea1a7403cd\")"
]
functionId : defaultFunction
trigger : http
status : completed
statusCode : 200
response : {"areDevelopersAwesome":true}
stdout : Environment variables are not set. Function cannot use Appwrite SDK.
stderr : 

👎 Actual Behavior

The file stdout.log contains about 40 kb of strange output starting with this content:

$id : 634ede62b964c6342d04
$createdAt : 2022-10-18T17:12:02.759+00:00
$updatedAt : 2022-10-18T17:12:02.765+00:00
$permissions
[
  "read(\"user:634289b0bdea1a7403cd\")"
]
functionId : defaultFunction
trigger : http
status : completed
statusCode : 200
response : {"areDevelopersAwesome":true}
stdout : Environment variables are not set. Function cannot use Appwrite SDK.
stderr : 
duration
s : 1
e : -3
c
[
  160598754882,
  81250000000000
]
constructor : function BigNumber(v, b) {
      var alphabet, c, caseChanged, e, i, isNum, len, str,
        x = this;

...
here are about 40 kb source code (see attachment)
... 

and ending with this:

toJSON : function () {
      return valueOf(this);
    }
_isBigNumber : true
✓ Success 

Logs on the web console

The Logs on the web console contain expected content:

  • Response → {"areDevelopersAwesome":true}
  • Stdout → Environment variables are not set. Function cannot use Appwrite SDK.
  • Stderr → No errors were logged.

http traffic

The http traffic monitored with Proxyman is also ok:

POST /v1/functions/defaultFunction/executions HTTP/1.1
Accept: application/json, text/plain, */*
content-type: application/json
x-sdk-name: Command Line
x-sdk-platform: console
x-sdk-language: cli
x-sdk-version: 1.1.1
user-agent: AppwriteCLI/1.1.1 (Darwin Darwin Kernel Version 21.6.0: Mon Aug 22 20:20:05 PDT 2022; root:xnu-8020.140.49~2/RELEASE_ARM64_T8101; arm64)
X-Appwrite-Response-Format: 1.0.0
x-appwrite-project: cli_functions_bug
x-appwrite-locale: en-US
cookie: a_session_console_legacy=eyJpZCI6IjYzNDI4OWIwYmRlYTFhNzQwM2NkIiwic2VjcmV0IjoiYTk3ZGUxMzg1OWNmOGYwYTMyYTE1M2E1MzljNjA1ZmE1YWYyZWM5YzNhODQyNGZhZjI2MDAzODM5NWQ3NDlhMDQ5OGE5MDM1ODcxMjA1ZGU0NzFlZjU0MTU4NjgzZGNjMDdkMzM4ZGZlOTE2MTk2MWZjMDI1ZjZkMmM0OGZmMWI4YjhlNmU4Y2Q4NDRlNGFhNDVmMTJkNTg1MWRjYjc4MzZmOTU0NjFhYjRiMWNjYWI4YWEzYmFjYzllZWVhMDZjOWVmZjgwNmQ5NmE1MGRlZGJmNWUwZmY2MzI2YjJkZjZlZjY2NjU3NTMyMTk0ZjljMzRiZjM4OGMxNzJhNDEyYSJ9; expires=Sun, 15-Oct-2023 15:41:44 GMT; path=/; httponly
x-appwrite-mode: admin
Content-Length: 2
host: 192.168.2.23
Connection: close

{}

response:

{
  "$id": "634ea5cf0f154bcf417d",
  "$createdAt": "2022-10-18T13:10:39.061+00:00",
  "$updatedAt": "2022-10-18T13:10:39.070+00:00",
  "$permissions": [
    "read(\"user:634289b0bdea1a7403cd\")"
  ],
  "functionId": "defaultFunction",
  "trigger": "http",
  "status": "completed",
  "statusCode": 200,
  "response": "{\"areDevelopersAwesome\":true}",
  "stdout": "Environment variables are not set. Function cannot use Appwrite SDK.",
  "stderr": "",
  "duration": 0.002368927001953125
}

stdout.log

🎲 Appwrite version

Version 1.0.x

💻 Operating system

MacOS

🧱 Your Environment

$ appwrite --version
1.1.1

Appwrite server:
v:1.0.2.501

$ cat appwrite.json 
{
    "projectId": "cli_functions_bug",
    "projectName": "cli_functions_bug",
    "functions": [
        {
            "$id": "defaultFunction",
            "name": "defaultFunction",
            "runtime": "dart-2.17",
            "path": "functions/defaultFunction",
            "entrypoint": "lib/main.dart",
            "ignore": [
                ".packages",
                ".dart_tool"
            ],
            "execute": [],
            "events": [],
            "schedule": "",
            "timeout": 15
        }
    ]
}                      

👀 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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants