Skip to content

systemd service runs to early #227

Open
@ronaldfenner

Description

@ronaldfenner

It looks like the systemd service file is running to early such that the CommandPoller process is unable to start. If I log in and restart the service it then starts to work normally. Rebooting the instance, it then stops working and has to be restarted.

Log I'm seeing before it's restarted
2019-10-21 20:54:03 INFO [codedeploy-agent(3866)]: On Premises config file does not exist or not readable 2019-10-21 20:54:03 ERROR [codedeploy-agent(3866)]: booting child: error during start or run: Aws::Errors::MissingRegionError - missing region; use :reg$ /opt/codedeploy-agent/vendor/gems/aws-sdk-core-2.10.104/lib/seahorse/client/base.rb:84:in block in after_initialize'
/opt/codedeploy-agent/vendor/gems/aws-sdk-core-2.10.104/lib/seahorse/client/base.rb:83:in each' /opt/codedeploy-agent/vendor/gems/aws-sdk-core-2.10.104/lib/seahorse/client/base.rb:83:in after_initialize'
/opt/codedeploy-agent/vendor/gems/aws-sdk-core-2.10.104/lib/seahorse/client/base.rb:21:in initialize' /opt/codedeploy-agent/vendor/gems/aws-sdk-core-2.10.104/lib/seahorse/client/base.rb:105:in new'
/opt/codedeploy-agent/lib/instance_agent/plugins/codedeploy/codedeploy_control.rb:41:in get_client' /opt/codedeploy-agent/lib/instance_agent/plugins/codedeploy/command_poller.rb:45:in initialize'
/opt/codedeploy-agent/lib/instance_agent/agent/base.rb:10:in new' /opt/codedeploy-agent/lib/instance_agent/agent/base.rb:10:in runner'
/opt/codedeploy-agent/lib/instance_agent/runner/child.rb:32:in block in prepare_run' /opt/codedeploy-agent/lib/instance_agent/runner/child.rb:78:in with_error_handling'
/opt/codedeploy-agent/lib/instance_agent/runner/child.rb:31:in prepare_run' /opt/codedeploy-agent/vendor/gems/process_manager-0.0.13/lib/process_manager/child.rb:64:in block in prepare_run_with_error_handling'
/opt/codedeploy-agent/lib/instance_agent/runner/child.rb:78:in with_error_handling' /opt/codedeploy-agent/vendor/gems/process_manager-0.0.13/lib/process_manager/child.rb:63:in prepare_run_with_error_handling'
/opt/codedeploy-agent/vendor/gems/process_manager-0.0.13/lib/process_manager/child.rb:20:in start' /opt/codedeploy-agent/vendor/gems/process_manager-0.0.13/lib/process_manager/master.rb:206:in block in spawn_child'
/opt/codedeploy-agent/vendor/gems/process_manager-0.0.13/lib/process_manager/master.rb:204:in fork' /opt/codedeploy-agent/vendor/gems/process_manager-0.0.13/lib/process_manager/master.rb:204:in spawn_child'
/opt/codedeploy-agent/vendor/gems/process_manager-0.0.13/lib/process_manager/master.rb:196:in block in spawn_children' /opt/codedeploy-agent/vendor/gems/process_manager-0.0.13/lib/process_manager/master.rb:195:in times'
/opt/codedeploy-agent/vendor/gems/process_manager-0.0.13/lib/process_manager/master.rb:195:in spawn_children' /opt/codedeploy-agent/vendor/gems/process_manager-0.0.13/lib/process_manager/master.rb:134:in start'
/opt/codedeploy-agent/vendor/gems/process_manager-0.0.13/lib/process_manager/master.rb:37:in block in start' /opt/codedeploy-agent/vendor/gems/process_manager-0.0.13/lib/process_manager/master.rb:36:in fork'
/opt/codedeploy-agent/vendor/gems/process_manager-0.0.13/lib/process_manager/master.rb:36:in start' /opt/codedeploy-agent/bin/../lib/codedeploy-agent.rb:43:in block (2 levels) in

'
/opt/codedeploy-agent/vendor/gems/gli-2.11.0/lib/gli/command_support.rb:126:in call' /opt/codedeploy-agent/vendor/gems/gli-2.11.0/lib/gli/command_support.rb:126:in execute'
/opt/codedeploy-agent/vendor/gems/gli-2.11.0/lib/gli/app_support.rb:284:in block in call_command' /opt/codedeploy-agent/vendor/gems/gli-2.11.0/lib/gli/app_support.rb:297:in call'
/opt/codedeploy-agent/vendor/gems/gli-2.11.0/lib/gli/app_support.rb:297:in call_command' /opt/codedeploy-agent/vendor/gems/gli-2.11.0/lib/gli/app_support.rb:79:in run'
/opt/codedeploy-agent/bin/../lib/codedeploy-agent.rb:90:in <main>' 2

If i add these lines to the service file to have it wait till the network is online then it starts properly.
Requires=network-online.target After=network-online.target

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions