Cloudinary environment variables are not being used causing a failure

Hi All,

I am in need of some assistance please… I have a case where my admin panel is live on Google Cloud Platform now(Hooray)… but my Cloudinary media library upload does not work…unfortunately.

My plugins.js file looks like this:

module.exports = ({ env }) => ({
  // ...
  upload: {
    provider: 'cloudinary',
    providerOptions: {
      cloud_name: env('CLOUDINARY_NAME'),
      api_key: env('CLOUDINARY_KEY'),
      api_secret: env('CLOUDINARY_SECRET'),
    },
    actionOptions: {
      upload: {
        folder: "a folder"
      },
      delete: {},
    },
  },
  // ...
});

and my .env file cloudinary details like this:

CLOUDINARY_NAME=‘fakeName’
CLOUDINARY_KEY=‘1234567890123456’
CLOUDINARY_SECRET=‘12345678901234567890’

On testing I found Google logs were showing a few errors stating internal server error 500, and the message just before that would state: error Must supply api_key.

So I tested by placing my strings in, instead of process.env details and found that works fine when I try to upload to Cloudinary via the admin panel, however as soon as I use process.env data, it does not…so I know my env variables are correct, it is just that my application is not finding them or getting them in time or something like that.

This works fine in development, it’s in production where the issue happens.

I have tried many variations and spent many hours on this now, but I cannot figure this out.

If you could provide a poor soul with some attention, it would be much appreciated.

Thank you,

Kind regards,

SR

Don’t worry about this one guys, I have figured it out…finally.

So all I had to do is just add in my environment variables to the app.yaml file before deployment like so:

env_variables:
CLOUDINARY_NAME=‘fakeName’
CLOUDINARY_KEY=‘1234567890123456’
CLOUDINARY_SECRET=‘12345678901234567890’

Hope this can help someone else.

Hmmm im having a similar issue but dont even have an app.yaml file