cloudstack icon indicating copy to clipboard operation
cloudstack copied to clipboard

Bug: UI fails with 503 just after a successful install

Open tampler opened this issue 3 years ago β€’ 63 comments

ISSUE TYPE
  • Bug Report
COMPONENT NAME
Setup, UI
CLOUDSTACK VERSION
4.19.0.0-snapshot.20231106
CONFIGURATION

Initial setup of management and KVM server on a single host

Possibly related to #7358

OS / ENVIRONMENT

Ubuntu 22.04.3 Java: openjdk 11.0.20.1 2023-08-24 MySQL: 8.0.35-0ubuntu0.22.04.1

SUMMARY

2023-11-10 13:45:27,306 ERROR [o.a.c.s.m.m.i.DefaultModuleDefinitionSet] (main:null) (logid:) Failed to load module [redfish] due to: [Error creating bean with name 'org.spr ingframework.beans.factory.config.PropertyPlaceholderConfigurer#0' defined in URL [jar:file:/usr/share/cloudstack-management/lib/cloudstack-4.19.0.0-snapshot.20231106.jar!/M ETA-INF/cloudstack/bootstrap/spring-bootstrap-context-inheritable.xml]: Cannot resolve reference to bean 'DefaultConfigResources' while setting bean property 'locations'; ne sted exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'DefaultConfigResources' available]. org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.beans.factory.config.PropertyPlaceholderConfigurer#0' defined in URL [jar:file:/usr/share/cloudstack-management/lib/cloudstack-4.19.0.0-snapshot.20231106.jar!/META-INF/cloudstack/bootstrap/spring-bootstrap-context-inheritable.xml]: Cannot resolve reference to bean 'DefaultConfigResources' while setting bean property 'locations'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionExcept ion: No bean named 'DefaultConfigResources' available

STEPS TO REPRODUCE
1. Install management and agent servers on a local host
2. Validate systemctl services:

> systemctl status cloudstack-management.service
● cloudstack-management.service - CloudStack Management Server
     Loaded: loaded (/lib/systemd/system/cloudstack-management.service; enabled; vendor preset: enabled)
     Active: active (running) since Fri 2023-11-10 13:44:10 UTC; 19min ago

> systemctl status cloudstack-agent.service
● cloudstack-agent.service - CloudStack Agent
     Loaded: loaded (/lib/systemd/system/cloudstack-agent.service; enabled; vendor preset: enabled)
     Active: active (running) since Fri 2023-11-10 13:44:12 UTC; 19min ago

3. Check UI:
admin@acs:~$ curl -I localhost:8080/client/
HTTP/1.1 503 Service Unavailable
EXPECTED RESULTS
UI starts on the management server host
ACTUAL RESULTS
UI fails with 503 due to the bean error 

tampler avatar Nov 10 '23 14:11 tampler

@tampler You can change global setting "host" to 192.168.0.4, restart mgmt service and retry

Hello @weizhouapache This was the most obvious change, but it didn't work for me since something was rewriting it back to host=10.105.xxx.yyy πŸ₯²

@tampler have you restarted the management service after the change ? it is not a dynamic setting so you need to restart service.

However, I was able to fix this issue by bypassing SSVM at all 😎 . When I create an iso, I check the Direct download knob. This forces to download an iso on each deploy and load it to the Primary storage, which is OK, since I host all my VMs locally in DC.

good

Moreover, SSVM seems more like a relict than a feature. NGINX, S3, Ceph, Gluster, Linstor are all candidates to substitute a NFS caching implemented by SSVM

ACS does support NFS/S3/Swift/SMB as secondary storage. I think most users choose NFS

Overall, after spending 2w on the initial config issue I feel like lucky to have resolve it relatively quick πŸ˜„ . Thanks everyone for your help! @weizhouapache @DaanHoogland I feel like I owe you to update ACS docs and cover my experience and all troubleshooting steps for Ubuntu 22.04 😏 😏 😏

weizhouapache avatar Nov 22 '23 15:11 weizhouapache

@tampler can we/you close this ticket ?

weizhouapache avatar Dec 01 '23 08:12 weizhouapache

