I have tried to trigger a new build for three days, but nothing happens. The status page shows everything green. What’s the problem?
We struggle with this all the time, so you’re not alone. In short, the SnapCraft cloud build is connected to your GitHub repository and uses GitHub Webhooks to trigger automated builds. We noticed then that two things need to be true: the GitHub repo with your files needs to be public, and the OAuth API keys that connect SnapCraft to GitHub need to be valid. For me, they seem to auto-expire every 6-8 hours approx or when SnapCraft is rebooting servers (aka. maint). Here is what I do to get things working again.
On the SnapCraft website, press the “LOGOUT” button. You must fully log out, not just close the browser. Logging out will expire your user session key. Then log back into Snapcraft and go back to your published app and navigate to the “BUILDS” button. You should see after logging out officially from SnapCraft that it’s requiring you to press the GitHub “Log In” button again. Press it, and it will remember your connected GitHub repo and reauthenticate a new OAuth session key.
Now, it should display your builds and allow you to press the “TRIGGER NEW BUILD” button. Try to trigger a new build and wait 4-5 minutes for it to queue the command, spin up a new snapcraft VM instance, fetch your GitHub files, and start the build process. This webpage updates slowly in the background, so you might not see a new build happening instantly. Give it some time.
If more than ten minutes pass, then something else has gone wrong, and there are no error logs to find out why. When this happens to me (it does allot), then fully disconnect your GitHub Repo “Disconnect Repo” link on this page. It will display a warning that your build info will be lost, but don’t worry… all your builds are still there in the releases. IT just clears the gitHub log of when your builds ran on this tab is all. Log fully out of SnapCraft using the logout button. Then you can log back into SnapCraft and reconnect the repro and try the build again.
Also, don’t forget that each time you connect a repo, it creates webhooks on your GitHub repo. So if you don’t want SnapCraft building a new build every time you commit and push, just disable your GitHub webhook and re-enable it when you want that feature again.
I hope this helps anyone who experiences snapcraft build issues. Thanks, all!
Thank You! I tried it all. And only disconnecting and reconnecting the repo helped.