Strapi transfer local to remote

aurelien-ffHOBBY

a year ago

Hello,

I can't transfer my local strapi to the remote strapi. I've an error : [2024-06-19 17:07:31.065] error: [ERROR] WebSocket is not open: readyState 3 (CLOSED)

Transfer process failed.

Can someone help me please ?

Solved

12 Replies

a year ago

Both the websocket server and the http server need to use the same app.listen() so that they can be ran on the same port.


aurelien-ffHOBBY

a year ago

Ok thanks et how i can do that on railway or in local please ? :)


a year ago

Nothing to do with Railway, so unfortunately we won't be able to offer coding help here.


aurelien-ffHOBBY

a year ago

Ok i need to update my file server.ts on Strapi to do that ? How i can find my port in railway.app ?

export default ({ env }) => ({
  host: env('HOST', '0.0.0.0'),
  port: env.int('PORT', 1337),
  app: {
    keys: env.array('APP_KEYS'),
  },
  webhooks: {
    populateRelations: env.bool('WEBHOOKS_POPULATE_RELATIONS', false),
  },
});

a year ago

You are already using the correct PORT environment variable for the http server, the websocket server needs to use the same http listener.


aurelien-ffHOBBY

a year ago

Ok thanks ! so i need to update my file to use the same http listener.


aurelien-ffHOBBY

a year ago

Sorry but the Strapi doc say : If you use websockets or Socket.io in your projects, the transfer command will fail. You will need to temporarily disable websockets or Socket.io or ensure that your websocket server is running on a different port than the Strapi server, or a on a specific route within Strapi to use the transfer command.


a year ago

You need to run them on the same port because you can not expose multiple ports on Railway.


aurelien-ffHOBBY

a year ago

So i cant use Strapi transfer ?


a year ago

If you are unable to have the http and websocket servers listen on the same port, you would not be able to use that feature.


aurelien-ffHOBBY

a year ago

can i temporarily disable websockets or Socket.io ?


a year ago

That question would not pertain to Railway, as i've mentioned we unfortunately are not able to provide coding help.


Status changed to Solved railway[bot] 12 months ago