@weizhouapache Hello Wei I've come up with a workaround and using it, bypassing the secondary storage by applying the "direct download" feature. This works well, since I host all my VM images locally in rack.

The real issue is picking a proper mgmt server address on a metal host with two NICs. Let me try the latest build and try again for the benefit of ACS community

tampler avatar Dec 01 '23 09:12 tampler

@weizhouapache Hello Wei I've come up with a workaround and using it, bypassing the secondary storage by applying the "direct download" feature. This works well, since I host all my VM images locally in rack.

The real issue is picking a proper mgmt server address on a metal host with two NICs. Let me try the latest build and try again for the benefit of ACS community

Ok @tampler

It would be good to share the ip/vlan/linux bridge configuraitons of mgmt server (and host if different server), and the pod IPs, public IPs in the CloudStack zone.

weizhouapache avatar Dec 01 '23 10:12 weizhouapache

Hi @weizhouapache

I was able to reproduce this issue again on another setup :bulb:. The core issue was invalid result in DB config after cloudstack-setup-databases . Namely, databases were created and populated with tables. However, all tables were empty! :grimacing: That yielded in issues downstream and my fix was to run cloudstack-setup-databases again and rerun the install flow further. There should be some validators after each major install step to provided immediate feedback to the user :crossed_fingers: .

All said and done, I believe it is a mostly documentation issue :roll_eyes: Cloudstack has been around for 15 years now, but both docs and install flow are very complex and not friendly for newcomers.

Thanks everyone involved in this issue! :handshake: I'll do my contrib on this topic :fire:

tampler avatar Dec 11 '23 17:12 tampler

Hi @weizhouapache

I was able to reproduce this issue again on another setup πŸ’‘. The core issue was invalid result in DB config after cloudstack-setup-databases . Namely, databases were created and populated with tables. However, all tables were empty! 😬 That yielded in issues downstream and my fix was to run cloudstack-setup-databases again and rerun the install flow further. There should be some validators after each major install step to provided immediate feedback to the user 🀞 .

All said and done, I believe it is a mostly documentation issue πŸ™„ Cloudstack has been around for 15 years now, but both docs and install flow are very complex and not friendly for newcomers.

Thanks everyone involved in this issue! 🀝 I'll do my contrib on this topic πŸ”₯

thanks for the update @tampler did you use non-root user to setup the database ?

weizhouapache avatar Dec 12 '23 07:12 weizhouapache

I use [email protected] and reproduced this problem.

WowYouCanReallyDance avatar Feb 07 '24 11:02 WowYouCanReallyDance

I use [email protected] and reproduced this problem.

@WowYouCanReallyDance can you use root user to setup the database ?

weizhouapache avatar Feb 07 '24 11:02 weizhouapache

I use [email protected] and reproduced this problem.

@WowYouCanReallyDance can you use root user to setup the database ?

yeah, I do used root user. cloudstack-setup-databases cloud:[email protected] --deploy-as=root:admin123 and runned cloudstack-setup-databases cloud:[email protected] on another host.

WowYouCanReallyDance avatar Feb 07 '24 11:02 WowYouCanReallyDance

I use [email protected] and reproduced this problem.

@WowYouCanReallyDance can you use root user to setup the database ?

I am now deploying again, this is logs:

