Closed nelsonic closed 6 years ago
the way I "fixed" this was by "killing" nginx
with the command:
kill $(ps aux | grep '[n]ginx' | awk '{print $2}')
Not "pretty" but it worked.
Then I re-started nginx
by simply running the nginx
executable.
Turns out this only "works" once ... and does not "fix" anything.
The next time attempting to git push dokku master
the error will appear again.
The console shows this error but the app actually deployed successfully! https://hello-dokku.ademo.app
I'm a little "concerned" that the "error" is a "false negative". But closing.
This is still an issue and I want to fix it because I don't want any errors/warnings anywhere! "address the problems when they are small." See: https://en.wikipedia.org/wiki/Broken_windows_theory
next line of enquiry: https://github.com/npm/npm/issues/3867
combined with using a "preinstall"
script in package.json
see: https://docs.npmjs.com/misc/scripts
a much "cleaner" way of doing this is:
pkill nginx
Then we need to run:
systemctl start nginx
That way we avoid deployment failure.
I managed to avoid the error (error: failed to push some refs
)
by shutting down Nginx before deploying the new app and restarting nginx
https://github.com/nelsonic/hello-world-node-http-server/blob/5b6f2a29d8d4568cf7337a84ceecf666e50d353e/bin/deploy.sh#L35-L37
once the app has been successfully deployed:
https://github.com/nelsonic/hello-world-node-http-server/blob/5b6f2a29d8d4568cf7337a84ceecf666e50d353e/bin/deploy.sh#L51-L53
This is not an ideal way of "solving" the issue as it means nginx will be "offline" while the app is being deployed ... So if someone is using a different app/version on the same server, their session will be interrupted ... This is only an issue for "full-refresh" Apps. We intend to build "offline first" apps so I'm considering this "solved" (for now)