Strapi transfer local to remote
aurelien-ff
HOBBYOP

2 years 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

brody
EMPLOYEE

2 years 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-ff
HOBBYOP

2 years ago

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


brody
EMPLOYEE

2 years ago

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


aurelien-ff
HOBBYOP

2 years 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),
  },
});

brody
EMPLOYEE

2 years 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-ff
HOBBYOP

2 years ago

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


aurelien-ff
HOBBYOP

2 years 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.


brody
EMPLOYEE

2 years ago

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


aurelien-ff
HOBBYOP

2 years ago

So i cant use Strapi transfer ?


brody
EMPLOYEE

2 years 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-ff
HOBBYOP

2 years ago

can i temporarily disable websockets or Socket.io ?


brody
EMPLOYEE

2 years 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 over 1 year ago


Loading...