2024-02-07 06:19:23,459 DEBUG [o.a.c.s.m.m.i.DefaultModuleDefinitionSet] (main:null) (logid:) Trying to obtain module [redfish] context.
2024-02-07 06:19:23,459 DEBUG [o.a.c.s.m.m.i.DefaultModuleDefinitionSet] (main:null) (logid:) Trying to load module [redfish] context.
2024-02-07 06:19:23,459 INFO  [o.a.c.s.m.m.i.DefaultModuleDefinitionSet] (main:null) (logid:) Loading module context [redfish] from URL [jar:file:/usr/share/cloudstack-management/lib/cloudstack-4.19.0.0.jar!/META-INF/cloudstack/redfish/spring-redfish-context.xml]
2024-02-07 06:19:23,459 INFO  [o.a.c.s.m.m.i.DefaultModuleDefinitionSet] (main:null) (logid:) Loading module context [redfish] from URL [jar:file:/usr/share/cloudstack-management/lib/cloudstack-4.19.0.0.jar!/META-INF/cloudstack/outofbandmanagement/spring-core-lifecycle-outofbandmanagement-context-inheritable.xml]
2024-02-07 06:19:23,459 INFO  [o.a.c.s.m.m.i.DefaultModuleDefinitionSet] (main:null) (logid:) Loading module context [redfish] from URL [jar:file:/usr/share/cloudstack-management/lib/cloudstack-4.19.0.0.jar!/META-INF/cloudstack/core/spring-core-lifecycle-core-context-inheritable.xml]
2024-02-07 06:19:23,459 INFO  [o.a.c.s.m.m.i.DefaultModuleDefinitionSet] (main:null) (logid:) Loading module context [redfish] from URL [jar:file:/usr/share/cloudstack-management/lib/cloudstack-4.19.0.0.jar!/META-INF/cloudstack/system/spring-core-system-context-inheritable.xml]
2024-02-07 06:19:23,460 INFO  [o.a.c.s.m.m.i.DefaultModuleDefinitionSet] (main:null) (logid:) Loading module context [redfish] from URL [jar:file:/usr/share/cloudstack-management/lib/cloudstack-4.19.0.0.jar!/META-INF/cloudstack/system/spring-framework-config-system-context-inheritable.xml]
2024-02-07 06:19:23,460 INFO  [o.a.c.s.m.m.i.DefaultModuleDefinitionSet] (main:null) (logid:) Loading module context [redfish] from URL [jar:file:/usr/share/cloudstack-management/lib/cloudstack-4.19.0.0.jar!/META-INF/cloudstack/system/spring-contrail-system-context-inheritable.xml]
2024-02-07 06:19:23,460 INFO  [o.a.c.s.m.m.i.DefaultModuleDefinitionSet] (main:null) (logid:) Loading module context [redfish] from URL [jar:file:/usr/share/cloudstack-management/lib/cloudstack-4.19.0.0.jar!/META-INF/cloudstack/bootstrap/spring-bootstrap-context-inheritable.xml]
2024-02-07 06:19:23,481 WARN  [o.a.c.s.m.m.i.DefaultModuleDefinitionSet] (main:null) (logid:) Failed to start module [redfish] due to: [Error creating bean with name 'org.springframework.beans.factory.config.PropertyPlaceholderConfigurer#0' defined in URL [jar:file:/usr/share/cloudstack-management/lib/cloudstack-4.19.0.0.jar!/META-INF/cloudstack/bootstrap/spring-bootstrap-context-inheritable.xml]: Cannot resolve reference to bean 'DefaultConfigResources' while setting bean property 'locations'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'DefaultConfigResources' available].
2024-02-07 06:19:23,481 DEBUG [o.a.c.s.m.m.i.DefaultModuleDefinitionSet] (main:null) (logid:) module start failure of module [redfish] was due to:
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.beans.factory.config.PropertyPlaceholderConfigurer#0' defined in URL [jar:file:/usr/share/cloudstack-management/lib/cloudstack-4.19.0.0.jar!/META-INF/cloudstack/bootstrap/spring-bootstrap-context-inheritable.xml]: Cannot resolve reference to bean 'DefaultConfigResources' while setting bean property 'locations'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'DefaultConfigResources' available
	at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:342)
	at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:113)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1707)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1452)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:619)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542)
	at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335)
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234)
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333)
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:213)
	at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:171)
	at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:748)
	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:564)
	at org.apache.cloudstack.spring.module.model.impl.DefaultModuleDefinitionSet.loadContext(DefaultModuleDefinitionSet.java:171)
	at org.apache.cloudstack.spring.module.model.impl.DefaultModuleDefinitionSet$2.with(DefaultModuleDefinitionSet.java:140)
	at org.apache.cloudstack.spring.module.model.impl.DefaultModuleDefinitionSet.withModule(DefaultModuleDefinitionSet.java:271)
	at org.apache.cloudstack.spring.module.model.impl.DefaultModuleDefinitionSet.withModule(DefaultModuleDefinitionSet.java:276)
	at org.apache.cloudstack.spring.module.model.impl.DefaultModuleDefinitionSet.withModule(DefaultModuleDefinitionSet.java:276)
	at org.apache.cloudstack.spring.module.model.impl.DefaultModuleDefinitionSet.withModule(DefaultModuleDefinitionSet.java:276)
	at org.apache.cloudstack.spring.module.model.impl.DefaultModuleDefinitionSet.withModule(DefaultModuleDefinitionSet.java:276)
	at org.apache.cloudstack.spring.module.model.impl.DefaultModuleDefinitionSet.withModule(DefaultModuleDefinitionSet.java:259)
	at org.apache.cloudstack.spring.module.model.impl.DefaultModuleDefinitionSet.loadContexts(DefaultModuleDefinitionSet.java:128)
	at org.apache.cloudstack.spring.module.model.impl.DefaultModuleDefinitionSet.load(DefaultModuleDefinitionSet.java:78)
	at org.apache.cloudstack.spring.module.factory.ModuleBasedContextFactory.loadModules(ModuleBasedContextFactory.java:37)
	at org.apache.cloudstack.spring.module.factory.CloudStackSpringContext.init(CloudStackSpringContext.java:70)
	at org.apache.cloudstack.spring.module.factory.CloudStackSpringContext.<init>(CloudStackSpringContext.java:57)
	at org.apache.cloudstack.spring.module.factory.CloudStackSpringContext.<init>(CloudStackSpringContext.java:61)
	at org.apache.cloudstack.spring.module.web.CloudStackContextLoaderListener.contextInitialized(CloudStackContextLoaderListener.java:52)
	at org.eclipse.jetty.server.handler.ContextHandler.callContextInitialized(ContextHandler.java:1073)
	at org.eclipse.jetty.servlet.ServletContextHandler.callContextInitialized(ServletContextHandler.java:572)
	at org.eclipse.jetty.server.handler.ContextHandler.contextInitialized(ContextHandler.java:1002)
	at org.eclipse.jetty.servlet.ServletHandler.initialize(ServletHandler.java:765)
	at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:379)
	at org.eclipse.jetty.webapp.WebAppContext.startWebapp(WebAppContext.java:1449)
	at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1414)
	at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:916)
	at org.eclipse.jetty.servlet.ServletContextHandler.doStart(ServletContextHandler.java:288)
	at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:524)
	at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:73)
	at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:169)
	at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:110)
	at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:97)
	at org.eclipse.jetty.server.handler.gzip.GzipHandler.doStart(GzipHandler.java:426)
	at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:73)
	at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:169)
	at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:117)
	at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:97)
	at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:73)
	at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:169)
	at org.eclipse.jetty.server.Server.start(Server.java:423)
	at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:110)
	at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:97)
	at org.eclipse.jetty.server.Server.doStart(Server.java:387)
	at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:73)
	at org.apache.cloudstack.ServerDaemon.start(ServerDaemon.java:199)
	at org.apache.cloudstack.ServerDaemon.main(ServerDaemon.java:112)
Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'DefaultConfigResources' available
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanDefinition(DefaultListableBeanFactory.java:874)
	at org.springframework.beans.factory.support.AbstractBeanFactory.getMergedLocalBeanDefinition(AbstractBeanFactory.java:1358)
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:309)
	... 57 more
2024-02-07 06:19:23,481 DEBUG [o.a.c.s.m.m.i.DefaultModuleDefinitionSet] (main:null) (logid:) Trying to obtain module [bootstrap] context.
2024-02-07 06:19:23,481 DEBUG [o.a.c.s.m.m.i.DefaultModuleDefinitionSet] (main:null) (logid:) Could not get module [bootstrap] context bean.
2024-02-07 06:19:23,481 DEBUG [o.a.c.s.m.m.i.DefaultModuleDefinitionSet] (main:null) (logid:) Trying to obtain module [system] context.
2024-02-07 06:19:23,481 INFO  [o.a.c.s.m.m.i.DefaultModuleDefinitionSet] (main:null) (logid:) Starting module [system].
2024-02-07 06:19:23,481 INFO  [o.a.c.s.l.CloudStackExtendedLifeCycle] (main:null) (logid:) Starting CloudStack Components
2024-02-07 06:19:23,483 INFO  [o.a.c.s.l.CloudStackExtendedLifeCycle] (main:null) (logid:) Done Starting CloudStack Components
2024-02-07 06:19:23,483 DEBUG [o.a.c.s.m.m.i.DefaultModuleDefinitionSet] (main:null) (logid:) Trying to obtain module [core] context.

WowYouCanReallyDance avatar Feb 07 '24 11:02 WowYouCanReallyDance

