-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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: Getting 500 error when accessing prop on third-party response object. #6999
Comments
Hi @logan-waite appreciate you bringing this up and having patience. I have asked the team for more details, will keep you updated here. |
@logan-waite what endpoint have you set for the SDK inside of his function? It should be |
This is what I call at the top of the main body of my function: function createAppwriteSdk({ jwt } = { jwt: false }) {
const client = new Client()
.setEndpoint('https://cloud.appwrite.io/v1')
.setProject(process.env.APPWRITE_FUNCTION_PROJECT_ID);
if (jwt) {
return client.setJWT(process.env.APPWRITE_USER_JWT);
} else {
return client.setKey(process.env.APPWRITE_API_KEY);
}
} What is odd to me is that I call similar third-party endpoints in different parts of the function, and I don't have a problem with those. |
@logan-waite, maybe there's a circular reference or something. Could you try making sure to pass a string to |
When I run the object through |
Looks like if I remove all my log statements, I'm able to get the data back. Do you know if there are plans to make the log function more robust than just taking strings? |
This will also have a problem with circular references.
It's safest to only pass strings, but technically, you can pass other things. I would have expected the log call to throw an exception and then the function would return 500 failed. |
This issue has been labeled as a 'question', indicating that it requires additional information from the requestor. It has been inactive for 7 days. If no further activity occurs, this issue will be closed in 14 days. |
This issue has been closed due to inactivity. If you still require assistance, please provide the requested information. |
👟 Reproduction steps
In an Appwrite function, I'm trying to access data from a third-party SDK, which works in other instances. However, when I try to access the data in this call, I'm getting a 500 error
An internal curl error has occurred within the executor! Error Msg: Http invalid protocol\nError Code: 500
. The error might make sense if it happened when I await theplaid.transactionsSync
(which is the actual http call), but I know I'm getting valid data from that through logging. However, as soon as I try to access thedata
prop on that response (which I know exists), I get that 500 error.👍 Expected behavior
I should be able to access the property without having a 500 error.
👎 Actual Behavior
Attempting to access the
response.data
prop gives aAn internal curl error has occurred within the executor! Error Msg: Http invalid protocol\nError Code: 500
error.🎲 Appwrite version
Appwrite Cloud
💻 Operating system
Linux
🧱 Your Environment
Appwrite Node SDK v^13.0.0,
👀 Have you spent some time to check if this issue has been raised before?
🏢 Have you read the Code of Conduct?
The text was updated successfully, but these errors were encountered: