R
Railwayβ€’2mo ago
janie

Github Package Access Error

My build step fails during the npm install. The server is unable to get access to my private Github repository's package. I have set a .npmrc file at the root level of my project that should access the environment variable (that I have put into the Railway variables) that holds my Github PAT that should give the server access to the package. Instead, it fails saying that it doesn't have read:packages permission. My deploymentId is cf40b30e-6ae8-4008-8bd7-297e77d8bbb9.
20 Replies
Percy
Percyβ€’2mo ago
Project ID: cf40b30e-6ae8-4008-8bd7-297e77d8bbb9
Brody
Brodyβ€’2mo ago
nixpacks does not support pulling private packages, you would need to write a Dockerfile to solve this issue.
janie
janieβ€’2mo ago
Got it, thanks
Brody
Brodyβ€’2mo ago
no prob
janie
janieβ€’2mo ago
Actually - still seeing the same issue even though I have since migrated to using Dockerfiles for deployment. The token is definitely the correct token - is there any reason why this still would have a permission error? Deployment Id: 95f94276-0229-4131-8169-05c486642495
Brody
Brodyβ€’2mo ago
Can you send the Dockerfile?
janie
janieβ€’2mo ago
Brody
Brodyβ€’2mo ago
is GITHUB_READ_PACKAGES the only variable you need to auth to github?
janie
janieβ€’2mo ago
Yes, believe so //npm.pkg.github.com/:_authToken=${GITHUB_READ_PACKAGES} registry=https://npm.pkg.github.com/reviva-main -> all I have in the .npmrc file
Brody
Brodyβ€’2mo ago
whats the current error you get?
janie
janieβ€’2mo ago
npm ERR! code E403 31.21 npm ERR! 403 403 Forbidden - GET https://npm.pkg.github.com/@reviva-main/reviva-common - Permission permission_denied: read_package 31.21 npm ERR! 403 In most cases, you or one of your dependencies are requesting 31.21 npm ERR! 403 a package version that is forbidden by your security policy, or 31.21 npm ERR! 403 on a server you do not have access to. 31.21 31.21 npm ERR! A complete log of this run can be found in: /root/.npm/_logs/2024-04-23T22_23_59_162Z-debug-0.log
Brody
Brodyβ€’2mo ago
seems like simply setting a GITHUB_READ_PACKAGES is not all you need to do and there are more steps needed that you are leaving out
janie
janieβ€’2mo ago
hm - so it works fine locally with the same token. Is there a resource that you're looking at that suggests otherwise?
Brody
Brodyβ€’2mo ago
no resources, I've never done this before, but on account of it not working means something wasn't done right πŸ˜†
janie
janieβ€’2mo ago
right.. is there a way to get access to the complete log? There may be a trace id that I could send to the Github support team
Brody
Brodyβ€’2mo ago
the only accessible logs are what you see in the build and deploy logs I'm positive you aren't the first to try to write a Dockerfile that uses packages from a private repo so there has to be examples you can look at
janie
janieβ€’2mo ago
hm unfortunately can't find any logs - I may just move off 😦
Brody
Brodyβ€’2mo ago
you sent me logs a few messages ago?
janie
janieβ€’2mo ago
Right, the complete log
Brody
Brodyβ€’2mo ago
ah that, no there's no way to access that