Search code examples
mongodbgithubherokumongodb-atlas

Heroku manual deploy keeps switching to Master


In Heroku, connected to Git. I want to deploy my Dev branch, and can select it.

When I manually deploy it does it's thing (deploys my website to Heroku). But my website has Master branch code. I go back to Heroku and it's on Master.

If I select Dev as the branch for either Manual or Automatic, then reload the page, it switches back to Master. Below is a screenshot of me setting the branch to dev. If I do a browser refresh, it resets to Master.

I tried reconnecting Github. Not sure what else it could be. Deploying Dev was working up until yesterday.

Here is a screenshot of how I manually deploy (as opposed to auto deploy) from the Heroku Deployment tab.

enter image description here

Edit: I should also add, I happily was on Dev, and could deploy Dev updates up until recently. I deployed Master by mistake, bat can't go back to Dev.


Solution

  • I ended up having a corrupt Collection / DB record. I was tipped on another forum that the symptoms I was seeing (Nighscout web app not displaying some data, not the Heroku deploy I was attempting to work around that issue) could be caused by that. So as a last resort I dropped the entire Mongo Collection and I can now deploy Master and Dev, and it sticks in Heroku.

    I don't know the significance since the data should be separate from the web app source code itself.

    The whole reason I wanted to try Dev was for a fix for parts of the app not working. After initialising the Mongo DB Collection, I can use Master, so Dev (and the fix it contained) is not needed.

    I know this isn't the exact root cause, but I'll leave this here in case someone comes across it and hasn't thought to look at the data.