-
Notifications
You must be signed in to change notification settings - Fork 970
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
NPE in Agent Launcher #2789
Comments
The stacktrace seems to indicate that the agent is running on an older version of GoCD. Please ensure that the agent is running with the same version of the go server. If the problem persists, or if you see an issue with the server being unable to connect to the server, make sure to remove the I'm marking this issue as closed, but if you continue to see this problem, please specify the version of the gocd agent |
Thanks for your quick response! I'll reinstall the agent. |
Oh BTW the agent version is 16.10.0-4131 |
There are a few edge cases, that we've been unable to reproduce that have caused a similar stacktrace. If you could send across all logs under Please also keep backup the logs under When sending the email — please add a note to have the logs forward the logs to me (Ketan). Thanks! |
Thanks for your help 👍 |
Or perhaps the stacktrace leads me to believe that somehow the agent process is still loading up the old Could you quickly checksum the |
Yes, it has the correct checksum.. I'll collect the logs |
…agent during an upgrade - gocd#2789
…t when bootstrapper is starting up - gocd#2789
…agent during an upgrade - gocd#2789
…t when bootstrapper is starting up - gocd#2789
…agent during an upgrade - gocd#2789
…t when bootstrapper is starting up - gocd#2789
…agent during an upgrade - gocd#2789
…t when bootstrapper is starting up - gocd#2789
…ies_on_agents_upon_upgrade #2789 cleaning up agent binaries from previous version upon upgrade
The scenario is: both server and agent are on some old build say 16.1. Now you upgrade both agent and server to 16.7 or later build. At this point, when the bootstrapper comes up, it tries running the launcher using the locally available launcher jar(stale copy from 16.1). This launcher expected port number and hostname to be made available, but the new bootstrapper does not pass it along. The installer should have cleared off the older launcher and agent jars. Fix has been checkedin as part of 16.12(upcoming release), and workaround is what @ketan suggested, ie. delete local agent-launcher.jar and restart agent-bootstrapper. |
Thanks a lot @jyotisingh 👍 |
@jyotisingh Can a recent agent launcher operate with an older Go-Server? |
@lenucksi While upgrading, either you upgrade just your server or you upgrade your server as well as the agents. Newer agents with older server would not work and was never supported. Older agents with a new version of Server should work as expected. |
Also, this might be relevant. |
@jyotisingh Was this issue not due to the older agent having an incompatible agent-launcher.jar? Would then using an older agent with a server newer than 16.7 not cause the exact mentioned issues? Or does 16.12 introduce some compatibility features to upgrade older agents? |
@lenucksi Well, the issue occurred because of a mix of a few things, let me try and explain. In general an agent-bootstrapper is capable of upgrading an agent-launcher which in turn would upgrade and start an agent. So, normally you would just upgrade your server and let agent-bootstrapper take care of upgrading your agents automatically. Or one may choose to upgrade both server and agents by themselves. Until version 16.6, bootstrapper expected some specific arguments to be passed along to it ie. server-host-name and server-port, but as a part of 16.7, the bootstrapper was updated to accept a different set of arguments, one being the serverUrl ie. ssl url (instead of accepting the hostname and port-number as separate args), along with a bunch of other arguments for certificate verification. @arvindsv's comment here provides a little more details about this. The same set of arguments are passed along to the launcher which would then be used to upgrade an agent. Coming to the issue, it was a case of new bootstrapper running with an old version of launcher which shouldn't ever be the case. Upgrade process should have cleared out the older launcher, but it did not [bug]. As mentioned earlier, older launcher expected the hostname and ports to be provided, but the new bootstrapper passed along the serverUrl instead and hence this code from older launcher would throw an exception. The fix was to cleanup older launcher during the upgrade process. So, in terms of who does the fix apply to -
I hope it makes things clear now. |
@jyotisingh: I am so tempted to say, "Not really". :P |
Then I would say, @arvindsv is amazing at explaining things and hand it over to him :) |
Verified on GoCD version 16.12.0 (4331-7cd56f28bf55417221a608140e72532de5501f5a), working as expected |
@arvindsv @jyotisingh The explanation actually was pretty good and helpful, I just did not come to post a reaction to it. |
Issue Type
Summary
Agent cannot start due to NullPointerException
Environment
Basic environment details
Standard configuration (no special changes) with single agent running.
Steps to Reproduce
Expected Results
Agent should start. Build should work.
Actual Results
NullPointerException occurs in Agent Launcher
Log snippets
Any other info
I was not aware that Go.CD auto-upgrades when doing apt-get on Ubuntu. I had a working installation before the upgrade :(
Also it seems I'll have to upgrade plugins individually by downloading jar-files (did that for gradle plugin)
The text was updated successfully, but these errors were encountered: