Back

Invalid vars: Value must be a valid object

  • 0
  • Functions
punti_z
28 May, 2023, 19:05

"Status: Image is up to date"

TL;DR
The user is experiencing an error with invalid vars when triggering a function. They have tried various solutions, including using a different runtime and upgrading to the latest version. They are unsure where the error is coming from and are considering relooking at the function that creates the document triggering the error. They also mention issues with docker containers and resetting the project. There is no clear solution provided in the thread.
punti_z
28 May, 2023, 19:05

No functions found in the current directory

punti_z
28 May, 2023, 19:06

Looks like my system is possessed.. Let me reboot and try again .. This doesn't make sense

punti_z
28 May, 2023, 19:24

Ran the appwrite reset command hoping to re-setup the project and it wiped my Appwrite.json file πŸ€¦β€β™‚οΈπŸ€¦β€β™‚οΈ

punti_z
28 May, 2023, 19:26

Created a test function and the issue seems to be resolved by resetting it

punti_z
28 May, 2023, 19:26

Any way to recreate appwrite.json from the deployed appwrite project ? Else I need to setup all functions again ..

Drake
28 May, 2023, 19:34

It should only delete the project id 🧐

punti_z
28 May, 2023, 19:47

Yea it fixed the package URI issue when creating new function but the main issue of function actually running is still broken

Drake
28 May, 2023, 20:08

Please share the function code

punti_z
28 May, 2023, 22:25

As mentioned its the default function with no changes made to the code. Another insight, when I "Execute Now" the function from web console, it completes successfully and logs "areDevelopersAwesome: true" .. But when its triggered by an database document create event it fails with "Invalid vars"

Drake
28 May, 2023, 22:26

What's docker ps show?

punti_z
28 May, 2023, 22:28

Not sure what you mean, docker ps shows list of containers :/

Drake
28 May, 2023, 22:34

Share the result please

punti_z
28 May, 2023, 22:36
Drake
28 May, 2023, 22:41

Anything odd in the logs for the worker functions container or executor container?

Slightly odd the worker functions is up less than the others 🧐

punti_z
28 May, 2023, 22:44

Was looking through those logs and refreshed it in docker desktop so probably that's why .. I think I will try and upgrade to the latest and hopefully that does something.. Is the upgrade path 1.2.1 => 1.3.0, migrate data, 1.3.0 => 1.3.1, migrate data or can I skip any version in between ? Documentation states not to skip

punti_z
28 May, 2023, 22:46

And I see 1.3.3 you patched a migration overriding existing data bug ?

Drake
28 May, 2023, 23:43

Upgrade to 1.3.4 and run the migrate command

Drake
28 May, 2023, 23:45

Actually, execute now should be very similar to event based executions...

Drake
28 May, 2023, 23:49

I still can't figure out where "invalid vars" is coming from

punti_z
28 May, 2023, 23:55

Upgraded and migrated and issue still persists. Going to leave it for now, get some shuteye and pick up again tomorrow. Going to relook at the function that creates the document that triggers this one. What I speculate, given that even a dart runtime container is not created for this function when triggered, its something that fails before this function comes online

Drake
29 May, 2023, 00:10

I see a dart runtime get 🧐

punti_z
29 May, 2023, 12:00

Figured out a workaround where rather than an document create event trigger I create a function execution from the preceding function and pass the required document id and it works. Event trigger still gives the same error.

Drake
29 May, 2023, 14:37

Did you try with a different runtime?

punti_z
29 May, 2023, 15:15

No, dint occur to me to try that. Will try later today and confirm

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