5 months ago
We had no concerns until now regarding the execution of this query in our pipelines, but it stopped working overnight. Any ideas or leads to explore would be welcome!
The command:
```ssh
railway ssh --project=*** --environment=*** --service=*** "npm run migrate:deploy"
```
The github workflow:
```yaml
name: Template - Run migrations on Railway
on:
workflow_call:
inputs:
environment:
description: "Run migrations in specific environment (e.g., production, staging)"
required: true
type: string
secrets:
RAILWAY_API_TOKEN:
required: true
jobs:
run-migration:
runs-on: ubuntu-latest
environment: ${{ inputs.environment }}
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Install Railway CLI
run: npm install -g @railway/cli
- name: Run migrations
env:
RAILWAY_TOKEN: ${{ secrets.RAILWAY_API_TOKEN }}
RAILWAY_API_TOKEN: ${{ secrets.RAILWAY_API_TOKEN }}
run: |
railway ssh --project=${{ vars.RAILWAY_PROJECT_ID }} --environment=${{ vars.RAILWAY_ENV_ID }} --service=${{ vars.RAILWAY_SERVICE_ID }} "npm run migrate:deploy"
```
9 Replies
5 months ago
Hey there! We've found the following might help you get unblocked faster:
If you find the answer from one of these, please let us know by solving the thread!
Status changed to Awaiting User Response Railway • 6 months ago
5 months ago
In this case it means that sundenly it becomes to be unable to connect, Authentication fails:
Presision:
RAILWAY_TOKEN It still the same from the beginning, it has never change, voilà!
Run railway ssh --project=*** --environment=*** --service=*** "npm run migrate:deploy"
railway ssh --project=*** --environment=*** --service=*** "npm run migrate:deploy"
shell: /usr/bin/bash -e {0}
env:
RAILWAY_TOKEN: ***
RAILWAY_API_TOKEN: ***
Expected welcome message, received: ServerMessage { type: "error", payload: ServerPayload { data: Empty, message: "Authentication failed", code: None } }
Status changed to Awaiting Railway Response Railway • 6 months ago
5 months ago
Please only use a RAILWAY_API_TOKEN token, you shouldn't mix and match it with the other token, and make sure that variable is set to an account token.
Status changed to Awaiting User Response Railway • 6 months ago
5 months ago
I'll try... But that doesn't explain why it worked before!?!
Status changed to Awaiting Railway Response Railway • 5 months ago
5 months ago
I'm a bit confused as to why it worked before as well. I see an open issue here on GitHub that implies it never worked
https://github.com/railwayapp/cli/issues/657
We will look into the GitHub issue linked above and aim to fix it
Status changed to Awaiting User Response Railway • 5 months ago
5 months ago
Hello!
We're acknowledging your issue and attaching a ticket to this thread.
We don't have an ETA for it, but, our engineering team will take a look and you will be updated as we update the ticket.
Please reply to this thread if you have any questions!
5 months ago
🛠️ The ticket SSH Access Issue with Project Token has been marked as triage.
5 months ago
✅ The ticket Issue with Environment Tokens has been marked as completed.
5 months ago
This thread has been marked as solved automatically due to a lack of recent activity. Please re-open this thread or create a new one if you require further assistance. Thank you!
Status changed to Solved Railway • 5 months ago
