W
Wasp2mo ago
AC

Really struggling with deploy

Hi all - I've been building a Wasp app for the last two months while teaching myself coding. I'm almost done my app on local. I am really struggling with the deploy. I'm working off an M2 Silicon Chip Macbook Pro, and I've tried a ton of things. TL;DR, I'm trying Heroku, but even when trying the specific instructions for M2, it still didn't work. Tried downgrading Docker to a less current version, but I am unsure which version to downgrade to, and it seems that Docker also has version limitations with M2. I get the following error when I use the command: heroku container:push --app XXXXX web failed commit on ref "manifest-sha256:4ef768618e84c07096a616d01666cfa6f86a14305c94ea1172a120fafa52edf8": unexpected status from PUT request to https://registry.heroku.com/v2/XXXXX/web/manifests/latest: 405 Method Not Allowed I then tried this set of commands: docker buildx build --platform linux/amd64 -t XXXXX . docker tag <app-name> registry.heroku.com/XXXXX/web docker push registry.heroku.com/XXXXX/web I then got this error: failed commit on ref "manifest-sha256:c70a80797778e384a7eebbee9653cf38d9b823a26b92c47e43b518b9032d97cd": unexpected status from PUT request to https://registry.heroku.com/v2/XXXXX/web/manifests/latest: 405 Method Not Allowed Both attempts had this warning: 1 warning found (use docker --debug to expand): - LegacyKeyValueFormat: "ENV key=value" should be used instead of legacy "ENV key value" format (line 50) I tried circumventing these issues by using Colima, but that did not work either. I'm using Wasp version 0.15.0, and Docker Desktop 4.36.0, Docker Compose v2.30.3-desktop.1. P.S. I did try Fly.io already; It was working for a bit but they had some outages a few weeks ago which broke my config. I then did some further research and learned that fly.io is not super reliable sometimes. Any suggestions on how to handle this?
30 Replies
kapa.ai
kapa.ai2mo ago
Hi @AC. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave: ---------------------- I understand you're having difficulties deploying your Wasp app on an M2 Silicon Chip Macbook Pro. Let's go through the issues and potential solutions based on the information provided in the knowledge sources. 1. Heroku Deployment for Apple Silicon: The knowledge sources provide specific instructions for deploying to Heroku on Apple Silicon devices. According to Docs > Advanced > Deployment > Deploying Manually > Heroku (server and database) > Deploy to a Heroku App Part 1 (https://wasp-lang.dev/docs/advanced/deployment/manually#deploy-to-a-heroku-app), you should use the following commands instead of heroku container:push:
docker buildx build --platform linux/amd64 -t <app-name> .
docker tag <app-name> registry.heroku.com/<app-name>/web
docker push registry.heroku.com/<app-name>/web
docker buildx build --platform linux/amd64 -t <app-name> .
docker tag <app-name> registry.heroku.com/<app-name>/web
docker push registry.heroku.com/<app-name>/web
After these steps, you should run:
heroku container:release --app <app-name> web
heroku container:release --app <app-name> web
2. Authentication Issue: If you're getting an "unauthorized: authentication required" error when trying to push, try running heroku container:login first, as suggested in a GitHub issue comment (https://github.com/wasp-lang/wasp/issues/576). 3. Docker Version: The knowledge sources don't specify a particular Docker version for M2 Macs. However, they do mention that you need to build a non-Arm image, which is why the --platform linux/amd64 flag is used. 4. Wasp Version: You mentioned using Wasp version 0.15.0, which is more recent than the versions mentioned in the knowledge sources. This shouldn't be an issue, but if you continue to have problems, you might want to try using a slightly older version that's known to work with the deployment process. 5. Alternative Deployment Options: If you continue to have issues with Heroku, you might want to consider other deployment options. The Docs > Advanced > Deployment > Overview (https://wasp-lang.dev/docs/advanced/deployment/overview) page mentions that you can deploy Wasp apps to various providers. For example, you could try deploying your client on Netlify, the server on Fly.io, and the database on Neon. 6. Wasp CLI Deployment: Another option to consider is using the Wasp CLI for deployment. According to the Docs > Advanced > Deployment > Deploying with the Wasp CLI (https://wasp-lang.dev/docs/advanced/deployment/cli) page, Wasp supports automated deployment to Fly.io with a single command. Although you mentioned having issues with Fly.io before, it might be worth trying again with the Wasp CLI approach, as it automates much of the process. If you continue to face issues, it might be helpful to share more detailed error logs or reach out to the Wasp community on their Discord channel for more specific assistance. The deployment process can be complex, especially when dealing with different architectures like Apple Silicon, so don't get discouraged! ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ---------------------- Sorry @AC, I seem to be having a bit of trouble. Don't worry though, I've pinged my support and they will try to fix me up! :technologist: Perhaps try again in 15mins?
G35x
G35x2mo ago
Hey @AC, I work from a mac M1 pro and had a bunch of unexpected issues deploying. My stack is - firebase front end - Google cloud run server - Google postrgresql DB Took me two weeks to successfully deploy. I nearly gave up. Hang in there. regarding the error: LegacyKeyValueFormat: "ENV key=value" should be used instead of legacy "ENV key value" format (line 50) I'm not certain this will be a non-issue for heroku, but this was a total non-issue for me at any point in my build or deploy. I get that warning every time I docker build and it hasn't caused any issues. You're definitely headed in the right direction using: docker buildx build --platform linux/amd64 -t <app-name> . docker tag <app-name> registry.heroku.com/<app-name>/web docker push registry.heroku.com/<app-name>/web Do you get any other errors during the docker build stage? Are you able to share the complete sequence of commands you're using & what directory you're in when running those commands during the build & push?
miho
miho2mo ago
Did you login with heroku container:login? I have to admit I haven't deployed with Heroku in some time, so maybe our docs might be a bit out of date
BeReal
BeReal2mo ago
I found deploying with fly relatively easy, maybe you could try that? Is there a reason you do not want to use fly?
AC
ACOP4w ago
Hey @G35x - Just coming out of the holiday food coma. Thanks for sharing that this took you 2 weeks to solve...I've easily spent more than a week on it, on and off as I've built out the rest of my app, and now that I'm almost done the other functionality, this is my last major hurdle. So, I tried deploying again - Here are my detailed notes: Step #1: PASS - Deploying the app with heroku create <app-name> works as expected Step #2: PASS with adjustments - As long as I adjust the plan to a currently existing one, the DB also deploys with this command: heroku addons:create --app <app-name> heroku-postgresql:mini Step #3: PASS - Used these commands and they worked as expected: heroku config:set --app <app-name> JWT_SECRET=<random_string_at_least_32_characters_long> heroku config:set --app <app-name> WASP_WEB_CLIENT_URL=<url_of_where_client_will_be_deployed> heroku config:set --app <app-name> WASP_SERVER_URL=<url_of_where_server_will_be_deployed> Step #4: PASS: App builds fine, and I can position myself at .wasp/build with no issue. Step #5: FAIL: I can't get logged in with Docker. heroku container:login ( @miho this answers your question). I get: Error saving credentials: error storing credentials - err: exit status 1, out: `error getting credentials - err: exec: "docker-credential-osxkeychain": executable file not found in $PATH, out: ``` › Error: Login failed with: 1. I then tried to login to Docker using sudo docker-compose up --build I am able to verify my login but get this message: 2025/01/01 17:29:40 must use ASL logging (which requires CGO) if running as root 2025/01/01 17:29:40 must use ASL logging (which requires CGO) if running as root I then tried to set up rootless Docker login, but then I found out that Docker Desktop Doesn't Offer Rootless Mode on macOS because it runs in a controlled environment that doesn't require additional rootless mode setup. So now I'm stuck and not sure what to do... @BeReal - As I mentioned, I was able to deploy on fly.io, and I did that 2x over the last 12 weeks. Both times, it worked, and then there was a disruption in service, and I was back at square 1. I'm in Canada, so maybe fly.io doesn't work as well here? I also did some research and it looks like they are aware of some issues with dependability.
MEE6
MEE64w ago
Wohooo @AC, you just became a Waspeteer level 1!
AC
ACOP4w ago
Also, just as additional notes - I tried a bunch of other things, but none worked: I tried deploying without Docker, but while I was making some headway, this seemed like a bad idea because I do want the freedom to deploy elsewhere in future. I also tried every possible variation I could think of to get Docker working for this app. I have used my Docker setup to deploy a variety of other setups succesfully (Superset, n8n, etc.) and also successfully used Github Actions with Docker as well. So, my Docker Desktop has worked in other use cases.
G35x
G35x4w ago
Going back to the attempt prior to using sudo, Have you tried to verify the contents of your ~/.docker/config.json are correctly configured? Seeing that you’re running into more environment issues using Sudo makes me think an easier path would be to make the “docker-compose up —build” command work without requiring Sudo. A quick google search of the error code you got took me to a few different stack overflow threads. I didn’t see anything about using Sudo to resolve the “executable file not found at $PATH” I did see a lot of people mentioning steps to fix the configuration at ~/.docker/config.json specifically: “Check your ~/.docker/config.json and replace "credsStore" by "credStore" And “My config stopped working after I've installed Docker Desktop which apparently added "credsStore": "desktop" to my ~/.docker/config.json. Removing "credsStore": "desktop" fixed the issue as mentioned by various comments above” What I’m thinking might have happened is while you were testing different environment configurations to diagnose earlier sequential issues in your build / deploy stages, you could have done something to change your config.json and that’s why this new issue is occurring in the final stage
AC
ACOP4w ago
I did see those threads, I'll look at my config.json file and get back to you tomorrow with updates. And yes, I think you're right - I was originally able to get further in this process (was able to login into heroku containers), but am now unable to. I just didn't want to whinge about that since I couldn't recreate my steps there, haha. Thanks so much - will get back to you stat.
G35x
G35x4w ago
No problem! Looking forward to seeing what works to fix this. One more tip that helped me, if you aren’t already doing so, try to make as detailed as possible notes documenting all of your configurations, commands, strings etc used in your notes app while troubleshooting. The first week I was trying to deploy I was relying on my memory. I made way faster progress once I saved my “intellectual property” so I could wipe my environment, try new setups, and systematically test / compare which steps work, why, and how
AC
ACOP4w ago
Will do! Yes, I should have kept notes as I went along...It hasn't been necessary up to this point, but I can see it being super valuable here.
miho
miho4w ago
Hey @AC this sounds like there is some Docker specific issues on your Mac 😦 I'll try deploying an example app to Heroku now and see where I get stuck and if I can give you something useful as a result.
miho
miho4w ago
First of all, I'm using https://orbstack.dev on my MacOS on a MacBook with M2 instead of Docker Desktop, try using that and I think it will just work. It's a drop in replacement 🙂 Create your Heroku app and add PostgreSQL:
heroku create miho-heroku-test
heroku addons:create --app miho-heroku-test heroku-postgresql:essential-0
heroku create miho-heroku-test
heroku addons:create --app miho-heroku-test heroku-postgresql:essential-0
Configure your environment variables:
heroku config:set --app miho-heroku-test JWT_SECRET=something
heroku config:set --app miho-heroku-test WASP_WEB_CLIENT_URL=https://something.com
heroku config:set --app miho-heroku-test WASP_SERVER_URL=https://something.com
heroku config:set --app miho-heroku-test JWT_SECRET=something
heroku config:set --app miho-heroku-test WASP_WEB_CLIENT_URL=https://something.com
heroku config:set --app miho-heroku-test WASP_SERVER_URL=https://something.com
Build and prepare for deployment:
wasp build
cd .wasp/build
wasp build
cd .wasp/build
Deploy to Heroku using containers:
heroku container:login
heroku stack:set container -a miho-heroku-test
heroku container:push --app miho-heroku-test web
heroku container:release -a miho-heroku-test web
heroku container:login
heroku stack:set container -a miho-heroku-test
heroku container:push --app miho-heroku-test web
heroku container:release -a miho-heroku-test web
The one extra thing I had to do was: heroku stack:set container to let Heroku know I want to use Docker.
OrbStack
OrbStack · Fast, light, simple Docker & Linux
Say goodbye to slow, clunky containers and VMs. The fast, light, and easy way to run containers and Linux. Develop at lightspeed with our Docker Desktop alternative.
No description
AC
ACOP4w ago
Amazing! Going to try this right now, thank you @miho !
AC
ACOP4w ago
Okay, I tried this, and I'm getting much further than I was previously. I debugged a few things (Had to reinstall Node because of M1/M2 issues related to prisma and update a Docker helper...can provide full notes once everything is debugged). I am now able to login to Heroku via CLI, and deploy to Heroku containers. My app still isn't up though. Logs are attached. These look like error messages related to environment variables. Do I just need to set the environment variables in Heroku?
AC
ACOP4w ago
Ignore this - I'm adding the .env variables and will report back if that doesn't work.
MEE6
MEE64w ago
Wohooo @AC, you just became a Waspeteer level 2!
AC
ACOP4w ago
Okay, I've gotten to the point where the Heroku logs are saying that the app is running, but when I go to my URL (I've set up the custom domain with SSL), I get the back end server ("Hello world") instead of my frontend. Tried every possible combination of heroku config:set --app sredwise WASP_WEB_CLIENT_URL="XXXX" heroku config:set --app sredwise WASP_SERVER_URL="YYYY" But it's not working. Do I need to create any custom Build files to get around this?
miho
miho4w ago
You are deploying the backend to Heroku 😊 the client is a separate app. Good job on deploying the server!
miho
miho4w ago
Deploying Manually | Wasp
This document explains how to build and prepare your Wasp app for deployment.
AC
ACOP4w ago
omg, haha. Thanks!
AC
ACOP4w ago
Okay - It's up! Using OrbStack worked perfectly, thanks so much! My only notes are as follows: I got the following error message related to Prisma: => ERROR [server-builder 10/11] RUN cd .wasp/build/server && npx prisma generate --schema='../db/schema.prisma' 3.5s The fix is here: https://github.com/prisma/prisma/issues/17869 TL;DR - Ensure that when you run node -e 'console.log(process.arch)' in terminal, the result is Arm64 I also got this error: docker-credential-osxkeychain": executable file not found (17.09.0 mac33). I updated setup with an updated helper. I am having (what I think is) a minor issue with Netlify's frontend, but other than that, things are working. Thanks @miho and @G35x !!
GitHub
Intermittent failures of CLI commands for large schemas (M2 Mac - 4...
Bug description When running prisma CLI commands via an npm script, I receive intermittent fatal errors: > prisma migrate deploy assertion failed [block != nullptr]: BasicBlock requested for unr...
miho
miho4w ago
Sweet, I'm glad it worked out for you! 🙂 As a result, we'll update the Heroku deployment docs to mention OrbStack as one of the possible solutions. Thank you for the patience to figure this out!
AC
ACOP4w ago
No problem - Thank you so much for the help! Saved me days of work, I'm sure. Oh, and just in case - the specific helper I used to resolve the osxkeychain issue was brew install docker-credential-helper
G35x
G35x4w ago
Nice!! Congrats on the successful deployment
Filip
Filip4w ago
@martinsos You'll probably want to read this. Looks like our deployment story is less than stellar if our users are almost giving up after spending weeks (on and off) trying to deploy 😅
AC
ACOP3w ago
For what it's worth (with @miho 's suggestion of using OrbStack), I think this might be more of a documentation issue? Now that I know how to do this, it's taking me under 5 minutes to deploy my app on Netlify/Heroku. Once I'm done my initial product deployment, I'll set up a Github Action to automate the whole process. (Also not trying to be coy, happy to share my doc and eventual Github Action if that helps)
Filip
Filip3w ago
Yeah, definitely. We'd love that!
G35x
G35x3w ago
Adding my 2 cents here.. I really prefer using GCP for my projects. Not the cheapest/easiest but it has advantages & it’s what I’m used to. Would love to see more love for GCP users. There is some documentation that TomD created for this, I can tell he’s experienced and am super appreciative of his contribution. Speaking candidly, experienced people sometimes aren’t the BEST teachers. One common pitfall, they can assume the audience has implicit information / contextual understandings which they might not. In other words, and with all due respect, there are some under documented steps, and some info missing. It could use a facelift! Was thinking to create a more detailed guide on deploying a wasp project from scratch using 100% google infrastructure but don’t want to step on any toes or take away from Tom’s contribution. Also not sure how in-demand support is for this ecosystem and it would take a few hours to put together.
miho
miho3w ago
We encourage everyone to document their learnings and share them 🙂 the more the merrier, since we aren't experts at all deployment options. If multiple people share what worked for them - that's just more info for us. Feel free to create a https://gist.github.com/ and we'll try it out and maybe we can use it as base for our official guide 🙂
Gist
Discover gists
GitHub Gist: instantly share code, notes, and snippets.

Did you find this page helpful?