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?
4 Replies
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
:
After these steps, you should run:
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?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?
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 dateI found deploying with fly relatively easy, maybe you could try that? Is there a reason you do not want to use fly?