Problem with Cloudinary [RESOLVED]

Hello to all,

I am writing this topic because I did not find a solution after an afternoon of work.

I have followed to the letter:
https://docs.strapi.io/developer-docs/latest/setup-deployment-guides/deployment/hosting-guides/heroku.html#file-uploads

And I succeeded in putting everything in production, and functional on my Heroku, but an error remains about Cloudinary after having followed this tutorial to the letter:
https://market.strapi.io/providers/@strapi-provider-upload-cloudinary

In local, the upload works, I can upload my images without any problem, and my Cloudinary receives everything well, in production, it is impossible:

My plugins.js file :

upload: {
        config: {
            provider : 'cloudinary',
            providerOptions : {
                cloud_name : env('CLOUDINARY_NAME'),
                api_key : env('CLOUDINARY_KEY'),
                api_secret : env('CLOUDINARY_SECRET'),
            },
            actionOptions : {
                upload: {},
                uploadStream : {},
                delete: {},
            },
        },
    },

My middlewares.js file :

module.exports = [
  'strapi::errors',
  {
    name: 'strapi::security',
    config: {
      contentSecurityPolicy: {
        useDefaults: true,
        directives: {
          'connect-src': ["'self'", 'https:'],
          'img-src': ["'self'", 'data:', 'blob:', 'dl.airtable.com', 'res.cloudinary.com'],
          'media-src': ["'self'", 'data:', 'blob:', 'dl.airtable.com', 'res.cloudinary.com'],
          upgradeInsecureRequests: null,
        },
      },
    },
  },
  'strapi::cors',
  'strapi::poweredBy',
  'strapi::logger',
  'strapi::query',
  'strapi::body',
  'strapi::session',
  'strapi::favicon',
  'strapi::public',
];

Of course, the expected variables are filled in on the .env file.

  • Is it a Strapi problem, a security issue? an incompatibility? an outdated plugin?
  • Is it a problem I need to see directly with Heroku? or Cloudinary?

Thank you for taking the time to answer me

Well, writing for the second time on your forum gave me the chance to fix my problem, and since I like to help, here is the way I fixed it :grinning:

First, I ran the live logs on my heroku app with the heroku logs -t command, and peeled back the least movements, then I ran into this error:

Secondly, contrary to what was indicated on the Strapi + Cloudinary documentation, I chose not to store the values on the .env file but directly on the plugins.js file in this way:

upload: {
        config: {
            provider: 'cloudinary',
            providerOptions: {
                cloud_name: 'VALUE',
                api_key: 'VALUE',
                api_secret: 'VALUE',
                
            },
            actionOptions: {
                upload: {},
                uploadStream: {},
                delete: {},
            },
        },
    },

I then pushed my modifications and :mage:, everything works correctly from now on!

Thanks all the same, although my subject will not have taken long to settle, beautiful and good evening to those who will see this message! :smiley: