R
Railway•14mo ago
gabe

Cache mount ID is not prefixed with cache key

I'm trying to build a docker image with the recommended instructions from pnpm (https://pnpm.io/docker), adding RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile to my dockerfile, but when building on railway i'm getting a Cache mount ID is not prefixed with cache key build error when building the docker image, which doesn't tell me much just from that. Searching here, I found out this thread https://discord.com/channels/713503345364697088/1104400912149123152/1104400912149123152, which looks the same problem as mine, and that it was suggested to attach the service ID into the id part, which I did with the following:
RUN --mount=type=cache,id=2d13c748-906b-4f06-bdbc-9a9cbdb84534-pnpm,target=/pnpm/store pnpm install --frozen-lockfile
RUN --mount=type=cache,id=2d13c748-906b-4f06-bdbc-9a9cbdb84534-pnpm,target=/pnpm/store pnpm install --frozen-lockfile
And also this:
RUN --mount=type=cache,id=s/2d13c748-906b-4f06-bdbc-9a9cbdb84534/pnpm,target=/pnpm/store pnpm install --frozen-lockfile
RUN --mount=type=cache,id=s/2d13c748-906b-4f06-bdbc-9a9cbdb84534/pnpm,target=/pnpm/store pnpm install --frozen-lockfile
But I think this is still not the correct format, as both resulted in the same error. Am I formatting this wrong? The service-id is 2d13c748-906b-4f06-bdbc-9a9cbdb84534
Discord
Discord - A New Way to Chat with Friends & Communities
Discord is the easiest way to communicate over voice, video, and text. Chat, hang out, and stay close with your friends and communities.
111 Replies
Percy
Percy•14mo ago
Project ID: 2d13c748-906b-4f06-bdbc-9a9cbdb84534,2d13c748-906b-4f06-bdbc-9a9cbdb84534,2d13c748-906b-4f06-bdbc-9a9cbdb84534
gabe
gabeOP•14mo ago
This also doesn't work RUN --mount=type=cache,id=s/2d13c748-906b-4f06-bdbc-9a9cbdb84534-/root/pnpm,target=/root/pnpm/store pnpm install --frozen-lockfile
Brody
Brody•14mo ago
what's the default cache key look like as generated by nixpacks?
gabe
gabeOP•14mo ago
looks like its RUN --mount=type=cache,id=s/2d13c748-906b-4f06-bdbc-9a9cbdb84534-/root/local/share/pnpm/store/v3,target=/root/.local/share/pnpm/store/v3 pnpm i --frozen-lockfile, seems to be following the same pattern as my previous message, but using a different folder 🤔 I tried with that exact same one, and I still get the same error:
[Region: us-west1]
Cache mount ID is not prefixed with cache key
[Region: us-west1]
Cache mount ID is not prefixed with cache key
Brody
Brody•14mo ago
well any reason you arent just using nixpacks?
gabe
gabeOP•14mo ago
I was having a bug where after one random commit with just an unrelated package update it just refused to run the build script, it would just try to start right away, so docker gave me more confidence overall that it would do what I expect it to, and if it doesn't, I can easily reproduce it locally also, i'm not very familiar with nixpacks, which also counts against ahahah
Brody
Brody•14mo ago
refused to run the build script?
gabe
gabeOP•14mo ago
yes, it would just apparently clone the repo and execute the run script. I did manage to make it work by attaching the build script to the start command, but that was way too hacky
Brody
Brody•14mo ago
if you have a build script in your package.json it will be ran
gabe
gabeOP•14mo ago
its what I would expect as well, but my app kept on crashing cause it wouldn't find the dist folder. when I copy and pasted the build command into the start command, then it start running fine
Brody
Brody•14mo ago
can you reproduce this?
gabe
gabeOP•14mo ago
guess I can try again, but I still do have some deployment logs, is that enough?
gabe
gabeOP•14mo ago
gabe
gabeOP•14mo ago
wait, I think that one is the one with the fix
Brody
Brody•14mo ago
that start command tho lol
gabe
gabeOP•14mo ago
me trying to debug lmao
Brody
Brody•14mo ago
you set that build command in the service settings right?
gabe
gabeOP•14mo ago
this is the one where the error started happening out of nowhere
gabe
gabeOP•14mo ago
yep
Brody
Brody•14mo ago
okay hold up what is with these file names
gabe
gabeOP•14mo ago
this is one where it did work
gabe
gabeOP•14mo ago
(before that commit)
Brody
Brody•14mo ago
are you changing these file names?
gabe
gabeOP•14mo ago
which filenames?
Brody
Brody•14mo ago
the log file filenames
gabe
gabeOP•14mo ago
ah, not really, I guess discord randomizes it
Brody
Brody•14mo ago
no it doesnt?
Brody
Brody•14mo ago
where are your random names coming from
gabe
gabeOP•14mo ago
hmmm, weird, looks fine in here
gabe
gabeOP•14mo ago
but yeah, after the upload it gets randomized i can try attaching it instead or zipping it lol
Brody
Brody•14mo ago
you got something funky going on with your discord, doesnt matter, just wanted to know if my code was buggin okay so most people who have turbo repos have specfic build and start commands to filter build and filter start an app you are using cd, you never want to use cd
gabe
gabeOP•14mo ago
I also tried with filter, but i got the same result
Brody
Brody•14mo ago
can you share the repo
gabe
gabeOP•14mo ago
I'd prefer to avoid it if possible... tbh, I think theres some weird stuff going on on the railway project itself, as I mentioned, I was using nixpacks before, but switched to docker, and now the build command is gone from the UI, but its still displayed as set on the configs, even displaying a warning that its not supported (but I can't remove anyway)
No description
No description
Brody
Brody•14mo ago
yeah that's a UI bug but the missing dist folder isn't a problem with nixpacks really, but more so how your project is configured
gabe
gabeOP•14mo ago
I do believe that could be the case, I just don't see how though. It was working fine until this commit, which just updates a package to a later version (no changes to the scripts, no changes to railway deploy config, etc)
No description
gabe
gabeOP•14mo ago
after that all builds started failing (the code isn't even related to the railway app, its for another package deployed on vercel)
Brody
Brody•14mo ago
id be happy to dive into this further but it's just gonna be me asking you a bunch of questions
gabe
gabeOP•14mo ago
and it started working again after I copy and pasted the build command into the start script (literally the same one) yep, I understand, its a weird issue ahahah in any case, I'm good now with docker, I just have that same problem with caching though
Brody
Brody•14mo ago
what are the build and start scripts in the bot's package.json?
gabe
gabeOP•14mo ago
"start": "node ./dist/src/index.js", "build": "rimraf dist && tsc -p . --outDir dist",
Brody
Brody•14mo ago
what the heck is rimraf
gabe
gabeOP•14mo ago
its an npm package to do rm -rf in an os agnostic way
gabe
gabeOP•14mo ago
npm
rimraf
A deep deletion module for node (like rm -rf). Latest version: 5.0.5, last published: 16 days ago. Start using rimraf in your project by running npm i rimraf. There are 20346 other projects in the npm registry using rimraf.
Brody
Brody•14mo ago
okay but why lol
gabe
gabeOP•14mo ago
I have a friend developing on windows, so it has its quirks doesn't hurt ahahah
Brody
Brody•14mo ago
you shouldn't have the dist folder in your github repo at all, and therefore it wouldn't be on railway and wouldn't be there when your friend pulls the repo
gabe
gabeOP•14mo ago
ahhh, yeah, I know, its just for local 😄 to make sure we clean the dir, to avoid having duplicated files (if you delete a file, it will still be on the build dir in the end if you don't clean it up. which can lead to all sorts of weird behaviours) on deployments it should make no difference
Brody
Brody•14mo ago
doesn't tsc have an option to clean the dist folder for you?
gabe
gabeOP•14mo ago
if it does, I don't know, would be quite helpful ahahah
Brody
Brody•14mo ago
but yes you are right it wouldn't cause issues, it's just odd in this context
gabe
gabeOP•14mo ago
I think it only overrides the files
Brody
Brody•14mo ago
in your railway service what do you have the root dir set to
gabe
gabeOP•14mo ago
Its blank now, I think it was also blank when I was on nixpacks at least I can't find the option on that deployment
Brody
Brody•14mo ago
okay blank is good the last build that worked without issues, before you made that change in a different app, what version of nixpacks was it using?
gabe
gabeOP•14mo ago
it says Nixpacks v1.17.0 on the logs
Brody
Brody•14mo ago
okay so it's not anything railway changed since that's still the latest
gabe
gabeOP•14mo ago
in case its useful, this is the build logs from the build that worked before the one that started failing
Brody
Brody•14mo ago
can you show me the dist related error?
gabe
gabeOP•14mo ago
sure, this is the error:
> [email protected] start /app/apps/bot

> node ./dist/src/index.js

node:internal/modules/cjs/loader:1080

throw err;

^

Error: Cannot find module '/app/apps/bot/dist/src/index.js'

at Module._resolveFilename (node:internal/modules/cjs/loader:1077:15)

at Module._load (node:internal/modules/cjs/loader:922:27)

at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)

at node:internal/main/run_main_module:23:47 {

code: 'MODULE_NOT_FOUND',

requireStack: []

}

Node.js v18.17.1

ELIFECYCLE  Command failed with exit code 1.

> [email protected] start /app/apps/bot

> node ./dist/src/index.js

node:internal/modules/cjs/loader:1080

throw err;

^

Error: Cannot find module '/app/apps/bot/dist/src/index.js'

at Module._resolveFilename (node:internal/modules/cjs/loader:1077:15)

at Module._load (node:internal/modules/cjs/loader:922:27)

at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)

at node:internal/main/run_main_module:23:47 {

code: 'MODULE_NOT_FOUND',

requireStack: []

}

Node.js v18.17.1

ELIFECYCLE  Command failed with exit code 1.
> [email protected] start /app/apps/bot

> node ./dist/src/index.js

node:internal/modules/cjs/loader:1080

throw err;

^

Error: Cannot find module '/app/apps/bot/dist/src/index.js'

at Module._resolveFilename (node:internal/modules/cjs/loader:1077:15)

at Module._load (node:internal/modules/cjs/loader:922:27)

at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)

at node:internal/main/run_main_module:23:47 {

code: 'MODULE_NOT_FOUND',

requireStack: []

}

Node.js v18.17.1

ELIFECYCLE  Command failed with exit code 1.

> [email protected] start /app/apps/bot

> node ./dist/src/index.js

node:internal/modules/cjs/loader:1080

throw err;

^

Error: Cannot find module '/app/apps/bot/dist/src/index.js'

at Module._resolveFilename (node:internal/modules/cjs/loader:1077:15)

at Module._load (node:internal/modules/cjs/loader:922:27)

at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)

at node:internal/main/run_main_module:23:47 {

code: 'MODULE_NOT_FOUND',

requireStack: []

}

Node.js v18.17.1

ELIFECYCLE  Command failed with exit code 1.
this repeats over and over again, until the service gets to a crashed state and stops trying run again I also do have logs for a deployment I made where the start script is cd ./apps/bot && ls -lA && ls -lA dist && ls -lA dist/src && pnpm start, to debug the contents of the file on the server, and this is the output:
ls: cannot access 'dist': No such file or directory

total 36

-rw-r--r-- 1 root root 47 Oct 12 08:48 .eslintrc.js

-rw-r--r-- 1 root root 2408 Oct 12 08:48 .gitignore

-rw-r--r-- 1 root root 436 Oct 12 08:48 .prettierignore

drwxr-xr-x 2 root root 4096 Oct 12 08:48 .turbo

-rw-r--r-- 1 root root 449 Oct 12 08:48 drizzle.config.ts

drwxr-xr-x 6 root root 4096 Oct 12 08:48 node_modules

-rw-r--r-- 1 root root 1070 Oct 12 08:48 package.json

drwxr-xr-x 1 root root 4096 Oct 12 08:48 src

-rw-r--r-- 1 root root 77 Oct 12 08:48 tsconfig.json

ls: cannot access 'dist': No such file or directory

total 36

-rw-r--r-- 1 root root 47 Oct 12 08:48 .eslintrc.js

-rw-r--r-- 1 root root 2408 Oct 12 08:48 .gitignore

-rw-r--r-- 1 root root 436 Oct 12 08:48 .prettierignore

drwxr-xr-x 2 root root 4096 Oct 12 08:48 .turbo

-rw-r--r-- 1 root root 449 Oct 12 08:48 drizzle.config.ts

drwxr-xr-x 6 root root 4096 Oct 12 08:48 node_modules