I'v deployed many times. And the strange thing is : it's not runned broken all the time. Sometimes it worked well.

WowYouCanReallyDance avatar Feb 07 '24 11:02 WowYouCanReallyDance

I'v deployed many times. And the strange thing is : it's not runned broken all the time. Sometimes it worked well.

@WowYouCanReallyDance the root cause could be the database (connection issue, or misconfiguration). can you restart mgmt server and share the new logs ?

weizhouapache avatar Feb 07 '24 15:02 weizhouapache

I'v deployed many times. And the strange thing is : it's not runned broken all the time. Sometimes it worked well.

@WowYouCanReallyDance the root cause could be the database (connection issue, or misconfiguration). can you restart mgmt server and share the new logs ?

I don't know why, but it's working nice now. The same DB type and version mysql:5.7, nothing changed since last time. If you need the logs, I will provide to timely.

WowYouCanReallyDance avatar Feb 07 '24 17:02 WowYouCanReallyDance

I'v deployed many times. And the strange thing is : it's not runned broken all the time. Sometimes it worked well.

@WowYouCanReallyDance the root cause could be the database (connection issue, or misconfiguration). can you restart mgmt server and share the new logs ?

I don't know why, but it's working nice now. The same DB type and version mysql:5.7, nothing changed since last time. If you need the logs, I will provide to timely.

@WowYouCanReallyDance did you make some changes on the database ?

weizhouapache avatar Feb 08 '24 08:02 weizhouapache

I'v deployed many times. And the strange thing is : it's not runned broken all the time. Sometimes it worked well.

@WowYouCanReallyDance the root cause could be the database (connection issue, or misconfiguration). can you restart mgmt server and share the new logs ?

I don't know why, but it's working nice now. The same DB type and version mysql:5.7, nothing changed since last time. If you need the logs, I will provide to timely.

@WowYouCanReallyDance

did you make some changes on the database ?

No. I use the database on containers by podman. Everytime I drop it and run again to take a start with totally same steps. Then I would runcloudstack-setup-database… and cloudstack-setup-management.

WowYouCanReallyDance avatar Feb 09 '24 14:02 WowYouCanReallyDance

@tampler I am experiencing a similar issue, but re-running the database setup procedure does not appear to resolve the issue. When the management-server loads, it fails to load nearly every module, however, no notable SQL errors appear in the logs for the install.

adietrich-ussignal avatar Mar 06 '24 14:03 adietrich-ussignal

Not sure if this is related, but I found that in setting up the db.properties file, the cluster.node.IP was getting set to 127.0.1.1, which, is not configured on any of the virtual machine interfaces on my single-node. Changing this to the VM's proper loopback, (in this case 127.0.0.1), resolved my issue with the 503.

adietrich-ussignal avatar Mar 06 '24 16:03 adietrich-ussignal

I confirm that after setting the cluster.node.IP at /etc/cloudstack/management/db.properties to be the VM IP where ACS is installed, and restarting cloudstack-management.service I got the login prompt.

rightkick avatar Apr 22 '24 22:04 rightkick

Not sure if this is related, but I found that in setting up the db.properties file, the cluster.node.IP was getting set to 127.0.1.1, which, is not configured on any of the virtual machine interfaces on my single-node. Changing this to the VM's proper loopback, (in this case 127.0.0.1), resolved my issue with the 503.

updating 127.0.1.1 to 127.0.0.1 in /etc/cloudstack/management/db.properties fixed the issue for me

nizigama avatar Jun 11 '24 06:06 nizigama

I confirm changing cluster.node.IP=127.0.0.1 on /etc/cloudstack/management/db.properties worked for me as well.

dataseeek avatar Jul 17 '24 16:07 dataseeek