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

Failed to find instance to delegate to for agent #7133

Closed
nextrevision opened this issue Dec 19, 2016 · 17 comments
Closed

Failed to find instance to delegate to for agent #7133

nextrevision opened this issue Dec 19, 2016 · 17 comments

Comments

@nextrevision
Copy link

nextrevision commented Dec 19, 2016

Rancher Version:
v1.2.1

Docker Version:
1.11.3

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

Setup Details: (single node rancher vs. HA rancher, internal DB vs. external DB)
Rancher HA w/ external DB

Environment Type: (Cattle/Kubernetes/Swarm/Mesos)
Cattle

Steps to Reproduce:
Upgraded from v1.1.4 to v1.2.1 and now the Rancher server is logging this error regularly. Possibly an orphaned agent?

Results:

2016-12-19 19:54:47,172 ERROR [:] [] [] [] [ecutorService-1] [i.c.p.agent.impl.AgentLocatorImpl   ] Failed to find instance to delegate to for agent [486] uri [delegate:///?vnetId=49&networkServiceProviderId=12]
2016-12-19 19:54:49,928 ERROR [:] [] [] [] [ecutorService-1] [.p.c.v.i.ConfigItemStatusManagerImpl] Error updating item(s) [configscripts, services, agent-instance-scripts, monit, agent-instance-startup, node-services, ipsec, ipsec-hosts, hosts, iptables, healthcheck] on [agent:486] com.google.common.util.concurrent.UncheckedExecutionException: java.lang.IllegalStateException: Delegate [delegate:///?vnetId=49&networkServiceProviderId=12] has no instance associated
	at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2199) ~[guava-15.0.jar:na]
	at com.google.common.cache.LocalCache.get(LocalCache.java:3932) ~[guava-15.0.jar:na]
	at com.google.common.cache.LocalCache.getOrLoad(LocalCache.java:3936) ~[guava-15.0.jar:na]
	at com.google.common.cache.LocalCache$LocalLoadingCache.get(LocalCache.java:4806) ~[guava-15.0.jar:na]
	at com.google.common.cache.LocalCache$LocalLoadingCache.getUnchecked(LocalCache.java:4812) ~[guava-15.0.jar:na]
	at io.cattle.platform.agent.impl.AgentLocatorImpl.lookupAgent(AgentLocatorImpl.java:85) ~[cattle-iaas-agent-0.5.0-SNAPSHOT.jar:na]
	at io.cattle.platform.configitem.version.impl.ConfigUpdatePublisher.call(ConfigUpdatePublisher.java:327) [cattle-config-item-common-0.5.0-SNAPSHOT.jar:na]
	at io.cattle.platform.configitem.version.impl.ConfigUpdatePublisher.publishUpdate(ConfigUpdatePublisher.java:231) [cattle-config-item-common-0.5.0-SNAPSHOT.jar:na]
	at io.cattle.platform.configitem.version.impl.ConfigUpdatePublisher.publish(ConfigUpdatePublisher.java:201) [cattle-config-item-common-0.5.0-SNAPSHOT.jar:na]
	at io.cattle.platform.configitem.version.impl.ConfigUpdatePublisher.loopBody(ConfigUpdatePublisher.java:127) [cattle-config-item-common-0.5.0-SNAPSHOT.jar:na]
	at io.cattle.platform.configitem.version.impl.ConfigUpdatePublisher.doRun(ConfigUpdatePublisher.java:100) [cattle-config-item-common-0.5.0-SNAPSHOT.jar:na]
	at org.apache.cloudstack.managed.context.NoExceptionRunnable.runInContext(NoExceptionRunnable.java:15) [cattle-framework-managed-context-0.5.0-SNAPSHOT.jar:na]
	at org.apache.cloudstack.managed.context.ManagedContextRunnable$1.run(ManagedContextRunnable.java:49) [cattle-framework-managed-context-0.5.0-SNAPSHOT.jar:na]
	at org.apache.cloudstack.managed.context.impl.DefaultManagedContext$1.call(DefaultManagedContext.java:55) [cattle-framework-managed-context-0.5.0-SNAPSHOT.jar:na]
	at org.apache.cloudstack.managed.context.impl.DefaultManagedContext.callWithContext(DefaultManagedContext.java:108) [cattle-framework-managed-context-0.5.0-SNAPSHOT.jar:na]
	at org.apache.cloudstack.managed.context.impl.DefaultManagedContext.runWithContext(DefaultManagedContext.java:52) [cattle-framework-managed-context-0.5.0-SNAPSHOT.jar:na]
	at org.apache.cloudstack.managed.context.ManagedContextRunnable.run(ManagedContextRunnable.java:46) [cattle-framework-managed-context-0.5.0-SNAPSHOT.jar:na]
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [na:1.8.0_72]
	at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308) [na:1.8.0_72]
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180) [na:1.8.0_72]
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294) [na:1.8.0_72]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [na:1.8.0_72]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [na:1.8.0_72]
	at java.lang.Thread.run(Thread.java:745) [na:1.8.0_72]
Caused by: java.lang.IllegalStateException: Delegate [delegate:///?vnetId=49&networkServiceProviderId=12] has no instance associated
	at io.cattle.platform.agent.impl.AgentLocatorImpl.getAgentForDelegate(AgentLocatorImpl.java:132) ~[cattle-iaas-agent-0.5.0-SNAPSHOT.jar:na]
	at io.cattle.platform.agent.impl.AgentLocatorImpl.buildDelegate(AgentLocatorImpl.java:104) ~[cattle-iaas-agent-0.5.0-SNAPSHOT.jar:na]
	at io.cattle.platform.agent.impl.AgentLocatorImpl$1.load(AgentLocatorImpl.java:52) ~[cattle-iaas-agent-0.5.0-SNAPSHOT.jar:na]
	at io.cattle.platform.agent.impl.AgentLocatorImpl$1.load(AgentLocatorImpl.java:47) ~[cattle-iaas-agent-0.5.0-SNAPSHOT.jar:na]
	at com.google.common.cache.LocalCache$LoadingValueReference.loadFuture(LocalCache.java:3522) ~[guava-15.0.jar:na]
	at com.google.common.cache.LocalCache$Segment.loadSync(LocalCache.java:2315) ~[guava-15.0.jar:na]
	at com.google.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2278) ~[guava-15.0.jar:na]
	at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2193) ~[guava-15.0.jar:na]
	... 23 common frames omitted

Expected:

@eltair
Copy link

eltair commented Dec 20, 2016

I have this issue as well after upgrading from 1.1.4 to 1.2.1. I'm running server on docker 1.11.2 on Amazon Linux AMI 2016.09. Hosts are running ubuntu.

@chenapan
Copy link

Same problem here, I thought first a problem with volumes while deploying a stack using them but even a clean restart of rancher server raises this exception that loops :

2016-12-29 16:55:08,337 ERROR [:] [] [] [] [ecutorService-1] [.p.c.v.i.ConfigItemStatusManagerImpl] Error updating item(s) [configscripts, services, agent-instance-scripts, monit, agent-instance-startup, node-services, ipsec, ipsec-hosts, hosts, iptables, healthcheck] on [agent:8] com.google.common.util.concurrent.UncheckedExecutionException: java.lang.IllegalStateException: Delegate [delegate:///?vnetId=3&networkServiceProviderId=4] has no instance associated
at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2199) ~[guava-15.0.jar:na]

Rancher version : 1.2.2
Docker version 1.12.3, build 6b644ec

@ephillipe
Copy link

Same problem here:
Rancher version : 1.3.0
Docker version 1.12.6, build 78d1802

2017-01-12 15:46:39,051 ERROR [:] [] [] [] [ecutorService-7] [.p.c.v.i.ConfigItemStatusManagerImpl] Error updating item(s) [agent-instance-scripts, healthcheck, services, iptables, configscripts, hosts, ipsec-hosts, ipsec, node-services, agent-instance-startup, monit] on [agent:22404] com.google.common.util.concurrent.UncheckedExecutionException: java.lang.IllegalStateException: Delegate [delegate:///?vnetId=594&networkServiceProviderId=1] has no instance associated

@sra
Copy link

sra commented Jan 23, 2017

Happening for us as well - the message is spamming as fast as it can print.

Rancher Server 1.3.2
Rancher OS 0.7.1

2017-01-22 19:47:37,962 ERROR [:] [] [] [] [ecutorService-6] [i.c.p.agent.impl.AgentLocatorImpl   ] Failed to find instance to delegate to for agent [180] uri [delegate:///?vnetId=19&networkServiceProviderId=3]
2017-01-22 19:47:37,966 ERROR [:] [] [] [] [ecutorService-6] [.p.c.v.i.ConfigItemStatusManagerImpl] Error updating item(s) [configscripts, services, agent-instance-scripts, monit, agent-instance-startup, node-services, ipsec, ipsec-hosts, hosts, iptables, healthcheck] on [agent:180] com.google.common.util.concurrent.UncheckedExecutionException: java.lang.IllegalStateException: Delegate [delegate:///?vnetId=19&networkServiceProviderId=3] has no instance associated
	at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2199) ~[guava-15.0.jar:na]
	at com.google.common.cache.LocalCache.get(LocalCache.java:3932) ~[guava-15.0.jar:na]
	at com.google.common.cache.LocalCache.getOrLoad(LocalCache.java:3936) ~[guava-15.0.jar:na]
	at com.google.common.cache.LocalCache$LocalLoadingCache.get(LocalCache.java:4806) ~[guava-15.0.jar:na]
	at com.google.common.cache.LocalCache$LocalLoadingCache.getUnchecked(LocalCache.java:4812) ~[guava-15.0.jar:na]
	at io.cattle.platform.agent.impl.AgentLocatorImpl.lookupAgent(AgentLocatorImpl.java:85) ~[cattle-iaas-agent-0.5.0-SNAPSHOT.jar:na]
	at io.cattle.platform.configitem.version.impl.ConfigUpdatePublisher.call(ConfigUpdatePublisher.java:327) [cattle-config-item-common-0.5.0-SNAPSHOT.jar:na]
	at io.cattle.platform.configitem.version.impl.ConfigUpdatePublisher.publishUpdate(ConfigUpdatePublisher.java:231) [cattle-config-item-common-0.5.0-SNAPSHOT.jar:na]
	at io.cattle.platform.configitem.version.impl.ConfigUpdatePublisher.publish(ConfigUpdatePublisher.java:201) [cattle-config-item-common-0.5.0-SNAPSHOT.jar:na]
	at io.cattle.platform.configitem.version.impl.ConfigUpdatePublisher.loopBody(ConfigUpdatePublisher.java:127) [cattle-config-item-common-0.5.0-SNAPSHOT.jar:na]
	at io.cattle.platform.configitem.version.impl.ConfigUpdatePublisher.doRun(ConfigUpdatePublisher.java:100) [cattle-config-item-common-0.5.0-SNAPSHOT.jar:na]
	at org.apache.cloudstack.managed.context.NoExceptionRunnable.runInContext(NoExceptionRunnable.java:15) [cattle-framework-managed-context-0.5.0-SNAPSHOT.jar:na]
	at org.apache.cloudstack.managed.context.ManagedContextRunnable$1.run(ManagedContextRunnable.java:49) [cattle-framework-managed-context-0.5.0-SNAPSHOT.jar:na]
	at org.apache.cloudstack.managed.context.impl.DefaultManagedContext$1.call(DefaultManagedContext.java:55) [cattle-framework-managed-context-0.5.0-SNAPSHOT.jar:na]
	at org.apache.cloudstack.managed.context.impl.DefaultManagedContext.callWithContext(DefaultManagedContext.java:108) [cattle-framework-managed-context-0.5.0-SNAPSHOT.jar:na]
	at org.apache.cloudstack.managed.context.impl.DefaultManagedContext.runWithContext(DefaultManagedContext.java:52) [cattle-framework-managed-context-0.5.0-SNAPSHOT.jar:na]
	at org.apache.cloudstack.managed.context.ManagedContextRunnable.run(ManagedContextRunnable.java:46) [cattle-framework-managed-context-0.5.0-SNAPSHOT.jar:na]
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [na:1.8.0_72]
	at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308) [na:1.8.0_72]
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180) [na:1.8.0_72]
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294) [na:1.8.0_72]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [na:1.8.0_72]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [na:1.8.0_72]
	at java.lang.Thread.run(Thread.java:745) [na:1.8.0_72]
Caused by: java.lang.IllegalStateException: Delegate [delegate:///?vnetId=19&networkServiceProviderId=3] has no instance associated
	at io.cattle.platform.agent.impl.AgentLocatorImpl.getAgentForDelegate(AgentLocatorImpl.java:132) ~[cattle-iaas-agent-0.5.0-SNAPSHOT.jar:na]
	at io.cattle.platform.agent.impl.AgentLocatorImpl.buildDelegate(AgentLocatorImpl.java:104) ~[cattle-iaas-agent-0.5.0-SNAPSHOT.jar:na]
	at io.cattle.platform.agent.impl.AgentLocatorImpl$1.load(AgentLocatorImpl.java:52) ~[cattle-iaas-agent-0.5.0-SNAPSHOT.jar:na]
	at io.cattle.platform.agent.impl.AgentLocatorImpl$1.load(AgentLocatorImpl.java:47) ~[cattle-iaas-agent-0.5.0-SNAPSHOT.jar:na]
	at com.google.common.cache.LocalCache$LoadingValueReference.loadFuture(LocalCache.java:3522) ~[guava-15.0.jar:na]
	at com.google.common.cache.LocalCache$Segment.loadSync(LocalCache.java:2315) ~[guava-15.0.jar:na]
	at com.google.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2278) ~[guava-15.0.jar:na]
	at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2193) ~[guava-15.0.jar:na]
	... 23 common frames omitted

2017-01-22 19:47:52,982 ERROR [:] [] [] [] [ecutorService-6] [i.c.p.agent.impl.AgentLocatorImpl   ] Failed to find instance to delegate to for agent [180] uri [delegate:///?vnetId=19&networkServiceProviderId=3]
2017-01-22 19:47:52,986 ERROR [:] [] [] [] [ecutorService-6] [.p.c.v.i.ConfigItemStatusManagerImpl] Error updating item(s) [configscripts, services, agent-instance-scripts, monit, agent-instance-startup, node-services, ipsec, ipsec-hosts, hosts, iptables, healthcheck] on [agent:180] com.google.common.util.concurrent.UncheckedExecutionException: java.lang.IllegalStateException: Delegate [delegate:///?vnetId=19&networkServiceProvide

@Ilya-Kuchaev
Copy link

+1

@tcdev0
Copy link

tcdev0 commented Feb 9, 2017

And again.

Rancher version : 1.4.0 / Cattle
Docker version 1.12.6
OS: Ubuntu 16.04

2017-02-09 15:00:10,354 ERROR [:] [] [] [] [ecutorService-5] [i.c.p.agent.impl.AgentLocatorImpl   ] Failed to find instance to delegate to for agent [317] uri [delegate:///?vnetId=11&networkServiceProviderId=5] 
2017-02-09 15:00:10,355 ERROR [:] [] [] [] [ecutorService-5] [.p.c.v.i.ConfigItemStatusManagerImpl] Error updating item(s) [services, agent-instance-scripts, monit, agent-instance-startup, node-services, ipsec, ipsec-hosts, hosts, iptables, healthcheck] on [agent:1919] com.google.common.util.concurrent.UncheckedExecutionException: java.lang.IllegalStateException: Delegate [delegate:///?vnetId=21&networkServiceProviderId=8] has no instance associated
	at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2199) ~[guava-15.0.jar:na]
	at com.google.common.cache.LocalCache.get(LocalCache.java:3932) ~[guava-15.0.jar:na]
	at com.google.common.cache.LocalCache.getOrLoad(LocalCache.java:3936) ~[guava-15.0.jar:na]
	at com.google.common.cache.LocalCache$LocalLoadingCache.get(LocalCache.java:4806) ~[guava-15.0.jar:na]
	at com.google.common.cache.LocalCache$LocalLoadingCache.getUnchecked(LocalCache.java:4812) ~[guava-15.0.jar:na]
	at io.cattle.platform.agent.impl.AgentLocatorImpl.lookupAgent(AgentLocatorImpl.java:85) ~[cattle-iaas-agent-0.5.0-SNAPSHOT.jar:na]
	at io.cattle.platform.configitem.version.impl.ConfigUpdatePublisher.call(ConfigUpdatePublisher.java:327) [cattle-config-item-common-0.5.0-SNAPSHOT.jar:na]
	at io.cattle.platform.configitem.version.impl.ConfigUpdatePublisher.publishUpdate(ConfigUpdatePublisher.java:231) [cattle-config-item-common-0.5.0-SNAPSHOT.jar:na]
	at io.cattle.platform.configitem.version.impl.ConfigUpdatePublisher.publish(ConfigUpdatePublisher.java:201) [cattle-config-item-common-0.5.0-SNAPSHOT.jar:na]
	at io.cattle.platform.configitem.version.impl.ConfigUpdatePublisher.loopBody(ConfigUpdatePublisher.java:127) [cattle-config-item-common-0.5.0-SNAPSHOT.jar:na]
	at io.cattle.platform.configitem.version.impl.ConfigUpdatePublisher.doRun(ConfigUpdatePublisher.java:100) [cattle-config-item-common-0.5.0-SNAPSHOT.jar:na]
	at org.apache.cloudstack.managed.context.NoExceptionRunnable.runInContext(NoExceptionRunnable.java:15) [cattle-framework-managed-context-0.5.0-SNAPSHOT.jar:na]
	at org.apache.cloudstack.managed.context.ManagedContextRunnable$1.run(ManagedContextRunnable.java:49) [cattle-framework-managed-context-0.5.0-SNAPSHOT.jar:na]
	at org.apache.cloudstack.managed.context.impl.DefaultManagedContext$1.call(DefaultManagedContext.java:55) [cattle-framework-managed-context-0.5.0-SNAPSHOT.jar:na]
	at org.apache.cloudstack.managed.context.impl.DefaultManagedContext.callWithContext(DefaultManagedContext.java:108) [cattle-framework-managed-context-0.5.0-SNAPSHOT.jar:na]
	at org.apache.cloudstack.managed.context.impl.DefaultManagedContext.runWithContext(DefaultManagedContext.java:52) [cattle-framework-managed-context-0.5.0-SNAPSHOT.jar:na]
	at org.apache.cloudstack.managed.context.ManagedContextRunnable.run(ManagedContextRunnable.java:46) [cattle-framework-managed-context-0.5.0-SNAPSHOT.jar:na]
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [na:1.8.0_72]
	at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308) [na:1.8.0_72]
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180) [na:1.8.0_72]
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294) [na:1.8.0_72]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [na:1.8.0_72]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [na:1.8.0_72]
	at java.lang.Thread.run(Thread.java:745) [na:1.8.0_72]
Caused by: java.lang.IllegalStateException: Delegate [delegate:///?vnetId=21&networkServiceProviderId=8] has no instance associated
	at io.cattle.platform.agent.impl.AgentLocatorImpl.getAgentForDelegate(AgentLocatorImpl.java:132) ~[cattle-iaas-agent-0.5.0-SNAPSHOT.jar:na]
	at io.cattle.platform.agent.impl.AgentLocatorImpl.buildDelegate(AgentLocatorImpl.java:104) ~[cattle-iaas-agent-0.5.0-SNAPSHOT.jar:na]
	at io.cattle.platform.agent.impl.AgentLocatorImpl$1.load(AgentLocatorImpl.java:52) ~[cattle-iaas-agent-0.5.0-SNAPSHOT.jar:na]
	at io.cattle.platform.agent.impl.AgentLocatorImpl$1.load(AgentLocatorImpl.java:47) ~[cattle-iaas-agent-0.5.0-SNAPSHOT.jar:na]
	at com.google.common.cache.LocalCache$LoadingValueReference.loadFuture(LocalCache.java:3522) ~[guava-15.0.jar:na]
	at com.google.common.cache.LocalCache$Segment.loadSync(LocalCache.java:2315) ~[guava-15.0.jar:na]
	at com.google.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2278) ~[guava-15.0.jar:na]
	at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2193) ~[guava-15.0.jar:na]
	... 23 common frames omitted