-rw-r--r-- 1 root root 1070 Oct 12 08:48 package.json

drwxr-xr-x 1 root root 4096 Oct 12 08:48 src

-rw-r--r-- 1 root root 77 Oct 12 08:48 tsconfig.json

ls: cannot access 'dist': No such file or directory
ls: cannot access 'dist': No such file or directory

total 36

-rw-r--r-- 1 root root 47 Oct 12 08:48 .eslintrc.js

-rw-r--r-- 1 root root 2408 Oct 12 08:48 .gitignore

-rw-r--r-- 1 root root 436 Oct 12 08:48 .prettierignore

drwxr-xr-x 2 root root 4096 Oct 12 08:48 .turbo

-rw-r--r-- 1 root root 449 Oct 12 08:48 drizzle.config.ts

drwxr-xr-x 6 root root 4096 Oct 12 08:48 node_modules

-rw-r--r-- 1 root root 1070 Oct 12 08:48 package.json

drwxr-xr-x 1 root root 4096 Oct 12 08:48 src

-rw-r--r-- 1 root root 77 Oct 12 08:48 tsconfig.json

ls: cannot access 'dist': No such file or directory

total 36

-rw-r--r-- 1 root root 47 Oct 12 08:48 .eslintrc.js

-rw-r--r-- 1 root root 2408 Oct 12 08:48 .gitignore

-rw-r--r-- 1 root root 436 Oct 12 08:48 .prettierignore

drwxr-xr-x 2 root root 4096 Oct 12 08:48 .turbo

-rw-r--r-- 1 root root 449 Oct 12 08:48 drizzle.config.ts

drwxr-xr-x 6 root root 4096 Oct 12 08:48 node_modules

-rw-r--r-- 1 root root 1070 Oct 12 08:48 package.json

drwxr-xr-x 1 root root 4096 Oct 12 08:48 src

-rw-r--r-- 1 root root 77 Oct 12 08:48 tsconfig.json

ls: cannot access 'dist': No such file or directory
again, this repeats over and over
Brody
Brody•14mo ago
you know why it's repeating right
gabe
gabeOP•14mo ago
its the restart policy I imagine
Brody
Brody•14mo ago
yep
gabe
gabeOP•14mo ago
the next deployment I tried doing this as the start command: pnpm build --filter bot && cd ./apps/bot && ls -lA && ls -lA dist && ls -lA dist/src && pnpm start. With this, the dist folder got properly populated, and I got the following output:
Brody
Brody•14mo ago
so I imagine the dist folder is being created, just not put in the correct directory
gabe
gabeOP•14mo ago
lists:build: 08:54:13 AM [build] Completed in 0.99s.

bot:build:

Tasks: 2 successful, 2 total

Cached: 0 cached, 2 total

Time: 6.621s

total 44

-rw-r--r-- 1 root root 47 Oct 12 08:52 .eslintrc.js

-rw-r--r-- 1 root root 2408 Oct 12 08:52 .gitignore

-rw-r--r-- 1 root root 436 Oct 12 08:52 .prettierignore

drwxr-xr-x 1 root root 4096 Oct 12 08:52 .turbo

drwxr-xr-x 3 root root 4096 Oct 12 08:54 dist

