Back

[SOLVED] Argument #1 ($log) not passed. Function error

  • 1
  • Functions
SenZi
1 Sep, 2023, 04:14

Functions are not being executed when it is setup to run based on events like user.session.create

Log: [Job] (64f16485683702.32806965) failed to run. [Job] (64f16485683702.32806965) {closure}(): Argument #1 ($log) not passed [Error] Type: ArgumentCountError [Error] Message: {closure}(): Argument #1 ($log) not passed [Error] File: /usr/src/code/app/workers/functions.php

TL;DR
The user is experiencing an error where the argument $log is not being passed in a function. The issue has been solved in version 1.4.2. The fix is available in the GitHub pull request: https://github.com/appwrite/appwrite/pull/6109. The next patch version will contain the fixes. The user is also facing other errors related to invalid paths and functions not executing based on events. The function code provided checks if certain environment variables are set, and if not, it returns a failed status and a message. No solution is provided for the other errors mentioned.
Drake
1 Sep, 2023, 04:26

Thanks for catching this! 🙏

SenZi
1 Sep, 2023, 05:12

Running the function using CRON syntax

The function: if (!process.env.USERDATA_DATABASE_ID || !process.env.USERDATA_COLLECTION_ID || !process.env.USER_PROFILE_PIC_BUCKET_ID || !process.env.APPWRITE_API_KEY ) { res.json({ status: "failed", message: "Environment Variables not set" }); return; }

[Error] Message: Invalid path: Value must be a valid string and at least 1 chars and no longer than 2048 chars [Error] File: /usr/src/code/app/workers/functions.php [Error] Line: 284

khushbooverma
1 Sep, 2023, 08:09

@SenZi thank you for spotting bugs. We've noted them and they'll soon be fixed in the next patch version. 🙂

Abhishek
1 Sep, 2023, 10:33

Facing the same error. Here is the traceback:

TypeScript
#0 /usr/src/code/app/workers/functions.php(353): {closure}(NULL, Object(Appwrite\Event\Func), Object(Utopia\Database\Database), Object(Domnikl\Statsd\Client), Object(Utopia\Database\Document), Object(Utopia\Database\Document), 'event', NULL, '/', 'POST', Array, Object(Utopia\Database\Document), NULL, 'buckets.org-ima...', '{"$id":"64f1b7f...', NULL)
#1 /usr/src/code/vendor/utopia-php/queue/src/Queue/Server.php(248): {closure}(Object(Utopia\Queue\Message), Object(Utopia\Database\Database), Object(Appwrite\Event\Func), Object(Domnikl\Statsd\Client), Object(Closure), Object(Utopia\Logger\Log))
#2 [internal function]: Utopia\Queue\Server->Utopia\Queue\{closure}('0')
#3 /usr/src/code/vendor/utopia-php/queue/src/Queue/Adapter/Swoole.php(37): call_user_func(Object(Closure), '0')
#4 {main}
SenZi
1 Sep, 2023, 10:49

any eta for the next patch?

Drake
1 Sep, 2023, 16:00
SenZi
1 Sep, 2023, 17:17

Nice! Any idea when it would be released? I'm currently using workarounds and some functions are totally broken, it'll be nice to use the new functions properly.

Drake
1 Sep, 2023, 18:14

maybe tomorrow

Abhishek
8 Sep, 2023, 16:58

This is fixed in 1.4.2 <:appwriteparty:946072712915341333>

Drake
8 Sep, 2023, 17:18

[SOLVED] Argument #1 ($log) not passed. Function error

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