@siosphere
Copy link

Docker version: 1.12.1
Rancher version: 1.4.1 / Cattle
OS: Centos 7.2

2017-02-11 20:55:15,144 ERROR [:] [] [] [] [ecutorService-5] [.p.c.v.i.ConfigItemStatusManagerImpl] Error updating item(s) [agent-instance-startup, node-services, ipsec, ipsec-hosts, hosts, iptables, healthcheck, rancher-net] on [agent:405] com.google.common.util.concurrent.UncheckedExecutionException: java.lang.IllegalStateException: Delegate [delegate:///?vnetId=15&networkServiceProviderId=3] has no instance associated
	at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2199) ~[guava-15.0.jar:na]
	at com.google.common.cache.LocalCache.get(LocalCache.java:3932) ~[guava-15.0.jar:na]
	at com.google.common.cache.LocalCache.getOrLoad(LocalCache.java:3936) ~[guava-15.0.jar:na]
	at com.google.common.cache.LocalCache$LocalLoadingCache.get(LocalCache.java:4806) ~[guava-15.0.jar:na]
	at com.google.common.cache.LocalCache$LocalLoadingCache.getUnchecked(LocalCache.java:4812) ~[guava-15.0.jar:na]
	at io.cattle.platform.agent.impl.AgentLocatorImpl.lookupAgent(AgentLocatorImpl.java:85) ~[cattle-iaas-agent-0.5.0-SNAPSHOT.jar:na]
	at io.cattle.platform.configitem.version.impl.ConfigUpdatePublisher.call(ConfigUpdatePublisher.java:327) [cattle-config-item-common-0.5.0-SNAPSHOT.jar:na]
	at io.cattle.platform.configitem.version.impl.ConfigUpdatePublisher.publishUpdate(ConfigUpdatePublisher.java:231) [cattle-config-item-common-0.5.0-SNAPSHOT.jar:na]
	at io.cattle.platform.configitem.version.impl.ConfigUpdatePublisher.publish(ConfigUpdatePublisher.java:201) [cattle-config-item-common-0.5.0-SNAPSHOT.jar:na]
	at io.cattle.platform.configitem.version.impl.ConfigUpdatePublisher.loopBody(ConfigUpdatePublisher.java:127) [cattle-config-item-common-0.5.0-SNAPSHOT.jar:na]
	at io.cattle.platform.configitem.version.impl.ConfigUpdatePublisher.doRun(ConfigUpdatePublisher.java:100) [cattle-config-item-common-0.5.0-SNAPSHOT.jar:na]
	at org.apache.cloudstack.managed.context.NoExceptionRunnable.runInContext(NoExceptionRunnable.java:15) [cattle-framework-managed-context-0.5.0-SNAPSHOT.jar:na]
	at org.apache.cloudstack.managed.context.ManagedContextRunnable$1.run(ManagedContextRunnable.java:49) [cattle-framework-managed-context-0.5.0-SNAPSHOT.jar:na]
	at org.apache.cloudstack.managed.context.impl.DefaultManagedContext$1.call(DefaultManagedContext.java:55) [cattle-framework-managed-context-0.5.0-SNAPSHOT.jar:na]
	at org.apache.cloudstack.managed.context.impl.DefaultManagedContext.callWithContext(DefaultManagedContext.java:108) [cattle-framework-managed-context-0.5.0-SNAPSHOT.jar:na]
	at org.apache.cloudstack.managed.context.impl.DefaultManagedContext.runWithContext(DefaultManagedContext.java:52) [cattle-framework-managed-context-0.5.0-SNAPSHOT.jar:na]
	at org.apache.cloudstack.managed.context.ManagedContextRunnable.run(ManagedContextRunnable.java:46) [cattle-framework-managed-context-0.5.0-SNAPSHOT.jar:na]
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [na:1.8.0_72]
	at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308) [na:1.8.0_72]
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180) [na:1.8.0_72]
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294) [na:1.8.0_72]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [na:1.8.0_72]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [na:1.8.0_72]
	at java.lang.Thread.run(Thread.java:745) [na:1.8.0_72]
Caused by: java.lang.IllegalStateException: Delegate [delegate:///?vnetId=15&networkServiceProviderId=3] has no instance associated
	at io.cattle.platform.agent.impl.AgentLocatorImpl.getAgentForDelegate(AgentLocatorImpl.java:132) ~[cattle-iaas-agent-0.5.0-SNAPSHOT.jar:na]
	at io.cattle.platform.agent.impl.AgentLocatorImpl.buildDelegate(AgentLocatorImpl.java:104) ~[cattle-iaas-agent-0.5.0-SNAPSHOT.jar:na]
	at io.cattle.platform.agent.impl.AgentLocatorImpl$1.load(AgentLocatorImpl.java:52) ~[cattle-iaas-agent-0.5.0-SNAPSHOT.jar:na]
	at io.cattle.platform.agent.impl.AgentLocatorImpl$1.load(AgentLocatorImpl.java:47) ~[cattle-iaas-agent-0.5.0-SNAPSHOT.jar:na]
	at com.google.common.cache.LocalCache$LoadingValueReference.loadFuture(LocalCache.java:3522) ~[guava-15.0.jar:na]
	at com.google.common.cache.LocalCache$Segment.loadSync(LocalCache.java:2315) ~[guava-15.0.jar:na]
	at com.google.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2278) ~[guava-15.0.jar:na]
	at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2193) ~[guava-15.0.jar:na]
	... 23 common frames omitted

This eventually causes Rancher to stop responding to web requests. Temporary fix is to stop the container, remove it, and re-create a new container (pointed to the same existing external DB), this proved ~2 days of up time, before it stops responding to web requests again.

@CLEMARCx
Copy link

CLEMARCx commented Feb 20, 2017

Hi there,

I had the same error with rancher and a local database. The mysql database was corrupt.
After

docker exec -i -t containerID /bin/bash
mysqlrepair --all-databases --auto-repair

the errors went away and rancher was reachable again.

@aemneina
Copy link

@CLEMARCx I dont think you have the same issue as the others in this thread. It looks like there are orphaned agents, there might be an entry for the agent that doesnt match any existing host. Does this query return anything: select id from agent where id not in (select agent_id from host)

@csbogdan
Copy link

+1 for the error with rancher 1.3.3, upgraded sequentially from 1.1.4 (original installation).

@tcdev0
Copy link

tcdev0 commented Mar 27, 2017

@aemneina executing your statement returned for me 246 rows / results

@sankaet
Copy link

sankaet commented Mar 27, 2017

Hi any resolution here? I am seeing something similar: #8308

@sra
Copy link

sra commented Mar 27, 2017

I made this quit by finding the row in the agent table in the rancher database (use the delegate message from your log messages):

select * from agent where uri like 'delegate:///?vnetId=19&networkServiceProviderId=3'

Then I marked the record as purged and restarted rancher server.

update agent set state = 'purged' where id = ID_FROM_PREVIOUS_SELECT

This stopped the spam, but I'm not sure if it had any other effect. So far so good.

@sankaet
Copy link

sankaet commented Mar 27, 2017

@sra in my case it returns an empty set

@greenu
Copy link

greenu commented Mar 30, 2017

@sankaet try this:
update agent set removed = NOW(), state = 'removed' where removed is null and uri like 'delegate%'

@snipking
Copy link

snipking commented Mar 31, 2017

@aemneina @sra

Thanks. That's worked for me.

  1. Find out active agent records which didn't related to a host.
select id, kind, uuid, state, created, uri from agent where id not in (select agent_id from host) and state = 'active' and uri like 'delegate%';
  1. Double check the uri with your rancher-server log. In my case I got 2 records which uri match the exception in server log.

  2. Update the record state to purged

update agent set state = 'purged' where id = <ID_FROM_PREVIOUS_SELECT>
  1. Restart rancher-server.

@aemneina
Copy link

This should have since been resolved in newer versions of rancher. Please file a new issue if there are any issues surfacing post upgrades.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests