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

As a possible fix, SO says it's needed to create a new directory resources

tampler avatar Nov 10 '23 14:11 tampler

  1. are the jar files in /usr/share/cloudstack-management/lib/ correct ? better to upload the list.
  2. does the user "admin" have root previledge ?

weizhouapache avatar Nov 10 '23 14:11 weizhouapache

Hello Wei

  1. Here's my list:
admin@acs:~$ ls /usr/share/cloudstack-management/lib/
bcpkix-jdk15on-1.70.jar  cloud-plugin-storage-volume-linstor-4.19.0.0-snapshot.20231106.jar   mysql-connector-java-8.0.19.jar
bcprov-jdk15on-1.70.jar  cloud-plugin-storage-volume-storpool-4.19.0.0-snapshot.20231106.jar
bctls-jdk15on-1.70.jar   cloudstack-4.19.0.0-snapshot.20231106.jar
  1. Yes, "admin" is in a sudoers list, if you mean that
  2. Java
admin@acs:~$ java --version
openjdk 11.0.20.1 2023-08-24
OpenJDK Runtime Environment (build 11.0.20.1+1-post-Ubuntu-0ubuntu122.04)

tampler avatar Nov 10 '23 14:11 tampler

     at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:97)                                                                         [42/504]
        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:193)                                                                                                   
        at org.apache.cloudstack.ServerDaemon.main(ServerDaemon.java:108)                                                                                                    
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                                                                                                                                                          
2023-11-10 13:45:27,322 DEBUG [o.a.c.s.m.m.i.DefaultModuleDefinitionSet] (main:null) (logid:) Trying to obtain module [bootstrap] context.
2023-11-10 13:45:27,322 ERROR [o.a.c.s.m.m.i.DefaultModuleDefinitionSet] (main:null) (logid:) Failed to start module [bootstrap] due to: [No bean named 'moduleStartup' avail
able].                                                                                                                                                                       
org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'moduleStartup' 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)
        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:283)

tampler avatar Nov 10 '23 14:11 tampler

The issue is bigger here since I don't see any post-installation activities, including a lower than usual memory footprint and not writing to a management operation log file.

tampler avatar Nov 13 '23 16:11 tampler

@tampler I am able to reproduce the same issue on ubuntu22 https://download.cloudstack.org/testing/nightly/latest/debian/4.19/

weizhouapache avatar Nov 13 '23 18:11 weizhouapache

@tampler could you send us the full logs?

GutoVeronezi avatar Nov 13 '23 18:11 GutoVeronezi

Would this be enough? :thinking: Otherwise let me know. I'll restart the installation on my VM and provide larger logs BTW, I experience the same issue with 4.18.2.0 nightly.

tampler avatar Nov 13 '23 19:11 tampler

@tampler I have closed the PR #8229 which might be unnessary.

I fixed the issue by

  • install mysql-server
  • setup cloudstack database by cloudstack-setup-databases

weizhouapache avatar Nov 13 '23 19:11 weizhouapache

Would this be enough? 🤔 Otherwise let me know. I'll restart the installation on my VM and provide bigger logs BTW, I experience the same issue with 4.18.2.0 nightly.

The full logs would be necessary for this troubleshooting, as the message Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'DefaultConfigResources' available seems just an indication of a previous error.

GutoVeronezi avatar Nov 13 '23 19:11 GutoVeronezi

@tampler I have closed the PR #8229 which might be unnessary.

I fixed the issue by

* install mysql-server

* setup cloudstack database by `cloudstack-setup-databases`

You don't wanna have a local MySQL server for prod deployments

I use cloudstack-setup-databases cloud:cloud@mysql --deploy-as=root -i 192.168.0.20 following this working tutorial. It would be fair to reproduce following that article

tampler avatar Nov 13 '23 19:11 tampler

@tampler I have closed the PR #8229 which might be unnessary. I fixed the issue by

* install mysql-server

* setup cloudstack database by `cloudstack-setup-databases`

You don't wanna have a local MySQL server for prod deployments

I use cloudstack-setup-databases cloud:cloud@mysql --deploy-as=root -i 192.168.0.20 following this working tutorial. It would be fair to reproduce following that article

@tampler I guess the startup process might depend on some records in database, so we need to setup database correctly. The database can be local or remote, both are supported.

can you please setup a local/remote database and retry ?

weizhouapache avatar Nov 14 '23 07:11 weizhouapache

Hola Daniel @GutoVeronezi Pls check links below

setup db.properties agent.properties LOG setup-management LOG management-server

I managed to pass this thru on one occasion, but still have a trouble setting up my hypervisor. Pls let me know if you need more info

