Answers.Body: <p>You're getting a syntax error that is coming from a <a href="https://github.com/ramsey/collection" rel="nofollow noreferrer"><code>Collection</code> library</a> included in your project. This library is included by the <code>percipioglobal/craft-notifications</code> plugin, which <a href="https://github.com/percipioglobal/craft-notifications/commit/492262d0e46095546565eba9abf074234025738d" rel="nofollow noreferrer">used to require</a> <code>ramsey/uuid</code> which in turn requires <code>ramsey/collection</code>. It's unlikely that the library itself contains a syntax error, so the <code>vendor</code> folder in your live environment has probably been corrupted. Try removing the <code>vendor/</code> folder and reinstalling the dependencies with <code>composer install</code>. Check if there are any scripts running after <code>composer install</code> that might modify files in the <code>vendor/</code> folder, or any outdated patches being applied to it during deployment.</p>
  <p>If that doesn't work – the notifications plugin doesn't require that library any more (see <a href="https://github.com/percipioglobal/craft-notifications/commit/492262d0e46095546565eba9abf074234025738d" rel="nofollow noreferrer">this commit</a>), so updating that plugin to the current version should fix the error regardless of what caused it.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-04-19T10:01:37.287Z
Answers.LastActivityDate: 2023-04-19T10:01:37.287Z
Answers.UserDisplayName: MoritzLost
Body: <p>Here is the error log which I'm getting while register a user. I'm using craft cms <code>3.8.5</code></p>
  <pre><code>2023-04-19 09:59:39 [-][-][-][error][ParseError] ParseError: syntax error, unexpected ')' in /var/www/app/releases/18042023-0917/vendor/ramsey/collection/src/AbstractCollection.php:84
  Stack trace:
  #0 /var/www/app/releases/18042023-0917/vendor/composer/ClassLoader.php(322): Composer\Autoload\includeFile('/var/www/api.he...')
  #1 [internal function]: Composer\Autoload\ClassLoader-&gt;loadClass('Ramsey\\Collecti...')
  #2 /var/www/app/releases/18042023-0917/vendor/ramsey/uuid/src/Builder/BuilderCollection.php(32): spl_autoload_call('Ramsey\\Collecti...')
  #3 /var/www/app/releases/18042023-0917/vendor/composer/ClassLoader.php(444): include('/var/www/api.he...')
  #4 /var/www/app/releases/18042023-0917/vendor/composer/ClassLoader.php(322): Composer\Autoload\includeFile('/var/www/api.he...')
  #5 [internal function]: Composer\Autoload\ClassLoader-&gt;loadClass('Ramsey\\Uuid\\Bui...')
  #6 /var/www/app/releases/18042023-0917/vendor/ramsey/uuid/src/FeatureSet.php(436): spl_autoload_call('Ramsey\\Uuid\\Bui...')
  #7 /var/www/app/releases/18042023-0917/vendor/ramsey/uuid/src/FeatureSet.php(170): Ramsey\Uuid\FeatureSet-&gt;buildUuidBuilder(false)
  #8 /var/www/app/releases/18042023-0917/vendor/ramsey/uuid/src/UuidFactory.php(108): Ramsey\Uuid\FeatureSet-&gt;__construct()
  #9 /var/www/app/releases/18042023-0917/vendor/ramsey/uuid/src/Uuid.php(401): Ramsey\Uuid\UuidFactory-&gt;__construct()
  #10 /var/www/app/releases/18042023-0917/vendor/ramsey/uuid/src/Uuid.php(619): Ramsey\Uuid\Uuid::getFactory()
  #11 /var/www/app/releases/18042023-0917/vendor/percipioglobal/craft-notifications/src/services/NotificationsService.php(93): Ramsey\Uuid\Uuid::uuid4()
  #12 /var/www/app/releases/18042023-0917/vendor/percipioglobal/craft-notifications/src/Notifications.php(97): percipioglobal\notifications\services\NotificationsService-&gt;send(Object(app\notifications\UserAdded))
  #13 [internal function]: percipioglobal\notifications\Notifications-&gt;percipioglobal\notifications\{closure}(Object(craft\events\ModelEvent))
  #14 /var/www/app/releases/18042023-0917/vendor/yiisoft/yii2/base/Event.php(312): call_user_func(Object(Closure), Object(craft\events\ModelEvent))
  #15 /var/www/app/releases/18042023-0917/vendor/yiisoft/yii2/base/Component.php(642): yii\base\Event::trigger('craft\\elements\\...', 'afterSave', Object(craft\events\ModelEvent))
  #16 /var/www/app/releases/18042023-0917/vendor/craftcms/cms/src/base/Element.php(4203): yii\base\Component-&gt;trigger('afterSave', Object(craft\events\ModelEvent))
  #17 /var/www/app/releases/18042023-0917/vendor/craftcms/cms/src/elements/User.php(1617): craft\base\Element-&gt;afterSave(true)
  #18 /var/www/app/releases/18042023-0917/vendor/craftcms/cms/src/services/Elements.php(2732): craft\elements\User-&gt;afterSave(true)
  #19 /var/www/app/releases/18042023-0917/vendor/craftcms/cms/src/services/Elements.php(785): craft\services\Elements-&gt;_saveElementInternal(Object(craft\elements\User), false, false, true)
  #20 /var/www/app/releases/18042023-0917/modules/sitemodule/src/services/User.php(181): craft\services\Elements-&gt;saveElement(Object(craft\elements\User), false)
  #21 /var/www/app/releases/18042023-0917/modules/sitemodule/src/controllers/ApiController.php(149): modules\sitemodule\services\User-&gt;register()
  #22 /var/www/app/releases/18042023-0917/modules/sitemodule/src/controllers/ApiController.php(51): modules\sitemodule\controllers\ApiController-&gt;processRequest('user', 'register')
  #23 [internal function]: modules\sitemodule\controllers\ApiController-&gt;actionUser('register')
  #24 /var/www/app/releases/18042023-0917/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array(Array, Array)
  #25 /var/www/app/releases/18042023-0917/vendor/yiisoft/yii2/base/Controller.php(178): yii\base\InlineAction-&gt;runWithParams(Array)
  #26 /var/www/app/releases/18042023-0917/vendor/yiisoft/yii2/base/Module.php(552): yii\base\Controller-&gt;runAction('user', Array)
  #27 /var/www/app/releases/18042023-0917/vendor/craftcms/cms/src/web/Application.php(293): yii\base\Module-&gt;runAction('site-module/api...', Array)
  #28 /var/www/app/releases/18042023-0917/vendor/yiisoft/yii2/web/Application.php(103): craft\web\Application-&gt;runAction('site-module/api...', Array)
  #29 /var/www/app/releases/18042023-0917/vendor/craftcms/cms/src/web/Application.php(278): yii\web\Application-&gt;handleRequest(Object(craft\web\Request))
  #30 /var/www/app/releases/18042023-0917/vendor/yiisoft/yii2/base/Application.php(384): craft\web\Application-&gt;handleRequest(Object(craft\web\Request))
  #31 /var/www/app/releases/18042023-0917/pub/index.php(22): yii\base\Application-&gt;run()
  </code></pre>
  
