@cleocode/cleo 2026.3.2 → 2026.3.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -3
- package/dist/cli/index.js +7381 -3507
- package/dist/cli/index.js.map +4 -4
- package/dist/mcp/index.js +5792 -2097
- package/dist/mcp/index.js.map +4 -4
- package/package.json +4 -4
- package/packages/ct-skills/index.js +1 -1
- package/packages/ct-skills/package.json +0 -2
- package/packages/ct-skills/profiles/core.json +1 -1
- package/packages/ct-skills/profiles/full.json +4 -5
- package/packages/ct-skills/profiles/minimal.json +3 -3
- package/packages/ct-skills/profiles/recommended.json +2 -2
- package/packages/ct-skills/provider-skills-map.json +97 -0
- package/packages/ct-skills/skills/_shared/skill-chaining-patterns.md +23 -26
- package/packages/ct-skills/skills/_shared/testing-framework-config.md +9 -9
- package/packages/ct-skills/skills/ct-cleo/SKILL.md +21 -1
- package/packages/ct-skills/skills/ct-dev-workflow/SKILL.md +1 -1
- package/packages/ct-skills/skills/ct-documentor/SKILL.md +1 -1
- package/packages/ct-skills/skills/ct-epic-architect/SKILL.md +1 -1
- package/packages/ct-skills/skills/ct-grade/SKILL.md +214 -0
- package/packages/ct-skills/skills/ct-orchestrator/SKILL.md +119 -43
- package/packages/ct-skills/skills/ct-orchestrator/orchestrator-prompt.txt +17 -0
- package/packages/ct-skills/skills/ct-orchestrator/references/orchestrator-patterns.md +1 -1
- package/packages/ct-skills/skills/ct-research-agent/SKILL.md +1 -1
- package/packages/ct-skills/skills/ct-spec-writer/SKILL.md +1 -1
- package/packages/ct-skills/skills/ct-task-executor/SKILL.md +1 -1
- package/packages/ct-skills/skills/ct-validator/SKILL.md +1 -1
- package/packages/ct-skills/skills/manifest.json +217 -947
- package/packages/ct-skills/skills.json +244 -3
- package/templates/CLEO-INJECTION.md +37 -0
- package/templates/README.md +4 -4
- package/templates/cleo-gitignore +3 -11
- package/templates/git-hooks/pre-commit +1 -1
- package/packages/ct-skills/protocols/agent-protocol.md +0 -260
- package/packages/ct-skills/protocols/artifact-publish.md +0 -587
- package/packages/ct-skills/protocols/consensus.md +0 -309
- package/packages/ct-skills/protocols/contribution.md +0 -375
- package/packages/ct-skills/protocols/decomposition.md +0 -352
- package/packages/ct-skills/protocols/implementation.md +0 -344
- package/packages/ct-skills/protocols/provenance.md +0 -600
- package/packages/ct-skills/protocols/release.md +0 -635
- package/packages/ct-skills/protocols/research.md +0 -248
- package/packages/ct-skills/protocols/specification.md +0 -287
- package/packages/ct-skills/protocols/testing.md +0 -346
- package/packages/ct-skills/protocols/validation.md +0 -229
- package/packages/ct-skills/skills/ct-gitbook/SKILL.md +0 -516
- package/packages/ct-skills/skills/ct-gitbook/assets/SUMMARY.md +0 -28
- package/packages/ct-skills/skills/ct-gitbook/assets/gitbook.yaml +0 -14
- package/packages/ct-skills/skills/ct-gitbook/references/api-sdk.md +0 -318
- package/packages/ct-skills/skills/ct-gitbook/references/auth-sso.md +0 -208
- package/packages/ct-skills/skills/ct-gitbook/references/change-requests.md +0 -169
- package/packages/ct-skills/skills/ct-gitbook/references/content-blocks.md +0 -230
- package/packages/ct-skills/skills/ct-gitbook/references/docs-sites.md +0 -202
- package/packages/ct-skills/skills/ct-gitbook/references/git-sync.md +0 -175
- package/packages/ct-skills/skills/ct-gitbook/references/llm-ready.md +0 -178
- package/packages/ct-skills/skills/ct-gitbook/references/migration.md +0 -263
- package/packages/ct-skills/skills/ct-library-implementer-bash/SKILL.md +0 -316
- package/packages/ct-skills/skills/ct-skill-lookup/SKILL.md +0 -179
- package/packages/ct-skills/skills/ct-test-writer-bats/SKILL.md +0 -347
- package/packages/ct-skills/skills/railway-platform/SKILL.md +0 -506
- package/packages/ct-skills/skills/railway-platform/_shared/scripts/railway-api.sh +0 -180
- package/packages/ct-skills/skills/railway-platform/_shared/scripts/railway-common.sh +0 -262
- package/packages/ct-skills/skills/railway-platform/references/01-getting-started.md +0 -149
- package/packages/ct-skills/skills/railway-platform/references/02-projects.md +0 -116
- package/packages/ct-skills/skills/railway-platform/references/03-services.md +0 -147
- package/packages/ct-skills/skills/railway-platform/references/04-deployments.md +0 -210
- package/packages/ct-skills/skills/railway-platform/references/05-databases.md +0 -142
- package/packages/ct-skills/skills/railway-platform/references/06-environments.md +0 -261
- package/packages/ct-skills/skills/railway-platform/references/07-domains.md +0 -139
- package/packages/ct-skills/skills/railway-platform/references/08-volumes.md +0 -533
- package/packages/ct-skills/skills/railway-platform/references/09-networking.md +0 -592
- package/packages/ct-skills/skills/railway-platform/references/10-cron.md +0 -488
- package/packages/ct-skills/skills/railway-platform/references/11-functions.md +0 -170
- package/packages/ct-skills/skills/railway-platform/references/12-monorepo.md +0 -294
- package/packages/ct-skills/skills/railway-platform/references/13-troubleshooting.md +0 -335
- package/packages/ct-skills/skills/railway-platform/references/14-railway-metal.md +0 -197
|
@@ -1,294 +0,0 @@
|
|
|
1
|
-
# Monorepo Deployment Patterns
|
|
2
|
-
|
|
3
|
-
Railway supports two distinct monorepo deployment strategies. Choosing the correct approach is critical for successful builds.
|
|
4
|
-
|
|
5
|
-
## Quick Decision
|
|
6
|
-
|
|
7
|
-
| Question | Answer | Approach |
|
|
8
|
-
|----------|--------|----------|
|
|
9
|
-
| Do apps import shared code? | Yes | **Custom Commands** |
|
|
10
|
-
| Are apps completely independent? | Yes | **Root Directory** |
|
|
11
|
-
| Using pnpm/yarn workspaces? | Yes | **Custom Commands** |
|
|
12
|
-
| Using Turborepo/Nx? | Yes | **Custom Commands** |
|
|
13
|
-
|
|
14
|
-
## Strategy 1: Root Directory (Isolated Monorepo)
|
|
15
|
-
|
|
16
|
-
**Use when:** Apps are completely independent, no shared code between them.
|
|
17
|
-
|
|
18
|
-
**How it works:** Only the specified directory's code is available during build.
|
|
19
|
-
|
|
20
|
-
**Example structure:**
|
|
21
|
-
```
|
|
22
|
-
├── frontend/ # React app
|
|
23
|
-
│ ├── package.json # Standalone
|
|
24
|
-
│ └── src/
|
|
25
|
-
└── backend/ # Python API
|
|
26
|
-
├── requirements.txt
|
|
27
|
-
└── main.py
|
|
28
|
-
```
|
|
29
|
-
|
|
30
|
-
**Configuration:**
|
|
31
|
-
```json
|
|
32
|
-
{
|
|
33
|
-
"services": {
|
|
34
|
-
"frontend-service-id": {
|
|
35
|
-
"rootDirectory": "/frontend"
|
|
36
|
-
},
|
|
37
|
-
"backend-service-id": {
|
|
38
|
-
"rootDirectory": "/backend"
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
```
|
|
43
|
-
|
|
44
|
-
## Strategy 2: Custom Commands (Shared Monorepo)
|
|
45
|
-
|
|
46
|
-
**Use when:** Apps share code from common packages or use workspace tools.
|
|
47
|
-
|
|
48
|
-
**How it works:** Full repo is available, commands filter to specific packages.
|
|
49
|
-
|
|
50
|
-
**Example structure:**
|
|
51
|
-
```
|
|
52
|
-
├── package.json # Root workspace config
|
|
53
|
-
├── packages/
|
|
54
|
-
│ ├── frontend/ # Imports from shared
|
|
55
|
-
│ ├── backend/ # Imports from shared
|
|
56
|
-
│ └── shared/ # Shared utilities
|
|
57
|
-
├── pnpm-workspace.yaml
|
|
58
|
-
└── turbo.json
|
|
59
|
-
```
|
|
60
|
-
|
|
61
|
-
**Configuration:**
|
|
62
|
-
|
|
63
|
-
### pnpm Workspaces
|
|
64
|
-
```json
|
|
65
|
-
{
|
|
66
|
-
"services": {
|
|
67
|
-
"frontend-service-id": {
|
|
68
|
-
"build": {
|
|
69
|
-
"buildCommand": "pnpm --filter frontend build"
|
|
70
|
-
},
|
|
71
|
-
"deploy": {
|
|
72
|
-
"startCommand": "pnpm --filter frontend start"
|
|
73
|
-
},
|
|
74
|
-
"source": {
|
|
75
|
-
"watchPatterns": [
|
|
76
|
-
"/packages/frontend/**",
|
|
77
|
-
"/packages/shared/**"
|
|
78
|
-
]
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
```
|
|
84
|
-
|
|
85
|
-
### npm Workspaces
|
|
86
|
-
```json
|
|
87
|
-
{
|
|
88
|
-
"services": {
|
|
89
|
-
"backend-service-id": {
|
|
90
|
-
"build": {
|
|
91
|
-
"buildCommand": "npm run build --workspace=packages/backend"
|
|
92
|
-
},
|
|
93
|
-
"deploy": {
|
|
94
|
-
"startCommand": "npm run start --workspace=packages/backend"
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
```
|
|
100
|
-
|
|
101
|
-
### Yarn Workspaces
|
|
102
|
-
```json
|
|
103
|
-
{
|
|
104
|
-
"services": {
|
|
105
|
-
"backend-service-id": {
|
|
106
|
-
"build": {
|
|
107
|
-
"buildCommand": "yarn workspace backend build"
|
|
108
|
-
},
|
|
109
|
-
"deploy": {
|
|
110
|
-
"startCommand": "yarn workspace backend start"
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
```
|
|
116
|
-
|
|
117
|
-
### Turborepo
|
|
118
|
-
```json
|
|
119
|
-
{
|
|
120
|
-
"services": {
|
|
121
|
-
"frontend-service-id": {
|
|
122
|
-
"build": {
|
|
123
|
-
"buildCommand": "turbo run build --filter=frontend"
|
|
124
|
-
},
|
|
125
|
-
"deploy": {
|
|
126
|
-
"startCommand": "turbo run start --filter=frontend"
|
|
127
|
-
},
|
|
128
|
-
"source": {
|
|
129
|
-
"watchPatterns": [
|
|
130
|
-
"/apps/frontend/**",
|
|
131
|
-
"/packages/**"
|
|
132
|
-
]
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
```
|
|
138
|
-
|
|
139
|
-
## Watch Paths
|
|
140
|
-
|
|
141
|
-
Prevent unnecessary rebuilds by setting watch patterns.
|
|
142
|
-
|
|
143
|
-
**Critical:** Include shared packages that services depend on.
|
|
144
|
-
|
|
145
|
-
```json
|
|
146
|
-
{
|
|
147
|
-
"services": {
|
|
148
|
-
"frontend-service-id": {
|
|
149
|
-
"source": {
|
|
150
|
-
"watchPatterns": [
|
|
151
|
-
"/packages/frontend/**",
|
|
152
|
-
"/packages/shared/**",
|
|
153
|
-
"/packages/ui/**"
|
|
154
|
-
]
|
|
155
|
-
}
|
|
156
|
-
},
|
|
157
|
-
"backend-service-id": {
|
|
158
|
-
"source": {
|
|
159
|
-
"watchPatterns": [
|
|
160
|
-
"/packages/backend/**",
|
|
161
|
-
"/packages/shared/**",
|
|
162
|
-
"/packages/db/**"
|
|
163
|
-
]
|
|
164
|
-
}
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
}
|
|
168
|
-
```
|
|
169
|
-
|
|
170
|
-
**Pattern format:** Gitignore-style patterns
|
|
171
|
-
- `/packages/frontend/**` - All files in frontend
|
|
172
|
-
- `!**/*.md` - Ignore markdown changes
|
|
173
|
-
|
|
174
|
-
## Common Mistakes
|
|
175
|
-
|
|
176
|
-
### Mistake 1: Root Directory with Shared Code
|
|
177
|
-
|
|
178
|
-
**Wrong:**
|
|
179
|
-
```json
|
|
180
|
-
{
|
|
181
|
-
"services": {
|
|
182
|
-
"backend": {
|
|
183
|
-
"rootDirectory": "/packages/backend"
|
|
184
|
-
}
|
|
185
|
-
}
|
|
186
|
-
}
|
|
187
|
-
```
|
|
188
|
-
**Result:** Build fails - shared package not accessible.
|
|
189
|
-
|
|
190
|
-
**Right:**
|
|
191
|
-
```json
|
|
192
|
-
{
|
|
193
|
-
"services": {
|
|
194
|
-
"backend": {
|
|
195
|
-
"build": {
|
|
196
|
-
"buildCommand": "pnpm --filter backend build"
|
|
197
|
-
},
|
|
198
|
-
"deploy": {
|
|
199
|
-
"startCommand": "pnpm --filter backend start"
|
|
200
|
-
}
|
|
201
|
-
}
|
|
202
|
-
}
|
|
203
|
-
}
|
|
204
|
-
```
|
|
205
|
-
|
|
206
|
-
### Mistake 2: Missing Shared Package in Watch Paths
|
|
207
|
-
|
|
208
|
-
**Wrong:**
|
|
209
|
-
```json
|
|
210
|
-
{
|
|
211
|
-
"services": {
|
|
212
|
-
"backend": {
|
|
213
|
-
"source": {
|
|
214
|
-
"watchPatterns": ["/packages/backend/**"]
|
|
215
|
-
}
|
|
216
|
-
}
|
|
217
|
-
}
|
|
218
|
-
}
|
|
219
|
-
```
|
|
220
|
-
**Result:** Changes to shared package don't trigger backend rebuild.
|
|
221
|
-
|
|
222
|
-
**Right:**
|
|
223
|
-
```json
|
|
224
|
-
{
|
|
225
|
-
"source": {
|
|
226
|
-
"watchPatterns": [
|
|
227
|
-
"/packages/backend/**",
|
|
228
|
-
"/packages/shared/**"
|
|
229
|
-
]
|
|
230
|
-
}
|
|
231
|
-
}
|
|
232
|
-
```
|
|
233
|
-
|
|
234
|
-
## Detection
|
|
235
|
-
|
|
236
|
-
### Check for Isolated Monorepo
|
|
237
|
-
```bash
|
|
238
|
-
# Apps have separate package.json
|
|
239
|
-
# No imports between directories
|
|
240
|
-
# No workspace config at root
|
|
241
|
-
ls apps/*/package.json | wc -l # Multiple package.json
|
|
242
|
-
! test -f package.json || ! grep -q workspaces package.json
|
|
243
|
-
```
|
|
244
|
-
|
|
245
|
-
### Check for Shared Monorepo
|
|
246
|
-
```bash
|
|
247
|
-
# Has workspace indicators
|
|
248
|
-
[[ -f pnpm-workspace.yaml ]] || [[ -f turbo.json ]] || [[ -f nx.json ]] || grep -q workspaces package.json
|
|
249
|
-
|
|
250
|
-
# Or imports from sibling packages
|
|
251
|
-
grep -r "@myapp/shared" packages/
|
|
252
|
-
```
|
|
253
|
-
|
|
254
|
-
## Examples
|
|
255
|
-
|
|
256
|
-
### Complete Microservices Setup
|
|
257
|
-
|
|
258
|
-
```json
|
|
259
|
-
{
|
|
260
|
-
"services": {
|
|
261
|
-
"gateway": {
|
|
262
|
-
"variables": {
|
|
263
|
-
"AUTH_SERVICE": {"value": "http://auth.railway.internal:8080"},
|
|
264
|
-
"USER_SERVICE": {"value": "http://users.railway.internal:8080"},
|
|
265
|
-
"ORDER_SERVICE": {"value": "http://orders.railway.internal:8080"}
|
|
266
|
-
}
|
|
267
|
-
},
|
|
268
|
-
"auth": {
|
|
269
|
-
"variables": {
|
|
270
|
-
"DATABASE_URL": {"value": "${{AuthDB.DATABASE_URL}}"},
|
|
271
|
-
"REDIS_URL": {"value": "${{Redis.REDIS_URL}}"}
|
|
272
|
-
}
|
|
273
|
-
},
|
|
274
|
-
"users": {
|
|
275
|
-
"variables": {
|
|
276
|
-
"DATABASE_URL": {"value": "${{UsersDB.DATABASE_URL}}"},
|
|
277
|
-
"AUTH_URL": {"value": "http://auth.railway.internal:8080"}
|
|
278
|
-
}
|
|
279
|
-
}
|
|
280
|
-
}
|
|
281
|
-
}
|
|
282
|
-
```
|
|
283
|
-
|
|
284
|
-
## Summary
|
|
285
|
-
|
|
286
|
-
| Aspect | Root Directory | Custom Commands |
|
|
287
|
-
|--------|---------------|-----------------|
|
|
288
|
-
| **Code isolation** | Each service sees only its directory | All services see full repo |
|
|
289
|
-
| **Shared packages** | Not supported | Fully supported |
|
|
290
|
-
| **Build speed** | Faster (less context) | Slower (full repo) |
|
|
291
|
-
| **Workspace tools** | Not compatible | Required |
|
|
292
|
-
| **Watch paths** | Optional | Essential |
|
|
293
|
-
|
|
294
|
-
**Golden rule:** If apps import from each other or use workspace tools, use Custom Commands. If completely independent, use Root Directory.
|
|
@@ -1,335 +0,0 @@
|
|
|
1
|
-
# Troubleshooting
|
|
2
|
-
|
|
3
|
-
Common issues and their solutions.
|
|
4
|
-
|
|
5
|
-
## Installation Issues
|
|
6
|
-
|
|
7
|
-
### "command not found: railway"
|
|
8
|
-
|
|
9
|
-
**Cause:** CLI not installed or not in PATH.
|
|
10
|
-
|
|
11
|
-
**Solution:**
|
|
12
|
-
```bash
|
|
13
|
-
# Install
|
|
14
|
-
npm install -g @railway/cli
|
|
15
|
-
|
|
16
|
-
# Or via Homebrew
|
|
17
|
-
brew install railway
|
|
18
|
-
|
|
19
|
-
# Verify
|
|
20
|
-
which railway
|
|
21
|
-
```
|
|
22
|
-
|
|
23
|
-
### "EACCES: permission denied"
|
|
24
|
-
|
|
25
|
-
**Cause:** npm global permissions issue.
|
|
26
|
-
|
|
27
|
-
**Solution:**
|
|
28
|
-
```bash
|
|
29
|
-
# Fix npm permissions
|
|
30
|
-
mkdir ~/.npm-global
|
|
31
|
-
npm config set prefix '~/.npm-global'
|
|
32
|
-
export PATH=~/.npm-global/bin:$PATH
|
|
33
|
-
|
|
34
|
-
# Then reinstall
|
|
35
|
-
npm install -g @railway/cli
|
|
36
|
-
```
|
|
37
|
-
|
|
38
|
-
## Authentication Issues
|
|
39
|
-
|
|
40
|
-
### "not authenticated"
|
|
41
|
-
|
|
42
|
-
**Cause:** Not logged in.
|
|
43
|
-
|
|
44
|
-
**Solution:**
|
|
45
|
-
```bash
|
|
46
|
-
railway login
|
|
47
|
-
|
|
48
|
-
# For SSH/browserless
|
|
49
|
-
railway login --browserless
|
|
50
|
-
```
|
|
51
|
-
|
|
52
|
-
### "token expired"
|
|
53
|
-
|
|
54
|
-
**Cause:** Session expired.
|
|
55
|
-
|
|
56
|
-
**Solution:**
|
|
57
|
-
```bash
|
|
58
|
-
railway logout
|
|
59
|
-
railway login
|
|
60
|
-
```
|
|
61
|
-
|
|
62
|
-
## Project Issues
|
|
63
|
-
|
|
64
|
-
### "No linked project"
|
|
65
|
-
|
|
66
|
-
**Cause:** Current directory not linked to Railway project.
|
|
67
|
-
|
|
68
|
-
**Solution:**
|
|
69
|
-
```bash
|
|
70
|
-
# Link to existing
|
|
71
|
-
railway link -p project-name
|
|
72
|
-
|
|
73
|
-
# Or create new
|
|
74
|
-
railway init -n new-project
|
|
75
|
-
|
|
76
|
-
# Check parent directories
|
|
77
|
-
# Railway CLI walks up directory tree
|
|
78
|
-
```
|
|
79
|
-
|
|
80
|
-
### "Project not found"
|
|
81
|
-
|
|
82
|
-
**Cause:** Wrong project name or no access.
|
|
83
|
-
|
|
84
|
-
**Solution:**
|
|
85
|
-
```bash
|
|
86
|
-
# List available projects
|
|
87
|
-
railway list
|
|
88
|
-
|
|
89
|
-
# Verify access in Railway dashboard
|
|
90
|
-
```
|
|
91
|
-
|
|
92
|
-
## Deployment Issues
|
|
93
|
-
|
|
94
|
-
### "Build failed"
|
|
95
|
-
|
|
96
|
-
**Symptoms:** Deployment status FAILED, CI mode shows errors.
|
|
97
|
-
|
|
98
|
-
**Common Causes & Fixes:**
|
|
99
|
-
|
|
100
|
-
**Missing dependencies:**
|
|
101
|
-
```bash
|
|
102
|
-
# Check package.json, requirements.txt exist
|
|
103
|
-
cat package.json | head -20
|
|
104
|
-
|
|
105
|
-
# Verify lock file
|
|
106
|
-
ls package-lock.json yarn.lock pnpm-lock.yaml
|
|
107
|
-
```
|
|
108
|
-
|
|
109
|
-
**Out of memory:**
|
|
110
|
-
```bash
|
|
111
|
-
# Increase Node memory
|
|
112
|
-
railway variables set NODE_OPTIONS="--max-old-space-size=4096"
|
|
113
|
-
```
|
|
114
|
-
|
|
115
|
-
**Wrong build command:**
|
|
116
|
-
```bash
|
|
117
|
-
# Check build command
|
|
118
|
-
railway logs --build --lines 100
|
|
119
|
-
|
|
120
|
-
# See 06-environments.md to fix
|
|
121
|
-
```
|
|
122
|
-
|
|
123
|
-
### "Service crashed"
|
|
124
|
-
|
|
125
|
-
**Symptoms:** Status CRASHED, constant restarts.
|
|
126
|
-
|
|
127
|
-
**Common Causes & Fixes:**
|
|
128
|
-
|
|
129
|
-
**Port not configured:**
|
|
130
|
-
```javascript
|
|
131
|
-
// Wrong
|
|
132
|
-
app.listen(3000);
|
|
133
|
-
|
|
134
|
-
// Right
|
|
135
|
-
app.listen(process.env.PORT || 3000);
|
|
136
|
-
```
|
|
137
|
-
|
|
138
|
-
**Missing start command:**
|
|
139
|
-
```bash
|
|
140
|
-
# Verify start command
|
|
141
|
-
railway logs --lines 50
|
|
142
|
-
|
|
143
|
-
# Set in package.json or via config
|
|
144
|
-
```
|
|
145
|
-
|
|
146
|
-
**Runtime error:**
|
|
147
|
-
```bash
|
|
148
|
-
# Check logs
|
|
149
|
-
railway logs --lines 200
|
|
150
|
-
|
|
151
|
-
# SSH to debug
|
|
152
|
-
railway ssh
|
|
153
|
-
```
|
|
154
|
-
|
|
155
|
-
### "No such file or directory"
|
|
156
|
-
|
|
157
|
-
**Cause:** File path issues in container.
|
|
158
|
-
|
|
159
|
-
**Fix:**
|
|
160
|
-
```bash
|
|
161
|
-
# Use absolute paths
|
|
162
|
-
const path = require('path');
|
|
163
|
-
const file = path.join(__dirname, 'file.txt');
|
|
164
|
-
|
|
165
|
-
# Or use process.cwd()
|
|
166
|
-
const file = path.join(process.cwd(), 'file.txt');
|
|
167
|
-
```
|
|
168
|
-
|
|
169
|
-
## Database Issues
|
|
170
|
-
|
|
171
|
-
### "connection refused"
|
|
172
|
-
|
|
173
|
-
**Cause:** Cannot connect to database.
|
|
174
|
-
|
|
175
|
-
**Check:**
|
|
176
|
-
1. Database service running
|
|
177
|
-
2. Using correct DATABASE_URL
|
|
178
|
-
3. Same environment
|
|
179
|
-
4. Database initialized
|
|
180
|
-
|
|
181
|
-
**Debug:**
|
|
182
|
-
```bash
|
|
183
|
-
# Test connection
|
|
184
|
-
railway connect
|
|
185
|
-
|
|
186
|
-
# Check database logs
|
|
187
|
-
railway logs --service postgres --lines 100
|
|
188
|
-
```
|
|
189
|
-
|
|
190
|
-
### "database does not exist"
|
|
191
|
-
|
|
192
|
-
**Cause:** Database not initialized.
|
|
193
|
-
|
|
194
|
-
**Solution:**
|
|
195
|
-
```bash
|
|
196
|
-
# Wait for database to start
|
|
197
|
-
# Or recreate from template
|
|
198
|
-
```
|
|
199
|
-
|
|
200
|
-
## Networking Issues
|
|
201
|
-
|
|
202
|
-
### "ENOTFOUND api.railway.internal"
|
|
203
|
-
|
|
204
|
-
**Cause:** Private domain not resolving.
|
|
205
|
-
|
|
206
|
-
**Check:**
|
|
207
|
-
1. Services in same project/environment
|
|
208
|
-
2. Target service deployed
|
|
209
|
-
3. Using correct domain format
|
|
210
|
-
|
|
211
|
-
**Debug:**
|
|
212
|
-
```bash
|
|
213
|
-
# SSH and test
|
|
214
|
-
railway ssh
|
|
215
|
-
nslookup api.railway.internal
|
|
216
|
-
ping api.railway.internal
|
|
217
|
-
```
|
|
218
|
-
|
|
219
|
-
### "Connection timeout"
|
|
220
|
-
|
|
221
|
-
**Cause:** Service not responding.
|
|
222
|
-
|
|
223
|
-
**Check:**
|
|
224
|
-
1. Service running: `railway service status`
|
|
225
|
-
2. Correct port exposed
|
|
226
|
-
3. No firewall blocking
|
|
227
|
-
4. Health checks passing
|
|
228
|
-
|
|
229
|
-
## Performance Issues
|
|
230
|
-
|
|
231
|
-
### Slow response times
|
|
232
|
-
|
|
233
|
-
**Check:**
|
|
234
|
-
```bash
|
|
235
|
-
# View metrics
|
|
236
|
-
railway metrics --service my-service
|
|
237
|
-
|
|
238
|
-
# Check CPU/Memory usage
|
|
239
|
-
# Look for spikes during requests
|
|
240
|
-
```
|
|
241
|
-
|
|
242
|
-
**Solutions:**
|
|
243
|
-
- Increase replicas
|
|
244
|
-
- Add caching (Redis)
|
|
245
|
-
- Optimize database queries
|
|
246
|
-
- Use CDN for static assets
|
|
247
|
-
|
|
248
|
-
### High memory usage
|
|
249
|
-
|
|
250
|
-
**Solutions:**
|
|
251
|
-
- Check for memory leaks
|
|
252
|
-
- Optimize data processing
|
|
253
|
-
- Increase memory limit (if on Pro)
|
|
254
|
-
- Use streaming for large files
|
|
255
|
-
|
|
256
|
-
## Debugging Commands
|
|
257
|
-
|
|
258
|
-
### Full Status Check
|
|
259
|
-
|
|
260
|
-
```bash
|
|
261
|
-
# CLI installed
|
|
262
|
-
command -v railway && echo "✓ CLI installed" || echo "✗ CLI missing"
|
|
263
|
-
|
|
264
|
-
# Authenticated
|
|
265
|
-
railway whoami --json && echo "✓ Authenticated" || echo "✗ Not authenticated"
|
|
266
|
-
|
|
267
|
-
# Project linked
|
|
268
|
-
railway status --json && echo "✓ Project linked" || echo "✗ Not linked"
|
|
269
|
-
|
|
270
|
-
# Service deployed
|
|
271
|
-
railway service status --json | jq '.deployment.status'
|
|
272
|
-
```
|
|
273
|
-
|
|
274
|
-
### Log Analysis
|
|
275
|
-
|
|
276
|
-
```bash
|
|
277
|
-
# Recent errors
|
|
278
|
-
railway logs --lines 100 --filter "@level:error"
|
|
279
|
-
|
|
280
|
-
# Specific time range
|
|
281
|
-
railway logs --since 1h --until 30m --lines 200
|
|
282
|
-
|
|
283
|
-
# Build and deploy
|
|
284
|
-
railway logs --build --lines 100
|
|
285
|
-
railway logs --lines 100
|
|
286
|
-
```
|
|
287
|
-
|
|
288
|
-
### SSH Debugging
|
|
289
|
-
|
|
290
|
-
```bash
|
|
291
|
-
# Access container
|
|
292
|
-
railway ssh
|
|
293
|
-
|
|
294
|
-
# Check environment
|
|
295
|
-
env | grep RAILWAY
|
|
296
|
-
|
|
297
|
-
# Test network
|
|
298
|
-
curl http://localhost:$PORT/health
|
|
299
|
-
|
|
300
|
-
# Check files
|
|
301
|
-
ls -la /app
|
|
302
|
-
```
|
|
303
|
-
|
|
304
|
-
## Getting Help
|
|
305
|
-
|
|
306
|
-
### Railway Support
|
|
307
|
-
|
|
308
|
-
1. **Central Station:** https://station.railway.com
|
|
309
|
-
2. **Discord:** https://discord.gg/railway
|
|
310
|
-
3. **Documentation:** https://docs.railway.com
|
|
311
|
-
|
|
312
|
-
### Information to Provide
|
|
313
|
-
|
|
314
|
-
When asking for help, include:
|
|
315
|
-
- Project ID
|
|
316
|
-
- Service name
|
|
317
|
-
- Error messages
|
|
318
|
-
- Recent changes
|
|
319
|
-
- Deployment ID (if specific)
|
|
320
|
-
|
|
321
|
-
### Debug Bundle
|
|
322
|
-
|
|
323
|
-
```bash
|
|
324
|
-
# Collect debug info
|
|
325
|
-
{
|
|
326
|
-
echo "=== Status ==="
|
|
327
|
-
railway status --json
|
|
328
|
-
|
|
329
|
-
echo "=== Recent Deployments ==="
|
|
330
|
-
railway deployment list --limit 5 --json
|
|
331
|
-
|
|
332
|
-
echo "=== Recent Logs ==="
|
|
333
|
-
railway logs --lines 50
|
|
334
|
-
} > debug.txt
|
|
335
|
-
```
|