#how to run seeds for admin credentials in railway
50 messages · Page 1 of 1 (latest)
What a night my friend ?
I have some questions also, do you use a template, can you share it, what about the Docker file that causes a fail ?
I ask this because there is no official doc about Railway deployment atm
Have you tried using railway run or railway shell . https://docs.railway.app/develop/cli#local-development
Maybe:
railway run medusa user -e "<EMAIL>" -p "<PASSWORD>"
good evening friend, i followed a tutorial i found on dev.to but there is also a tool to do a quick deployment of a medusa project on railway
Thank you very much friend, it is very helpful for me
Can I have the link to the tuto please my friend
Hi @subtle terrace have you been able to fix the seeding problem ?
Yes, I did, but not in the best way.
Can you explain how you solved it please ?
in short words in case someone asks the same question
Wait a moment please
Thank you
here change the command to
medusa migrations run && npm run seed && medusa develop
Thank a lot my friend, I'll cite your solution
Nice this is very important for the others
it is easier if you connect remotely with the terminal
You mean with the Railway command line
Yes
Okey
Ok
Thank a lot for sharing, it will really be usefull as it works the same I think for everyone
You're welcome friend, we are here to help and to help us
How do I create admin ? User , I linked to the backend using the railway CLI
npx medusa user --email admin@medusa-test.com --password supersecret
And this command does not work
What error do you get?
Try npx @medusajs/medusa user -e admin@medusa-test.com -p supersecret
Make sure you are in the root of your medusa backend folder
the backend on railway stopped working, i deleted the project on railway three times, hit the deploy link, changed the env variables to lowercase. health check not working. so the adding user can't even test again, the redis is not connecting
i am back attemting to add the admin user, i have the backend working
railway run npx medusa user --email can@trbzink.com --password supersecret
could not determine executable to run is the error message
@versed wharf I installed medusa CLI, to railway. getting the following errors
TypeError: cmd is not a function
at /Users/stunjiturner/Library/pnpm/global/5/.pnpm/@medusajs+medusa-cli@1.3.21/node_modules/@medusajs/medusa-cli/dist/create-cli.js:229:13
at /Users/stunjiturner/Library/pnpm/global/5/.pnpm/@medusajs+medusa-cli@1.3.21/node_modules/@medusajs/medusa-cli/dist/create-cli.js:48:30
at Object.handler (/Users/stunjiturner/Library/pnpm/global/5/.pnpm/@medusajs+medusa-cli@1.3.21/node_modules/@medusajs/medusa-cli/dist/create-cli.js:16:21)
at Object.runCommand (/Users/stunjiturner/Library/pnpm/global/5/.pnpm/yargs@15.4.1/node_modules/yargs/build/lib/command.js:196:48)
at Object.parseArgs [as _parseArgs] (/Users/stunjiturner/Library/pnpm/global/5/.pnpm/yargs@15.4.1/node_modules/yargs/build/lib/yargs.js:1043:55)
at Object.parse (/Users/stunjiturner/Library/pnpm/global/5/.pnpm/yargs@15.4.1/node_modules/yargs/build/lib/yargs.js:584:29)
at exports.default (/Users/stunjiturner/Library/pnpm/global/5/.pnpm/@medusajs+medusa-cli@1.3.21/node_modules/@medusajs/medusa-cli/dist/create-cli.js:321:10)
at Object.<anonymous> (/Users/stunjiturner/Library/pnpm/global/5/.pnpm/@medusajs+medusa-cli@1.3.21/node_modules/@medusajs/medusa-cli/dist/index.js:38:26)
at Module._compile (node:internal/modules/cjs/loader:1275:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1329:10)
Again, make sure you are in the root of your medusa backend folder
in railway server? figuring out how to get there
You should be able to use the cd command. Not sure where exactly you need to cd to. Maybe from the default working directory it is just the name of your repo. Just a guess. From default, try using ls to see options.
Also try pwd to see the full working directory path
I created a railway shell, but PWD does work even when, i added a command medusa seed and it creates a user, i still cant log in, with the user from the Admin deployed on Vercel...
You used lowercase or uppercase? It has to be lowercase
Another way to accomplish this would be to run the command from your local dev environment with it connected to whatever db is connected to the Railway instance.
i did that, thx @versed wharf
i am getting https://trbz-backroom-medusa-git-master-stunjiturner.vercel.app/backend-production-2423.up.railway.app/admin/auth a 405 erroswhen trying log in from the vercel deployment, login works find locally, using the same hosted DB for both
Have you deployed your admin separately from your backend? I think you've confused your admin and backend urls. The link you posted, /admin/auth, should be your backend based on the path, but it takes me to your admin.
I have deployed them separately
Backend - Railway
Admin - Vercel
On the Vercel , Open the Environment Variables collapsible, and add an environment variable with the name MEDUSA_ADMIN_BACKEND_URL with the value being the URL to your deployed Medusa backend. this should be the value in from railway correct?
Yes, but your admin app is trying to access the backend at your vercel url