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

🐛 Bug Report: appwrite function get-execution crashes with TypeError #153

Open
2 tasks done
neutrino2211 opened this issue Jan 1, 2025 · 2 comments
Open
2 tasks done
Labels
bug Something isn't working

Comments

@neutrino2211
Copy link

👟 Reproduction steps

When I created a cloud function on Node 22, set it to run on update for database documents and run appwrite functions get-execution to get logs, the output ends with TypeError: Cannot convert undefined or null to object.

Image

The error comes from this specific line, a check for whether the "object" is null seems to be missing.

👍 Expected behavior

It should either log the scheduledAt data or an empty object or null

👎 Actual Behavior

it actually fails with a type error

🎲 Appwrite version

Appwrite Cloud

💻 Operating system

MacOS

🧱 Your Environment

No customised environment, using the appwrite cloud software and the Appwrite SDK

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

@neutrino2211 neutrino2211 added the bug Something isn't working label Jan 1, 2025
@neutrino2211 neutrino2211 changed the title 🐛 Bug Report: TypeError: Cannot convert undefined or null to object 🐛 Bug Report: appwrite function get-execution crashes with TypeError Jan 2, 2025
@stnguyen90
Copy link
Contributor

stnguyen90 commented Jan 2, 2025

@neutrino2211, thanks for creating this issue! 🙏🏼 Would you be able to share the JSON payload for the response? You should be able to see using the json option.

@neutrino2211
Copy link
Author

@stnguyen90 Here's the output, uncensored for debugging if need be.

{
  "$id": "6776badfc37534dffa7f",
  "$createdAt": "2025-01-02T16:12:15.802+00:00",
  "$updatedAt": "2025-01-02T16:12:17.398+00:00",
  "$permissions": [],
  "functionId": "677399c00001cdd07553",
  "trigger": "event",
  "status": "failed",
  "requestMethod": "POST",
  "requestPath": "/",
  "requestHeaders": [
    {
      "name": "content-type",
      "value": "application/json"
    }
  ],
  "responseStatusCode": 500,
  "responseBody": "",
  "responseHeaders": [],
  "logs": "",
  "errors": "Internal curl error has occurred within the executor! Error Number: 52\\nError Code: 500",
  "duration": 1.5702221393585,
  "scheduledAt": null
}

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