R
Railway•7mo ago
Chioma

RAILWAY DEPLOYMENT ERROR: Docker Build Failed

HI! I had my react-native-web app deployed. I made a simple change, and then I redeployed, and I got an error... I am not too sure how to resolve. Can some assist please? Thanks so much!!
102 Replies
Percy
Percy•7mo ago
Project ID: 63585bd3-9ed8-4472-80d0-1bae5ad3c571
Chioma
Chioma•7mo ago
63585bd3-9ed8-4472-80d0-1bae5ad3c571
Brody
Brody•7mo ago
hello! build and or deploy logs please - https://bookmarklets.up.railway.app/log-downloader/ (this is a new version of the log downloader)
Chioma
Chioma•7mo ago
The main man! hi!
Brody
Brody•7mo ago
please use the new version of the bookmarklet
Chioma
Chioma•7mo ago
gotcha. one sec
Brody
Brody•7mo ago
thats strange, ive sen that error just recently, maybe try another deployment?
Chioma
Chioma•7mo ago
okay! trying it now failed again
Brody
Brody•7mo ago
build logs again please
Brody
Brody•7mo ago
looks like either github or google is having network troubles send me your nixpacks.toml file please
Chioma
Chioma•7mo ago
Chioma
Chioma•7mo ago
ah this would make sense. cause i have google0auth.
Brody
Brody•7mo ago
nope nothing to do with it, unless you mean to say your google auth is now failing lately?
Chioma
Chioma•7mo ago
nope it works locally!
Brody
Brody•7mo ago
try this nixpacks.toml file instead -
# https://nixpacks.com/docs/configuration/file

providers = ['node']

# set up some variables to minimize annoyance
[variables]
NPM_CONFIG_UPDATE_NOTIFIER = 'false' # the update notification is relatively useless in a production environment
NPM_CONFIG_FUND = 'false' # the fund notification is also pretty useless in a production environment

# install caddy
[phases.caddy]
nixpkgsArchive = '727db88c063586d2f912af26dc3ce19d6f31af05' # caddy v2.7.6 - https://github.com/NixOS/nixpkgs/commit/727db88c063586d2f912af26dc3ce19d6f31af05
dependsOn = ['setup'] # make sure this phase runs after the default 'setup' phase
nixPkgs = ['caddy'] # install caddy

# format the Caddyfile with fmt
[phases.fmt]
dependsOn = ['caddy'] # make sure this phase runs after the 'caddy' phase so that we know we have caddy downloaded
cmds = ['caddy fmt --overwrite Caddyfile'] # format the Caddyfile to fix any formatting inconsistencies

# copy caddy and build artifacts to a new image and start the caddy web server
[start]
cmd = 'caddy run --config Caddyfile --adapter caddyfile 2>&1' # start caddy using the Caddyfile config and caddyfile adapter
# https://nixpacks.com/docs/configuration/file

providers = ['node']

# set up some variables to minimize annoyance
[variables]
NPM_CONFIG_UPDATE_NOTIFIER = 'false' # the update notification is relatively useless in a production environment
NPM_CONFIG_FUND = 'false' # the fund notification is also pretty useless in a production environment

# install caddy
[phases.caddy]
nixpkgsArchive = '727db88c063586d2f912af26dc3ce19d6f31af05' # caddy v2.7.6 - https://github.com/NixOS/nixpkgs/commit/727db88c063586d2f912af26dc3ce19d6f31af05
dependsOn = ['setup'] # make sure this phase runs after the default 'setup' phase
nixPkgs = ['caddy'] # install caddy

# format the Caddyfile with fmt
[phases.fmt]
dependsOn = ['caddy'] # make sure this phase runs after the 'caddy' phase so that we know we have caddy downloaded
cmds = ['caddy fmt --overwrite Caddyfile'] # format the Caddyfile to fix any formatting inconsistencies

