Invalid configuration error when trying to access dev/tasks

Silverstripe Version: SS5.3

Question:

I have the SilverStripe Cloudinary module (GitHub - MadeHQ/silverstripe-cloudinary: SilverStripe Module. Replaces SilverStripe's inbuilt asset management with Cloudinary.) set up and it’s working great. Only trouble is I get an error when trying to run dev/tasks:

[Emergency] Uncaught Cloudinary\Exception\ConfigurationException: Invalid configuration, please set up your environment…

Line 293 in /var/www/html/vendor/cloudinary/cloudinary_php/src/Configuration/Configuration.php
throw new ConfigurationException(‘Invalid configuration, please set up your environment’);

I have my config set up in yml as per the documentation:

MadeHQ\Cloudinary:
    cloud_name: 'example_cloud_name'
    api_key: 'my_api_key'
    api_secret: 'my_api_secret'

I know the config is correct as I am able to access my Cloudinary account via the CMS and attach images etc just fine.

It seems to me that when trying to access dev/tasks, the config has not yet been set? How do I get dev/tasks to read the config? This is a major issue for me, as it is also preventing me from running cron jobs via sake dev/tasks/ProcessJobQueueTask.

I have entered the bug for the module here: Error when trying to access dev/tasks · Issue #199 · MadeHQ/silverstripe-cloudinary · GitHub

Is it possible to suppress that error when accessing dev/tasks? The module is not required for queuing or running tasks.

Any help or suggestions in the meantime would be much appreciated!

Without seeing a stack trace for the exception it’ll be hard to give any advice as to whether (let alone how) you could avoid executing the buggy code during a dev/build. Can you please provide a stack trace?

Also: did you flush after modifying the configuration?

yes multiple times. No change after /dev/build?flush=all. Note that /dev/build runs fine, /dev/tasks gets error.

Can you please copy/paste instead of using a screenshot - and make sure you include the full stack trace? It looks like there’s probably two errors there.