-
Notifications
You must be signed in to change notification settings - Fork 551
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error on merging github pull request #420
Comments
This response will be returned when the branch that Staticman is trying to delete has already been deleted. When merging in the comment, are you manually deleting the branch before Staticman can do it? |
Hi @hispanic, thanks for your response. On my merging of the pull request that staticman submitted, I can see staticman closing the pull request branch: Same The Github app logs that the The Github hook also logs the I'm not sure how anyone would be able to manually delete the branch after merge before staticman could do it automatically. One would have to be very fast? Even if this was the case which it's not, why would staticman crash every time? Thanks. |
Maybe you have two webhooks set up and it is the second one that is failing? Keep in mind that apps running on the Heroku free plan are put to sleep ("Stopping all processes with SIGTERM") and that they take a while (10-30 seconds) to wake-up whenever they receive a request. |
Hmm, I can only see a single Github webhook, I've also been watching it's logs. I do plan on setting up another one on a different static site repo in the not to distant future though. Will this be a problem? Thanks. |
I can see the Github app logs a single open and then close event. I think if there were multiple Github webhooks I'd be seeing multiple close events? |
If you definitely believe the webhook is the trigger for your issues, you could try manually submitting equivalent requests to your Staticman instance using Insomnia, Postman, etc. I have no quick solutions to offer you. Sorry. |
I had the same issue, it turns out I had a github option to automatically delete branches checked https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/configuring-pull-request-merges/managing-the-automatic-deletion-of-branches Unchecking it solved the problem. But regardless, I don't think staticman should crash just because it receives an error from github, especially on branch deletion which is not critical. As mentioned in the original bug, the dyno doesn't always get restarted automatically, and then all users get an error until you run "heroku restart" manually. |
@miwucs I am getting this same 422 error when either merging or closing a pull request. I checked the setting you mentioned and it was not checked. I am still getting the error. @binarymist were you able to fix this issue? I cannot find a lot of documentation around the 422 status error. |
I am now seeing 404 errors. I had one merge request work (not sure why?) and now I am seeing 404 status crashes when trying to merge or close a pull request. Not sure what to change. |
No fix. |
@binarymist sorry to hear that. Do you still use Staticman? Do you use a different configuration or just restart Heroku manually after every pull request merge or close? |
Staticman is still being used. I keep my eye on Heroku and manually restart when it falls over. |
@binarymist I might have fixed this. I blame the lack of instructions for implementing Staticman. If you are like me, I had to piece together instructions from a lot of different sources to get it to work (and some were using v2 versus v3 and GitHub application vs separate GitHub account, etc.). In the end, I noticed I had two webhooks running. One on the repo and one in my GitHub App. It seems what was happening is that when I merged or closed a pull request, one of the webhooks acted first, which is why my comments were still working (ie: able to be posted to my blog), but when the second webhook tried to delete the branch, it got an error since the branch/file were already deleted. This resulted in my Heroku Staticman app crashing. I removed the webhook from my repo (just keeping the one in the GitHub App) and now I am not seeing the errors. Hopefully this will work for you and others! |
@andsplat Thank you! I had the double hook as well. Have been racking my brain! |
Glad it was helpful! |
When I merge (every merge) a pull request generated by my staticman instance hosted on heroku, I receive the following error:
Sometimes the staticman instance is automatically restarted, if this is the case, subscribers will get notifications, if the staticman instnce isn't restarted subscribers won't get notifications. When the next comment is posted the user gets the following error:
and the logs say:
and the post of the comment fails. After this every request receives seems to fail
Then I have to restart dyno manually, then I get:
Now... I remember I had the next problem last time staticman was working, and it's still happening. When two comment posters subscribe to notifications, there on after on every merge of comment to the github repo, two notifications are sent to each subscribed user. This of course multiplies as the number of subscribed users goes up. Once we have four subscribers, each one of them receives 4 email messages that a new comment has been posted when I merge a comment pull request.
Any idea what's causing these issues?
The first one I haven't noticed befroe as I used to use the community provided staticman instance. Now that I'm using my own instance, I get to see the logs.
The second one is a long standing issue, #182
Am I perhaps missing a value or values from the api config?
All I have in Heroku is the following populated values (all detailed in the getting started guide):
GITHUB_APP_ID
GITHUB_PRIVATE_KEY
RSA_PRIVATE_KEY
My site configuration file (staticman.yml) is here.
There are no issues with my front-end, it's been good for years, examples:
Thanks.
The text was updated successfully, but these errors were encountered: