roblesterjr04 / EloquentSalesForce

A SalesForce Package that works using the Laravel Eloquent Model structure.
MIT License
91 stars 61 forks source link

Errors when running Model::save() in a scheduled job Omniphx\Forrest\Exceptions\MissingVersionException and Illuminate\Contracts\Encryption\DecryptException The payload is invalid. #90

Open mthorsdal opened 1 year ago

mthorsdal commented 1 year ago

Dear Overlords

Thanks to your EloquentSalesForce, I run a few scheduled jobs with ease through Laravel, which include updating SalesForce models, however, I often get notified of the following two errors.

Are those known issues with solutions that I am oblivious to? Or am I the first to experience this?

`Omniphx\Forrest\Exceptions\MissingVersionException

No version available

at vendor/omniphx/forrest/src/Omniphx/Forrest/Repositories/VersionRepository.php:42 38| 39| private function verify() { 40| if ($this->storage->has('version')) return; 41|

42| throw new MissingVersionException('No version available'); 43| } 44| }

   [2m+8 vendor frames  [22m

9 app/Console/Commands/SendAutoFollowup.php:88 Illuminate\Database\Eloquent\Model::save()`

as well as the following

`Illuminate\Contracts\Encryption\DecryptException

The payload is invalid.

at vendor/laravel/framework/src/Illuminate/Encryption/Encrypter.php:195 191| // If the payload is not valid JSON or does not have the proper keys set we will 192| // assume it is invalid and bail out of the routine since we will not be able 193| // to decrypt the given value. We'll also check the MAC for this encryption. 194| if (! $this->validPayload($payload)) {

195| throw new DecryptException('The payload is invalid.'); 196| } 197| 198| if (! $this->validMac($payload)) { 199| throw new DecryptException('The MAC is invalid.');

   [2m+6 vendor frames  [22m

7 app/Service/SalesforceService.php:225 Illuminate\Database\Eloquent\Model::save()`

roblesterjr04 commented 1 year ago

Often times this could be caused by the cache settings on whatever machine is running the jobs. I recommend ensuring that the cache settings are using a persistent storage method such as database, or file, or the like.