Skip to content
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

Rancher registration URL domain replaces "http" with "ws" beyond first match #6957

Closed
nextrevision opened this issue Dec 6, 2016 · 2 comments
Assignees
Labels
area/agent Issues that deal with the Rancher Agent kind/bug Issues that are defects reported by users or that we know have reached a real release
Milestone

Comments

@nextrevision
Copy link

Rancher Version:
v1.2.0

Docker Version:
1.12.3

OS and where are the hosts located? (cloud, bare metal, etc):
Cloud (AWS)

Setup Details:
HA

Environment Type:
K8S

Steps to Reproduce:
Set Rancher server URL for host registration (under settings) to http://my-rancher-http-server.com and add a host (using either a docker-machine driver or custom command).

Results:
Upon launch of the agent, the agent appears to connect fine initially, but when attempting to connect over the websocket, it appears a string replacement is happening beyond the first match. For example, http://my-rancher-http-server.com turns into ws://my-rancher-ws-server.com.

Agent logs:

Found container ID: b5fe9cc1c3bc950c169108e2b88b5469cae6f5c804ccba7b0ac6b16126e3f007
Checking root: /host/run/runc
Checking file: 0903c32443ba593ad5ef597e5d2a2d4fbb9b2c335fc94801c852042784716e1d
Checking file: 120006ae9e14db5ffcee921782f1463abeaec37497e51c1e12285a12afbd505e
Checking file: 27e36982026b647159d0a5fafe5d857572697ae805df7c0e889caa2c0e8abf55
Checking file: 2ad778eb1bcebb39b4c8951ea2172772fe47b90e82310711ec45335a1e710d46
Checking file: 38c58bfe32c37f5e599261f31741870b60750740d52e70284b55d6b72682c734
Checking file: 3b9e1ab9cb48c40d4d171f1424166b5fee1cc1ce5965085fed5d6c32d3ff1573
Checking file: 9e605c157ac9dc1fd2bf8e673ef38a66a2f5ef7b5e35dc0c2bead1207a80d255
Checking file: b5fe9cc1c3bc950c169108e2b88b5469cae6f5c804ccba7b0ac6b16126e3f007
Found state.json: b5fe9cc1c3bc950c169108e2b88b5469cae6f5c804ccba7b0ac6b16126e3f007
time="2016-12-06T21:25:55Z" level=info msg="Execing [/usr/bin/nsenter --mount=/proc/1520/ns/mnt -F -- /var/lib/docker/overlay/6377a06ca053ad8edb9302ed32cbd596e7d221291f73160108dcebd3559cdc16/merged/usr/bin/share-mnt --stage2 /var/lib/rancher/volumes /var/lib/kubelet -- norun]"
Found container ID: b5fe9cc1c3bc950c169108e2b88b5469cae6f5c804ccba7b0ac6b16126e3f007
Checking root: /run/runc
Checking file: 0903c32443ba593ad5ef597e5d2a2d4fbb9b2c335fc94801c852042784716e1d
Checking file: 120006ae9e14db5ffcee921782f1463abeaec37497e51c1e12285a12afbd505e
Checking file: 27e36982026b647159d0a5fafe5d857572697ae805df7c0e889caa2c0e8abf55
Checking file: 2ad778eb1bcebb39b4c8951ea2172772fe47b90e82310711ec45335a1e710d46
Checking file: 38c58bfe32c37f5e599261f31741870b60750740d52e70284b55d6b72682c734
Checking file: 3b9e1ab9cb48c40d4d171f1424166b5fee1cc1ce5965085fed5d6c32d3ff1573
Checking file: 9e605c157ac9dc1fd2bf8e673ef38a66a2f5ef7b5e35dc0c2bead1207a80d255
Checking file: b5fe9cc1c3bc950c169108e2b88b5469cae6f5c804ccba7b0ac6b16126e3f007
Found state.json: b5fe9cc1c3bc950c169108e2b88b5469cae6f5c804ccba7b0ac6b16126e3f007
INFO: Starting agent for 235ADC13DB797D6CB6D5
INFO: Access Key: 235ADC13DB797D6CB6D5
INFO: Config URL: http://internal-rancher-ha-elb-http-int-1786148355.us-east-1.elb.amazonaws.com/v1
INFO: Storage URL: http://internal-rancher-ha-elb-http-int-1786148355.us-east-1.elb.amazonaws.com/v1
INFO: API URL: http://internal-rancher-ha-elb-http-int-1786148355.us-east-1.elb.amazonaws.com/v1
INFO: IP: 192.168.99.201
INFO: Port:
INFO: Required Image: rancher/agent:v1.1.0
INFO: Current Image: rancher/agent:v1.1.0
INFO: Using image rancher/agent:v1.1.0
INFO: Downloading agent http://internal-rancher-ha-elb-http-int-1786148355.us-east-1.elb.amazonaws.com/v1/configcontent/configscripts
INFO: Updating configscripts
INFO: Downloading http://internal-rancher-ha-elb-http-int-1786148355.us-east-1.elb.amazonaws.com/v1//configcontent//configscripts current=
INFO: Running /var/lib/cattle/download/configscripts/configscripts-1-f0f3fb2e1110b5ada7c441705981f93a480313a324294321cff467f0c3e12319/apply.sh
INFO: Sending configscripts applied 1-f0f3fb2e1110b5ada7c441705981f93a480313a324294321cff467f0c3e12319
INFO: Updating pyagent
INFO: Downloading http://internal-rancher-ha-elb-http-int-1786148355.us-east-1.elb.amazonaws.com/v1//configcontent//pyagent current=
INFO: Running /var/lib/cattle/download/pyagent/pyagent-1-9e3dcab12585149a65d818082279708965cd826df1937a55b24f48428f8f0c0644fc1033b5be15c88dcf9540b1c04c67/apply.sh
INFO: Updating host-api
INFO: Downloading http://internal-rancher-ha-elb-http-int-1786148355.us-east-1.elb.amazonaws.com/v1//configcontent//host-api current=
INFO: Running /var/lib/cattle/download/host-api/1-9608ead804f8cebbfe95b9f114701d8a5ac4244d603d196068043c902b1a0bdf/apply.sh
INFO: Sending host-api applied 1-9608ead804f8cebbfe95b9f114701d8a5ac4244d603d196068043c902b1a0bdf
INFO: Updating python-agent
INFO: Downloading http://internal-rancher-ha-elb-http-int-1786148355.us-east-1.elb.amazonaws.com/v1//configcontent//python-agent current=
INFO: Running /var/lib/cattle/download/python-agent/1-1ed5b002e1d3e9ac289af1d032dcdd3a98e2d291f14d66c90caca62c1477dcb8/apply.sh
INFO: Sending python-agent applied 1-1ed5b002e1d3e9ac289af1d032dcdd3a98e2d291f14d66c90caca62c1477dcb8
INFO: Sending pyagent applied 1-9e3dcab12585149a65d818082279708965cd826df1937a55b24f48428f8f0c0644fc1033b5be15c88dcf9540b1c04c67
INFO: Starting agent /var/lib/cattle/pyagent/apply.sh
INFO: Executing /var/lib/cattle/pyagent/agent
INFO: Updating host-config
INFO: Downloading http://internal-rancher-ha-elb-http-int-1786148355.us-east-1.elb.amazonaws.com/v1//configcontent//host-config current=
INFO: Running /var/lib/cattle/download/host-config/host-config-1-aa8a313026603a5be3dca9729810d6f8404da21a1855830ff4276f23de161092/apply.sh
INFO: HOME -> ./
INFO: HOME -> ./etc/
INFO: HOME -> ./etc/cattle/
INFO: HOME -> ./etc/cattle/api.crt
INFO: Sending host-config applied 1-aa8a313026603a5be3dca9729810d6f8404da21a1855830ff4276f23de161092
time="2016-12-06T21:25:56Z" level=info msg="Launching agent"
time="2016-12-06T21:25:56Z" level=info msg="Listening for events on http://internal-rancher-ha-elb-http-int-1786148355.us-east-1.elb.amazonaws.com/v1"
time="2016-12-06T21:25:56Z" level=info msg="launching hostapi"
time="2016-12-06T21:25:56Z" level="info" msg="Starting event router."
time="2016-12-06T21:25:56Z" level=info msg="Initializing event router" workerCount=50
time="2016-12-06T21:25:56Z" level=error msg="Error subscribing to events: dial tcp: lookup internal-rancher-ha-elb-ws-int-1786148355.us-east-1.elb.amazonaws.com on 169.254.169.253:53: no such host" subscribeUrl="ws://internal-rancher-ha-elb-ws-int-1786148355.us-east-1.elb.amazonaws.com/v1/subscribe?eventNames=compute.instance.deactivate&eventNames=compute.instance.force.stop&eventNames=compute.instance.inspect&eventNames=compute.instance.pull&eventNames=storage.volume.activate&eventNames=compute.instance.activate&eventNames=compute.instance.remove&eventNames=storage.image.activate&eventNames=storage.volume.remove&eventNames=ping&eventNames=config.update"
time="2016-12-06T21:25:56Z" level=fatal msg="Exiting. Error: dial tcp: lookup internal-rancher-ha-elb-ws-int-1786148355.us-east-1.elb.amazonaws.com on 169.254.169.253:53: no such host"

Expected:
Only the protocol to change from http:// to ws://.

@vincent99 vincent99 added kind/bug Issues that are defects reported by users or that we know have reached a real release area/agent Issues that deal with the Rancher Agent labels Dec 8, 2016
vincent99 added a commit to vincent99/event-subscriber that referenced this issue Dec 8, 2016
@vincent99 vincent99 added this to the Release 1.2.1 milestone Dec 8, 2016
@vincent99
Copy link
Contributor

Fixed in event-subscriber, but needs to be updated in agent.

ibuildthecloud added a commit to rancher/event-subscriber that referenced this issue Dec 9, 2016
cjellick pushed a commit to rancher/agent that referenced this issue Dec 10, 2016
@galal-hussein
Copy link
Contributor

Rancher version: v1.2.1-rc2

I tested adding hosts to a rancher server with domain name that contain http, and the host registered successfully.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/agent Issues that deal with the Rancher Agent kind/bug Issues that are defects reported by users or that we know have reached a real release
Projects
None yet
Development

No branches or pull requests

5 participants