Image Upload Failed with Cloudinary

System Information
  • Strapi Version: 4.5.5
  • Operating System:
  • Database: PostgresSQL
  • Node Version: 18.12.1
  • NPM Version:
  • Yarn Version:

Hi,

I am having troubles deploying a Strapi App on Railways. I installed Cloudinary to handle my images but some picture can’t be upload and when the failure happen the whole server break and I have to restart it.

The same image can be uploaded on Cloudinary directly but when I do it from the admin panel i get this:

Here is my plugins.js

module.exports = ({ env }) => ({
    'users-permissions': {
      config: {
      jwtSecret: env('JWT_SECRET'),
      },
    },
    upload: {
      config: {
        provider: 'cloudinary',
        providerOptions: {
          cloud_name: env('CLOUDINARY_NAME'),
          api_key: env('CLOUDINARY_KEY'),
          api_secret: env('CLOUDINARY_SECRET'),
        },
        actionOptions: {
          upload:{},
          delete: {},
        },
      },
    },
  });

and my midlleware.js

'strapi::errors',
  {
    name: 'strapi::security',
    config: {
      contentSecurityPolicy: {
        useDefaults: true,
        directives: {
          'connect-src': ["'self'", 'https:'],
          'img-src': ["'self'", 'data:', 'blob:', 'market-assets.strapi.io', 'res.cloudinary.com'],
          'media-src': [
            "'self'",
            'data:',
            'blob:',
            'market-assets.strapi.io',
            'res.cloudinary.com',
          ],
          upgradeInsecureRequests: null,
        },
      },
    },
  },