-rw-r--r-- 1 root root 449 Oct 12 08:52 drizzle.config.ts

drwxr-xr-x 6 root root 4096 Oct 12 08:52 node_modules

-rw-r--r-- 1 root root 1070 Oct 12 08:52 package.json

drwxr-xr-x 1 root root 4096 Oct 12 08:52 src

-rw-r--r-- 1 root root 77 Oct 12 08:52 tsconfig.json

total 16

-rw-r--r-- 1 root root 268 Oct 12 08:54 drizzle.config.d.ts

-rw-r--r-- 1 root root 159 Oct 12 08:54 drizzle.config.d.ts.map

-rw-r--r-- 1 root root 570 Oct 12 08:54 drizzle.config.js

drwxr-xr-x 4 root root 4096 Oct 12 08:54 src

total 108

-rw-r--r-- 1 root root 266 Oct 12 08:54 NotificationReason.d.ts

-rw-r--r-- 1 root root 274 Oct 12 08:54 NotificationReason.d.ts.map

-rw-r--r-- 1 root root 77 Oct 12 08:54 NotificationReason.js

-rw-r--r-- 1 root root 303 Oct 12 08:54 api.d.ts

-rw-r--r-- 1 root root 302 Oct 12 08:54 api.d.ts.map

-rw-r--r-- 1 root root 759 Oct 12 08:54 api.js

drwxr-xr-x 2 root root 4096 Oct 12 08:54 db
lists:build: 08:54:13 AM [build] Completed in 0.99s.

bot:build:

Tasks: 2 successful, 2 total

Cached: 0 cached, 2 total

Time: 6.621s

total 44

-rw-r--r-- 1 root root 47 Oct 12 08:52 .eslintrc.js

-rw-r--r-- 1 root root 2408 Oct 12 08:52 .gitignore

-rw-r--r-- 1 root root 436 Oct 12 08:52 .prettierignore

drwxr-xr-x 1 root root 4096 Oct 12 08:52 .turbo

drwxr-xr-x 3 root root 4096 Oct 12 08:54 dist

-rw-r--r-- 1 root root 449 Oct 12 08:52 drizzle.config.ts

drwxr-xr-x 6 root root 4096 Oct 12 08:52 node_modules

-rw-r--r-- 1 root root 1070 Oct 12 08:52 package.json

drwxr-xr-x 1 root root 4096 Oct 12 08:52 src

-rw-r--r-- 1 root root 77 Oct 12 08:52 tsconfig.json

total 16

-rw-r--r-- 1 root root 268 Oct 12 08:54 drizzle.config.d.ts

-rw-r--r-- 1 root root 159 Oct 12 08:54 drizzle.config.d.ts.map

-rw-r--r-- 1 root root 570 Oct 12 08:54 drizzle.config.js

drwxr-xr-x 4 root root 4096 Oct 12 08:54 src

total 108

-rw-r--r-- 1 root root 266 Oct 12 08:54 NotificationReason.d.ts

-rw-r--r-- 1 root root 274 Oct 12 08:54 NotificationReason.d.ts.map

-rw-r--r-- 1 root root 77 Oct 12 08:54 NotificationReason.js

-rw-r--r-- 1 root root 303 Oct 12 08:54 api.d.ts

-rw-r--r-- 1 root root 302 Oct 12 08:54 api.d.ts.map

-rw-r--r-- 1 root root 759 Oct 12 08:54 api.js

drwxr-xr-x 2 root root 4096 Oct 12 08:54 db
-rw-r--r-- 1 root root 469 Oct 12 08:54 env.d.ts

-rw-r--r-- 1 root root 143 Oct 12 08:54 env.d.ts.map

-rw-r--r-- 1 root root 985 Oct 12 08:54 env.js

-rw-r--r-- 1 root root 86 Oct 12 08:54 index.d.ts

-rw-r--r-- 1 root root 149 Oct 12 08:54 index.d.ts.map

-rw-r--r-- 1 root root 3937 Oct 12 08:54 index.js