tampler avatar Nov 16 '23 13:11 tampler

Here the log clearly shows that it fails on creating a bean from a default resource at DefaultModuleDefinitionSet.java:151

2023-11-17 10:08:53,372 DEBUG [o.a.c.s.m.m.i.DefaultModuleDefinitionSet] (main:null) (logid:) Trying to obtain module [ca] context.
2023-11-17 10:08:53,372 DEBUG [o.a.c.s.m.m.i.DefaultModuleDefinitionSet] (main:null) (logid:) Trying to load module [ca] context.
2023-11-17 10:08:53,372 INFO  [o.a.c.s.m.m.i.DefaultModuleDefinitionSet] (main:null) (logid:) Loading module context [ca] from URL [jar:file:/usr/share/cloudstack-managemen>
2023-11-17 10:08:53,372 INFO  [o.a.c.s.m.m.i.DefaultModuleDefinitionSet] (main:null) (logid:) Loading module context [ca] from URL [jar:file:/usr/share/cloudstack-managemen>
2023-11-17 10:08:53,372 INFO  [o.a.c.s.m.m.i.DefaultModuleDefinitionSet] (main:null) (logid:) Loading module context [ca] from URL [jar:file:/usr/share/cloudstack-managemen>
2023-11-17 10:08:53,373 INFO  [o.a.c.s.m.m.i.DefaultModuleDefinitionSet] (main:null) (logid:) Loading module context [ca] from URL [jar:file:/usr/share/cloudstack-managemen>
2023-11-17 10:08:53,373 INFO  [o.a.c.s.m.m.i.DefaultModuleDefinitionSet] (main:null) (logid:) Loading module context [ca] from URL [jar:file:/usr/share/cloudstack-managemen>
2023-11-17 10:08:53,373 INFO  [o.a.c.s.m.m.i.DefaultModuleDefinitionSet] (main:null) (logid:) Loading module context [ca] from URL [jar:file:/usr/share/cloudstack-managemen>
2023-11-17 10:08:53,423 ERROR [o.a.c.s.m.m.i.DefaultModuleDefinitionSet] (main:null) (logid:) Failed to load module [ca] due to: [Error creating bean with name 'org.springf>
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.beans.factory.config.PropertyPlaceholderConfigurer#0' defined in>
  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:151)
  at org.apache.cloudstack.spring.module.model.impl.DefaultModuleDefinitionSet$2.with(DefaultModuleDefinitionSet.java:126)
  at org.apache.cloudstack.spring.module.model.impl.DefaultModuleDefinitionSet.withModule(DefaultModuleDefinitionSet.java:251)
  at org.apache.cloudstack.spring.module.model.impl.DefaultModuleDefinitionSet.withModule(DefaultModuleDefinitionSet.java:256)
  at org.apache.cloudstack.spring.module.model.impl.DefaultModuleDefinitionSet.withModule(DefaultModuleDefinitionSet.java:256)
  at org.apache.cloudstack.spring.module.model.impl.DefaultModuleDefinitionSet.withModule(DefaultModuleDefinitionSet.java:256)

tampler avatar Nov 17 '23 10:11 tampler

@tampler that stacktrace points to ancient code and can only mean that the spring xml files were not packaged correctly. Can you rebuild and try again? (also the log snippit in your last message is clipped instead of wrapped and does not reveal the full names of the bean and its location, maybe not relevant)

DaanHoogland avatar Nov 17 '23 10:11 DaanHoogland

@DaanHoogland Here's the last 1500 lines from my today's log :roll_eyes:

I did the following: :heavy_check_mark: Stop agent and mgmt services :heavy_check_mark: Drop cloud and cloud_usage db :heavy_check_mark: sudo cloudstack-setup-databases cloud:cloud@mysql --deploy-as=root and allow enough time to finish :heavy_check_mark: Enable mgmt service :heavy_check_mark: sudo cloudstack-setup-management

I use nightlies from Nov 13. Ok, I'll build my own debs and try again. Keep in touch! :100:

tampler avatar Nov 17 '23 10:11 tampler

I use nightlies from Nov 13. Ok, I'll build my own debs and try again. Keep in touch! 💯

in the original description you mention 4.19.0.0-snapshot.20231106, so you already tried two different builds right?

I did the following: ✔️ Stop agent and mgmt services ✔️ Drop cloud and cloud_usage db ✔️ sudo cloudstack-setup-databases cloud:cloud@mysql --deploy-as=root and allow enough time to finish ✔️ Enable mgmt service ✔️ sudo cloudstack-setup-management

In that case maybe some cleanup not done may be the issue? Did you ever follow this procedure successfully?

How about removing and reinstalling the packages, does that give a different result?

DaanHoogland avatar Nov 17 '23 11:11 DaanHoogland

I use nightlies from Nov 13. Ok, I'll build my own debs and try again. Keep in touch! 💯

in the original description you mention 4.19.0.0-snapshot.20231106, so you already tried two different builds right?

Yes, bumped nightlies 2 days ago. The result is the same

I did the following: ✔️ Stop agent and mgmt services ✔️ Drop cloud and cloud_usage db ✔️ sudo cloudstack-setup-databases cloud:cloud@mysql --deploy-as=root and allow enough time to finish ✔️ Enable mgmt service ✔️ sudo cloudstack-setup-management In that case maybe some cleanup not done may be the issue? Did you ever follow this procedure successfully? How about removing and reinstalling the packages, does that give a different result?

Yes, I was poking on a KVM VM and managed to somehow set things up. Than I had a KVM-SSD crash with a DMA issue inside my SSD firmware trying to setup Linstor with a LVM-over-LVM setup for ACS.

I have an Ansible role and using this for my setup

tampler avatar Nov 17 '23 11:11 tampler

Hola Daniel @GutoVeronezi Pls check links below

setup db.properties agent.properties LOG setup-management LOG management-server

I managed to pass this thru on one occasion, but still have a trouble setting up my hypervisor. Pls let me know if you need more info

Hello @tampler

In the bootstrap of the MS, it prints that it could not create a connection to the database server:

2023-11-15 14:36:10,586 ERROR [c.c.u.d.Merovingian2] (main:null) (logid:) Unable to get a new db connection
java.sql.SQLNonTransientConnectionException: Could not create connection to database server. Attempted reconnect 3 times. Giving up.
2023-11-16 12:11:18,067 ERROR [c.c.u.d.Merovingian2] (main:null) (logid:) Unable to get a new db connection
java.sql.SQLNonTransientConnectionException: Could not create connection to database server. Attempted reconnect 3 times. Giving up.

Because of that, it fails to load the subsequent modules, printing the message Failed to load module several times. Can you re-check the DB credentials and configurations?

GutoVeronezi avatar Nov 17 '23 11:11 GutoVeronezi

Now trying to have my own build. Figuring out how to compile and build debs on my own. I did that in the begging of 2023

> mvn --version                                                                                     
Apache Maven 3.9.5 (57804ffe001d7215b5e7bcb531cf83df38f93546)
Maven home: /opt/apache-maven-3.9.5
Java version: 21.0.1, vendor: Oracle Corporation, runtime: /opt/jdk-21.0.1
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "5.15.0-78-generic", arch: "amd64", family: "unix"

> java -version   
openjdk version "21.0.1" 2023-10-17
OpenJDK Runtime Environment (build 21.0.1+12-29)
OpenJDK 64-Bit Server VM (build 21.0.1+12-29, mixed mode, sharing)

I checked out the latest main and run this: mvn -DskipTests -Pdeveloper,systemvm clean install Here's what I have:

[INFO] Apache CloudStack DevCloud-KVM ..................... SKIPPED
[INFO] ------------------------------------------------------------------------ 
[INFO] BUILD FAILURE               
[INFO] ------------------------------------------------------------------------                                                                                              
[INFO] Total time:  01:23 min
[INFO] Finished at: 2023-11-17T14:36:37+03:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project cloud-api: Compilation failure: Compilation failure:
  
[ERROR] /hdd/cloud/acs/cloudstack/api/src/main/java/com/cloud/agent/api/storage/OVFHelper.java:[378,8] error: cannot find symbol
[ERROR]   symbol:   class DocumentBuilderFactory
[ERROR]   location: class OVFHelper
[ERROR] /hdd/cloud/acs/cloudstack/api/src/main/java/com/cloud/agent/api/storage/OVFHelper.java:[378,56] error: cannot find symbol
[ERROR]   symbol:   variable DocumentBuilderFactory
[ERROR]   location: class OVFHelper
[ERROR] /hdd/cloud/acs/cloudstack/api/src/main/java/com/cloud/agent/api/storage/OVFHelper.java:[380,12] error: cannot find symbol
[ERROR]   symbol:   class DocumentBuilder
[ERROR]   location: class OVFHelper
[ERROR] /hdd/cloud/acs/cloudstack/api/src/main/java/com/cloud/agent/api/storage/OVFHelper.java:[382,46] error: cannot find symbol
[ERROR]   symbol:   class ParserConfigurationException
[ERROR]   location: class OVFHelper
[ERROR] -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.

tampler avatar Nov 17 '23 11:11 tampler