Tags: <error>
Title: I'm getting an wired error from my Live server when i'm trying to register as a user and sending notification
ThreadText: # I'm getting an wired error from my Live server when i'm trying to register as a user and sending notification
  
  (Asked by: username_0 on 2023-04-19)
  
  Here is the error log which I'm getting while register a user. I'm using craft cms `3.8.5`
  
  ```
  2023-04-19 09:59:39 [-][-][-][error][ParseError] ParseError: syntax error, unexpected ')' in /var/www/app/releases/18042023-0917/vendor/ramsey/collection/src/AbstractCollection.php:84
  Stack trace:
  #0 /var/www/app/releases/18042023-0917/vendor/composer/ClassLoader.php(322): Composer\Autoload\includeFile('/var/www/api.he...')
  #1 [internal function]: Composer\Autoload\ClassLoader->loadClass('Ramsey\\Collecti...')
  #2 /var/www/app/releases/18042023-0917/vendor/ramsey/uuid/src/Builder/BuilderCollection.php(32): spl_autoload_call('Ramsey\\Collecti...')
  #3 /var/www/app/releases/18042023-0917/vendor/composer/ClassLoader.php(444): include('/var/www/api.he...')
  #4 /var/www/app/releases/18042023-0917/vendor/composer/ClassLoader.php(322): Composer\Autoload\includeFile('/var/www/api.he...')
  #5 [internal function]: Composer\Autoload\ClassLoader->loadClass('Ramsey\\Uuid\\Bui...')
  #6 /var/www/app/releases/18042023-0917/vendor/ramsey/uuid/src/FeatureSet.php(436): spl_autoload_call('Ramsey\\Uuid\\Bui...')
  #7 /var/www/app/releases/18042023-0917/vendor/ramsey/uuid/src/FeatureSet.php(170): Ramsey\Uuid\FeatureSet->buildUuidBuilder(false)
  #8 /var/www/app/releases/18042023-0917/vendor/ramsey/uuid/src/UuidFactory.php(108): Ramsey\Uuid\FeatureSet->__construct()
  #9 /var/www/app/releases/18042023-0917/vendor/ramsey/uuid/src/Uuid.php(401): Ramsey\Uuid\UuidFactory->__construct()
  #10 /var/www/app/releases/18042023-0917/vendor/ramsey/uuid/src/Uuid.php(619): Ramsey\Uuid\Uuid::getFactory()
  #11 /var/www/app/releases/18042023-0917/vendor/percipioglobal/craft-notifications/src/services/NotificationsService.php(93): Ramsey\Uuid\Uuid::uuid4()
  #12 /var/www/app/releases/18042023-0917/vendor/percipioglobal/craft-notifications/src/Notifications.php(97): percipioglobal\notifications\services\NotificationsService->send(Object(app\notifications\UserAdded))
  #13 [internal function]: percipioglobal\notifications\Notifications->percipioglobal\notifications\{closure}(Object(craft\events\ModelEvent))
  #14 /var/www/app/releases/18042023-0917/vendor/yiisoft/yii2/base/Event.php(312): call_user_func(Object(Closure), Object(craft\events\ModelEvent))
  #15 /var/www/app/releases/18042023-0917/vendor/yiisoft/yii2/base/Component.php(642): yii\base\Event::trigger('craft\\elements\\...', 'afterSave', Object(craft\events\ModelEvent))
  #16 /var/www/app/releases/18042023-0917/vendor/craftcms/cms/src/base/Element.php(4203): yii\base\Component->trigger('afterSave', Object(craft\events\ModelEvent))
  #17 /var/www/app/releases/18042023-0917/vendor/craftcms/cms/src/elements/User.php(1617): craft\base\Element->afterSave(true)
  #18 /var/www/app/releases/18042023-0917/vendor/craftcms/cms/src/services/Elements.php(2732): craft\elements\User->afterSave(true)
  #19 /var/www/app/releases/18042023-0917/vendor/craftcms/cms/src/services/Elements.php(785): craft\services\Elements->_saveElementInternal(Object(craft\elements\User), false, false, true)
  #20 /var/www/app/releases/18042023-0917/modules/sitemodule/src/services/User.php(181): craft\services\Elements->saveElement(Object(craft\elements\User), false)
  #21 /var/www/app/releases/18042023-0917/modules/sitemodule/src/controllers/ApiController.php(149): modules\sitemodule\services\User->register()
  #22 /var/www/app/releases/18042023-0917/modules/sitemodule/src/controllers/ApiController.php(51): modules\sitemodule\controllers\ApiController->processRequest('user', 'register')
  #23 [internal function]: modules\sitemodule\controllers\ApiController->actionUser('register')
  #24 /var/www/app/releases/18042023-0917/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array(Array, Array)
  #25 /var/www/app/releases/18042023-0917/vendor/yiisoft/yii2/base/Controller.php(178): yii\base\InlineAction->runWithParams(Array)
  #26 /var/www/app/releases/18042023-0917/vendor/yiisoft/yii2/base/Module.php(552): yii\base\Controller->runAction('user', Array)
  #27 /var/www/app/releases/18042023-0917/vendor/craftcms/cms/src/web/Application.php(293): yii\base\Module->runAction('site-module/api...', Array)
  #28 /var/www/app/releases/18042023-0917/vendor/yiisoft/yii2/web/Application.php(103): craft\web\Application->runAction('site-module/api...', Array)
  #29 /var/www/app/releases/18042023-0917/vendor/craftcms/cms/src/web/Application.php(278): yii\web\Application->handleRequest(Object(craft\web\Request))
  #30 /var/www/app/releases/18042023-0917/vendor/yiisoft/yii2/base/Application.php(384): craft\web\Application->handleRequest(Object(craft\web\Request))
  #31 /var/www/app/releases/18042023-0917/pub/index.php(22): yii\base\Application->run()
  
  ```
  
  **Tags:** error
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2023-04-19. Score: 2
  
  You're getting a syntax error that is coming from a [`Collection` library](https://github.com/ramsey/collection) included in your project. This library is included by the `percipioglobal/craft-notifications` plugin, which [used to require](https://github.com/percipioglobal/craft-notifications/commit/492262d0e46095546565eba9abf074234025738d) `ramsey/uuid` which in turn requires `ramsey/collection`. It's unlikely that the library itself contains a syntax error, so the `vendor` folder in your live environment has probably been corrupted. Try removing the `vendor/` folder and reinstalling the dependencies with `composer install`. Check if there are any scripts running after `composer install` that might modify files in the `vendor/` folder, or any outdated patches being applied to it during deployment.
  
  If that doesn't work – the notifications plugin doesn't require that library any more (see [this commit](https://github.com/percipioglobal/craft-notifications/commit/492262d0e46095546565eba9abf074234025738d)), so updating that plugin to the current version should fix the error regardless of what caused it.
  
  
  ---
  
  