I have a function setup to create a new collection, add attributes, create indexes, and then add that new collections info to another table.
This was working perfectly until upgrading to the latest version. Were there specific breaking changes to how function execution was/is happening? Do all the functions need to be rebuilt again?
What errors are you seeing?
There weren't any breaking function changes
I just get an "Internal Runtime error."
Your function is probably throwing an exception
Can you manually create a collection and attributes?
Where in the docker container logs can I see what exception was thrown?
They won't be. It's best to make sure your code doesn't throw any exception
So I'm unable to create a collection now, using this command:
result = database.create_collection('records', 'unique()', table_name, default_permissions)
And the error I get is:
{'message': 'Server Error', 'code': 500, 'type': 'general_unknown', 'version': '1.3.4'}
Not particularly helpful...
What do the docker logs for the appwrite container say?
What did you upgrade from?
What did you do exactly to upgrade?
Logs: [Error] Timestamp: 2023-05-09T03:47:22+00:00 [Error] Method: POST [Error] URL: /v1/databases/:databaseId/collections [Error] Type: TypeError [Error] Message: {closure}(): Argument #5 ($documentSecurity) must be of type bool, null given, called in /usr/src/code/vendor/utopia-php/framework/src/App.php on line 577 [Error] File: /usr/src/code/app/controllers/api/databases.php [Error] Line: 720
I upgraded from 1.2.0
I followed the upgrade steps provided here: https://appwrite.io/docs/upgrade
Hmm....I know there were changes to how we handled input, but, ideally, your old code should still work...let me check with the team.
For now, you may need to update your SDK
Okay, thanks. I'll try updating the SDK now and see if that makes a difference.
What version of the python SDK did you have?
pip list shows the appwrite SDK as being at 1.0.0
Updating to 2.0.0 showing the same behaviour there, just FYI.
Womp...can you try passing false for document security?
If I pass False in to that function call, it does go through as expected. It then fails on the next function call when it goes to create an attribute...
[Error] Timestamp: 2023-05-09T05:04:51+00:00 [Error] Method: POST [Error] URL: /v1/databases/:databaseId/collections/:collectionId/attributes/string [Error] Type: TypeError [Error] Message: {closure}(): Argument #7 ($array) must be of type bool, null given, called in /usr/src/code/vendor/utopia-php/framework/src/App.php on line 577 [Error] File: /usr/src/code/app/controllers/api/databases.php [Error] Line: 1104
So it seems like the python SDK works differently than other sdks. The other ones filter out null values from the request but it doesn't look like the python SDK does that.
As such, you'd need to update the API calls to pass a value for optional parameters
Okay, thanks for looking in to it. So that would be considered a breaking change when upgrading to this new version then?
Unfortunately yes...I don't think we realized the python SDK worked differently
Recommended threads
- Synchronous function execution timeout w...
I am calling server functions with xasync = true and I still get this error message. Synchronous function execution timed out. Use asynchronous execution inste...
- Flutter OAuth2 webAuth Bug?
I created with flutter an app where I can login in with my Microsoft Account. When I compile it to Web (WASM) or Android (aab) then there is no problem what so ...
- Function running for more than 2 hours i...
This is my projectID: 669fe01b003800dd0503 Cloud functionID is 696ea05400147eb8eb3b I hope this doesn't count against my GB-hours?