-rw-r--r-- 1 root root 1147 Oct 12 08:54 lists.d.ts

-rw-r--r-- 1 root root 1154 Oct 12 08:54 lists.d.ts.map

-rw-r--r-- 1 root root 15012 Oct 12 08:54 lists.js

-rw-r--r-- 1 root root 316 Oct 12 08:54 logger.d.ts

-rw-r--r-- 1 root root 166 Oct 12 08:54 logger.d.ts.map

-rw-r--r-- 1 root root 629 Oct 12 08:54 logger.js

drwxr-xr-x 2 root root 4096 Oct 12 08:54 modules

-rw-r--r-- 1 root root 411 Oct 12 08:54 notifier.d.ts

-rw-r--r-- 1 root root 407 Oct 12 08:54 notifier.d.ts.map

-rw-r--r-- 1 root root 7999 Oct 12 08:54 notifier.js

> [email protected] start /app/apps/bot

> node ./dist/src/index.js

[2023-10-12T08:54:17Z] INFO (Index): Starting bot...
-rw-r--r-- 1 root root 469 Oct 12 08:54 env.d.ts

-rw-r--r-- 1 root root 143 Oct 12 08:54 env.d.ts.map

-rw-r--r-- 1 root root 985 Oct 12 08:54 env.js

-rw-r--r-- 1 root root 86 Oct 12 08:54 index.d.ts

-rw-r--r-- 1 root root 149 Oct 12 08:54 index.d.ts.map

-rw-r--r-- 1 root root 3937 Oct 12 08:54 index.js

-rw-r--r-- 1 root root 1147 Oct 12 08:54 lists.d.ts

-rw-r--r-- 1 root root 1154 Oct 12 08:54 lists.d.ts.map

-rw-r--r-- 1 root root 15012 Oct 12 08:54 lists.js

-rw-r--r-- 1 root root 316 Oct 12 08:54 logger.d.ts

-rw-r--r-- 1 root root 166 Oct 12 08:54 logger.d.ts.map

-rw-r--r-- 1 root root 629 Oct 12 08:54 logger.js

drwxr-xr-x 2 root root 4096 Oct 12 08:54 modules

-rw-r--r-- 1 root root 411 Oct 12 08:54 notifier.d.ts

-rw-r--r-- 1 root root 407 Oct 12 08:54 notifier.d.ts.map

-rw-r--r-- 1 root root 7999 Oct 12 08:54 notifier.js

> [email protected] start /app/apps/bot

> node ./dist/src/index.js