# copy caddy and build artifacts to a new image and start the caddy web server
[start]
cmd = 'caddy run --config Caddyfile --adapter caddyfile 2>&1' # start caddy using the Caddyfile config and caddyfile adapter
Chioma
Chioma•7mo ago
okay updating now okay it looked like it was about to start working but thenit crashed so i am restarting the deployment
Brody
Brody•7mo ago
logs please
Brody
Brody•7mo ago
ah possibly fixed, try again
Chioma
Chioma•7mo ago
i did. it crashed again
Brody
Brody•7mo ago
logs please
Chioma
Chioma•7mo ago
it's the same as the one i sent above
Brody
Brody•7mo ago
have you updated your nixpacks.toml file with the one above?
Chioma
Chioma•7mo ago
yup
Brody
Brody•7mo ago
okay I'll try some things this does work, please make sure you are using it
Chioma
Chioma•7mo ago
hey brody! i stepped away and came back and it wasn't crashed anymore it is up now when i click "Continue with Google" button that triggers my googleoauth, never happens though. As i mentioned earlier locally this works as expected. do you think this is related to deployment not working?
Chioma
Chioma•7mo ago
No description
Brody
Brody•7mo ago
nope that would be a code issue, check the browser console logs
Chioma
Chioma•7mo ago
hi brody!! i got another error:(
Chioma
Chioma•7mo ago
still learning how to debug from the logs but i think it's because i am trying to use some font awesome icons? I read the documentation about what is needed to use them from web: https://www.npmjs.com/package/react-native-vector-icons#web-setup
npm
react-native-vector-icons
Customizable Icons for React Native with support for NavBar/TabBar, image source and full styling.. Latest version: 10.0.3, last published: 4 months ago. Start using react-native-vector-icons in your project by running npm i react-native-vector-icons. There are 1731 other projects in the npm registry using react-native-vector-icons.
Chioma
Chioma•7mo ago
This is what I did for step 1:
No description
Chioma
Chioma•7mo ago
This is what I did for step 2:
No description
Brody
Brody•7mo ago
are you able to build this locally?
Chioma
Chioma•7mo ago
Hi Brody! I was able to figure out the font awesome icon issue. It is showing locally and deployed
Brody
Brody•7mo ago
awsome!
Chioma
Chioma•7mo ago
The other issue I am having on deployment is my hooks aren't working
Brody
Brody•7mo ago
hooks?
Chioma
Chioma•7mo ago
react hooks/api calls
Brody
Brody•7mo ago
do they work locally?
Chioma
Chioma•7mo ago
Yup yup
Brody
Brody•7mo ago
what errors do you get when deployed to railway?
Chioma
Chioma•7mo ago
Really strange actually let me get some pics for ya one sec so i used an api call to get the auth url. the url is triggered when the user clicks "Continue with Google". My console logs are showing the data on the side Locally:
Chioma
Chioma•7mo ago
No description
Chioma
Chioma•7mo ago
in deployment my console log returns the html document? haha no idea why
Chioma
Chioma•7mo ago
No description
Brody
Brody•7mo ago
can you send a link to this page so i can see the error for myself
Brody
Brody•7mo ago
well i cant even click the google button lol clicking does nothing, no console logs and no network activity
Chioma
Chioma•7mo ago
really!? interesting. let me redeploy..i think i may have found the issue (fingers crossed) yeah nvm didn't work haha so u cant see the console logs ?
Brody
Brody•7mo ago
yeah theres console logs, just nothing is logged when i click on the button
Brody
Brody•7mo ago
these are the logs when i load the page and dont click anything
No description
Chioma
Chioma•7mo ago
yes the last one is the reason why the button isn't doing anything it's not retrieving my url from the backend, so there's "nothing" to click on
Brody
Brody•7mo ago
i think i know whats going on i assume you are using an service variable to set the backend url?
Chioma
Chioma•7mo ago
yes!
Brody
Brody•7mo ago
are you sure its prefixed with https:// ?
Chioma
Chioma•7mo ago
no it's this
No description
Chioma
Chioma•7mo ago
i have it currently displaying on the app too
Chioma
Chioma•7mo ago
No description
Brody
Brody•7mo ago
its supposed to be a url value, therefor it needs to be prefixed with https:// i think we have went over this a few times before too 🙂
Chioma
Chioma•7mo ago
aw mann youre so right i even had that in my notes!
Chioma
Chioma•7mo ago
No description
Chioma
Chioma•7mo ago
i put it in bold now...ha i made the adjustment and redeployed. this is just a code issue now right? that i can go look for?
Chioma
Chioma•7mo ago
No description
Brody
Brody•7mo ago
now you are getting a cors error you may have something in your notes about that? we have talked a bit about that before too
Chioma
Chioma•7mo ago
yes i remember cors! i ahve it in my server, but i will keep debugging and see if i can get to the bottom of it
Chioma
Chioma•7mo ago
No description
Brody
Brody•7mo ago
are you sure you have that variable set correctly?
Chioma
Chioma•7mo ago
i think so! i used the railway domain cause i thought either or could work. do i need to use the new domain i got?
Chioma
Chioma•7mo ago
No description
Brody
Brody•7mo ago
but thats not your frontend's domain ideally you use https://${{<frontend service name>.RAILWAY_PUBLIC_DOMAIN}} so that you dont have to worry about manually updating the variable if you change the service domain thats in your notes too 😉
Chioma
Chioma•7mo ago
i know youre right i think because i recently got a domain/changed it i didn't think to update that... thanks brody!! all is working now
Brody
Brody•7mo ago
no problem!
Chioma
Chioma•7mo ago
unrelated - are you familar with assetlinks.json files?
Brody
Brody•7mo ago
never heard of it
Chioma
Chioma•7mo ago
cool. was just curious! thank youu
Brody
Brody•7mo ago
no problem!
Chioma
Chioma•7mo ago
Hi again! I may have celebrated too early... I tried actually clicking "Continue with Google" in deployment and it gives me an error adter it pulls up the google consent screen locally it says this and after i continue it goes to my home screen:
Chioma
Chioma•7mo ago
No description
Chioma
Chioma•7mo ago
in deployment it says this:
No description
Chioma
Chioma•7mo ago
then goes to this after:
No description
Brody
Brody•7mo ago
that means your backend did not respond to that request, check your deploy logs
Brody
Brody•7mo ago
ValidationError: userProfiles validation failed: confirmPassword: Please confirm submitted password.
ValidationError: userProfiles validation failed: confirmPassword: Please confirm submitted password.
and your backend fully crashes from this error
Chioma
Chioma•7mo ago
ah okay how did u find that so fast haha all i saw was this giberrish
Chioma
Chioma•7mo ago
No description
Brody
Brody•7mo ago
i scrolled to the bottom the latest log lines are at the bottom
Chioma
Chioma•7mo ago
gotcha good to know thanks brody that fixed it! any way to solve naming convention here? or i have to accept it as is?
Chioma
Chioma•7mo ago
No description
Brody
Brody•7mo ago
awsome, but i have no clue why it says railway.app, youd need to check the docs for your 0Auth lib that you use
Chioma
Chioma•7mo ago
haha we were on the same page. i actually didnt use a library. found a cool video where he shows u what everyhing is doing so i created the functions on my own following along
Brody
Brody•7mo ago
ah interesting approach, then youd need to check google's docs on how to set those names
Chioma
Chioma•7mo ago
sounds good will do that thanks again!! yeah the libraries seem to deappreciate and break people's apps from what i was reading
Brody
Brody•7mo ago
i think there are a few highly maintained 0auth libs
Chioma
Chioma•7mo ago
yes for sure but i was trying to find one for react native web and react native and that i understood and wasnt just copying and pasting so that limited me haha
Brody
Brody•7mo ago
ah gotcha
Chioma
Chioma•7mo ago
and if you were curious about this. looks like google does it this way until i verify the app through them to avoid pishing
Brody
Brody•7mo ago
ah that makes sense
Want results from more Discord servers?
Add your server