[2023-10-12T08:54:17Z] INFO (Index): Starting bot...
(last one is the dist folder output) this is why I imagine it just wasn't executing the build command, cause when I force it to, it does appear there
Brody
Brody•14mo ago
delete all local dist folder, cd into the root of your project and run the same build command as you have railway run, where is the dist folder placed?
gabe
gabeOP•14mo ago
heres me following the same steps locally, on the first ls theres no dist folder, and on the second one the dist folder is there, lastly the start command runs fine (the command failed at the end is just because I stopped it, but it gets executed)
No description
Brody
Brody•14mo ago
fancy term
gabe
gabeOP•14mo ago
thanks 😄
Brody
Brody•14mo ago
why does the build mention astro? isnt this a bot?
gabe
gabeOP•14mo ago
its a dependency for the bot, its actually another web app, but also contains some list files I import inside the bot, so turbo ends up also building it as well I could create another package just for the lists to avoid building it when building the bot, but im a bit lazy to do that ahahah
Brody
Brody•14mo ago
try putting stuff back to how it should be but use filter in place of cd
gabe
gabeOP•14mo ago
ohhh, actually, I think I found the issue 😅
Brody
Brody•14mo ago
do tell
gabe
gabeOP•14mo ago
it happens when turborepo uses the cache, and I forgot to put the dist folder into the turborepo outputs parameters, so it just replays the logs, but doesn't actually put the dist folder on its place
No description
gabe
gabeOP•14mo ago
it also makes sense why it happens on unrelated changes to another app, cause then it used the cache, and the dist folder was not there
Brody
Brody•14mo ago
interesting
gabe
gabeOP•14mo ago
if I add the correct configs, then it caches the folder correctly ahahah
Brody
Brody•14mo ago
i wasnt wrong lol
gabe
gabeOP•14mo ago
true ahahahah
Brody
Brody•14mo ago
still should use the filter flag
gabe
gabeOP•14mo ago
thank you for the help on debugging this, was quite an interesting ride 😄
Brody
Brody•14mo ago
please no more cd
gabe
gabeOP•14mo ago
yep, i'm doing that on the dockerfile btw, going back to the dockerfile pnpm caching thing, do you have any idea why it complains when I try caching the pnpm folder like nixpacks do? I'd honestly still prefer to continue on using dockerfile, as its a bit easier to debug things locally and I have more familiarity with it...
Brody
Brody•14mo ago
no clue but you can use nixpacks locally too
gabe
gabeOP•14mo ago
ahh, true, just saw on their docs... whats the benefits of using it vs for example, docker?
Brody
Brody•14mo ago
caching 🤣
gabe
gabeOP•14mo ago
makes sense 🤣 🤣 still confuses me why the same command works using nixpacks, but not on a docker image
Brody
Brody•14mo ago
you arent the first person to ask about that tbh
gabe
gabeOP•14mo ago
:/ the weird part is that locally using docker it works lol
Brody
Brody•14mo ago
let me see if i can get a dockerfile working with a cache id yes i can skill issue fr
gabe
gabeOP•14mo ago
oh, how did you fix it?
Brody
Brody•14mo ago
i just grabbed the dockerfile nixpacks generates and then copyed its cache stuff
Brody
Brody•14mo ago
Brody
Brody•14mo ago
its not a turbo app, but you get the idea
gabe
gabeOP•14mo ago
thats weird, looks the same as the one I have though
RUN --mount=type=cache,id=s/82d44405-b1db-4ad5-b469-c9a2b679f1d9-/root/cache/go-build,target=/root/.cache/go-build go mod download
RUN --mount=type=cache,id=s/82d44405-b1db-4ad5-b469-c9a2b679f1d9-/root/cache/go-build,target=/root/.cache/go-build go mod download
RUN --mount=type=cache,id=s/2d13c748-906b-4f06-bdbc-9a9cbdb84534-/root/local/share/pnpm/store/v3,target=/root/.local/share/pnpm/store/v3 pnpm install --frozen-lockfile
RUN --mount=type=cache,id=s/2d13c748-906b-4f06-bdbc-9a9cbdb84534-/root/local/share/pnpm/store/v3,target=/root/.local/share/pnpm/store/v3 pnpm install --frozen-lockfile
gabe
gabeOP•14mo ago
I copied mine from the nixpack build log that railway outputted
No description
Brody
Brody•14mo ago
if i type my id wrong i get the same error
No description
gabe
gabeOP•14mo ago
hmmm, is the ID supposed to be the project, or the service?
Brody
Brody•14mo ago
service id
gabe
gabeOP•14mo ago
should be the correct one then 🤔
No description
gabe
gabeOP•14mo ago
(its the same one i used on the dockerfile) also, I just copy and pasted the one nixpacks gave me, so it should behave the same I think
Brody
Brody•14mo ago
haha i dont know what to tell you, i can only get that error if i do something wrong with the id how long does the build take on railway using nixpacks, and then with your dockerfile (omiting any caching)
gabe
gabeOP•14mo ago
42.20 sec on nixpacks and 36.90 seconds on docker...
Brody
Brody•14mo ago
lmao problem solved but those numbers are from builds on railway right?
gabe
gabeOP•14mo ago
ahh, no wait, I was looking at the publish times, the last number reported on the logs, but its around 1m30s on nixpacks, and 2 min on docker
Brody
Brody•14mo ago
not bad filter the build further so it doesnt build the astro app too and you will be good to go
Want results from more Discord servers?
Add your server