eclipse-sw360 / sw360

SW360 project
https://www.eclipse.org/sw360/
Other
121 stars 98 forks source link

Multiple unhelpful exceptions with docker deployment 18.0.0 #2240

Closed thetredev closed 9 months ago

thetredev commented 10 months ago

Description

I've followed the Docker deployment guide at https://github.com/eclipse-sw360/sw360/blob/main/README_DOCKER.md. But instead of building my own image, I wanted to use the docker-compose.yml (this one) as a template.

I stumbled upon my first problem here, which is that you can't pull the image ghcr.io/eclipse-sw360/sw360:latest:

$ docker pull ghcr.io/eclipse-sw360/sw360:latest
latest: Pulling from eclipse-sw360/sw360
manifest unknown

Since the tag latest is the same as 18.0.0, I tried that afterwards to no avail:

$ docker pull ghcr.io/eclipse-sw360/sw360:18.0.0
18.0.0: Pulling from eclipse-sw360/sw360
manifest unknown

So I thought: the latest stable release is 17.0.0 as per the GitHub releases page, let's grab the 17.0.0 image. But that image doesn't even exist on ghcr.io (https://github.com/eclipse-sw360/sw360/pkgs/container/sw360/versions?filters%5Bversion_type%5D=tagged).

I do not want to build the image myself, because updating/maintaining the application would be not as trivial as "updating the image and fixing database migrations", like it should be.

So I ended up trying the nightly image (ghcr.io/eclipse-sw360/sw360:18.0.0-SNAPSHOT) with the following directory structure:

/path/to/docker-compose/deployment
├── config
│   ├── app
│   │   ├── couchdb-lucene.ini
│   │   └── portal-ext.properties
│   └── etc
│       ├── authorization
│       │   └── application.yml
│       ├── couchdb.properties
│       ├── log4j2.xml
│       ├── rest
│       │   └── application.yml
│       └── sw360.properties
├── docker-compose.yml

But I get some unhelpful/unclear exceptions when running docker compose up:

sw360_application  | 13-Dec-2023 14:01:58.730 INFO [main] com.cloudant.http.HttpConnection.execute Maximum number of retries reached
sw360_application  | 2023-12-13 14:01:58 WARN  AnnotationConfigWebApplicationContext:591 - Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'fossologyServlet' defined in URL [jar:file:/app/sw360/tomcat-9.0.56/shared/src-fossology-18.0.0-SNAPSHOT.jar!/org/eclipse/sw360/fossology/FossologyServlet.class]: Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'fossologyHandler' defined in URL [jar:file:/app/sw360/tomcat-9.0.56/shared/src-fossology-18.0.0-SNAPSHOT.jar!/org/eclipse/sw360/fossology/FossologyHandler.class]: Unsatisfied dependency expressed through constructor parameter 1; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'fossologyRestConfig' defined in URL [jar:file:/app/sw360/tomcat-9.0.56/shared/src-fossology-18.0.0-SNAPSHOT.jar!/org/eclipse/sw360/fossology/config/FossologyRestConfig.class]: Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'configContainerRepository' defined in org.eclipse.sw360.fossology.config.FossologyConfig: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.eclipse.sw360.datahandler.db.ConfigContainerRepository]: Factory method 'configContainerRepository' threw exception; nested exception is com.cloudant.client.org.lightcouch.CouchDbException: Error retrieving server response at http://sw360_couchdb:5984/_all_dbs.

Which doesn't make sense to me at all. The configContainerRepository one seems to be a configuration mistake on my side, but when I do the following couchdb is reachable, so I have no idea what to do:

$ docker exec -it sw360_application bash
sw360@364860d9cb3f:/app/sw360$ curl http://admin:password@sw360_couchdb:5984/_all_dbs
["_global_changes","_replicator","_users","sw360db","sw360oauthclients","sw360vm"]

The fossologyServlet one seems like it's an issue with the application code, because it tries to construct an object but can't because of some "Unsatisfied dependency expressed through constructor parameter 0". In my opinion the Docker image should contain all dependencies necessary to start the application.

How to reproduce

See the repository at https://github.com/thetredev/sw360-docker-issue-2240/tree/a399c58b70d03eb074f5431d39ab48c5df56f2a2.

$ git clone -b a399c58b70d03eb074f5431d39ab48c5df56f2a2 https://github.com/thetredev/sw360-docker-issue-2240.git
$ cd sw360-docker-issue-2240
$ docker compose up

Versions

Docker host:

$ cat /etc/os-release
PRETTY_NAME="Debian GNU/Linux 12 (bookworm)"
NAME="Debian GNU/Linux"
VERSION_ID="12"
VERSION="12 (bookworm)"
VERSION_CODENAME=bookworm
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"

Docker version:

$ docker version
Client: Docker Engine - Community
 Version:           24.0.5
 API version:       1.43
 Go version:        go1.20.6
 Git commit:        ced0996
 Built:             Fri Jul 21 20:35:35 2023
 OS/Arch:           linux/amd64
 Context:           default

Server: Docker Engine - Community
 Engine:
  Version:          24.0.5
  API version:      1.43 (minimum version 1.12)
  Go version:       go1.20.6
  Git commit:       a61e2b4
  Built:            Fri Jul 21 20:35:35 2023
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.6.22
  GitCommit:        8165feabfdfe38c65b599c4993d227328c231fca
 runc:
  Version:          1.1.8
  GitCommit:        v1.1.8-0-g82f18fe
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0

Docker compose version:

$ docker compose version
Docker Compose version v2.20.2

Logs

logs.txt

Thank you for your help!

KoukiHama commented 10 months ago

@heliocastro could you check it?

thetredev commented 10 months ago

I labelled it as bug because I believe it's a bug that the latest image can't be pulled even though GHCR shows it.

heliocastro commented 10 months ago

I'm a little busy this week due end of year ( as usual ), but next week i promise to look better and cleanup all this things. Many thanks for the detailed input

thetredev commented 10 months ago

I edited the description and linked a repository so you can more easily reproduce the issue.

heliocastro commented 10 months ago

@thetredev I found the bug and fixed it on the referred commit. I confirmed that we can pull it now. Not closing this one yet as I need a few things to check ahead. Would you please check this one if possible ?

thetredev commented 10 months ago

@heliocastro Thank you very much! I can successfully pull the latest image now and it is the same as tag 18.0.0. I'll see if I can get the server up and running with it.

thetredev commented 10 months ago

Sadly no. The exceptions are still the same (see below). This FossolygyConfig thing might be the issue here. I have no idea what Fossology is and if I need that as a separate deployment. In the docs at https://github.com/eclipse-sw360/sw360/blob/main/README_DOCKER.md#fossology it reads like it's more of a recommendation after a successful install of sw360 (when you can reach the web interface).

I updated my GitHub repository to reflect the stable image: https://github.com/thetredev/sw360-docker-issue-2240/tree/a399c58b70d03eb074f5431d39ab48c5df56f2a2

Exceptions:

sw360_application  | 2023-12-19 11:02:37 WARN  AnnotationConfigWebApplicationContext:591 - Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'fossologyRestConfig' defined in URL [jar:file:/app/sw360/tomcat-9.0.56/shared/src-fossology-18.0.0.jar!/org/eclipse/sw360/fossology/config/FossologyRestConfig.class]: Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'configContainerRepository' defined in org.eclipse.sw360.fossology.config.FossologyConfig: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.eclipse.sw360.datahandler.db.ConfigContainerRepository]: Factory method 'configContainerRepository' threw exception; nested exception is com.cloudant.client.org.lightcouch.CouchDbException: Error retrieving server response at http://sw360_couchdb:5984/_all_dbs.
sw360_application  | 2023-12-19 11:02:37 ERROR ContextLoader:299 - Context initialization failed
sw360_application  | org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'fossologyRestConfig' defined in URL [jar:file:/app/sw360/tomcat-9.0.56/shared/src-fossology-18.0.0.jar!/org/eclipse/sw360/fossology/config/FossologyRestConfig.class]: Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'configContainerRepository' defined in org.eclipse.sw360.fossology.config.FossologyConfig: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.eclipse.sw360.datahandler.db.ConfigContainerRepository]: Factory method 'configContainerRepository' threw exception; nested exception is com.cloudant.client.org.lightcouch.CouchDbException: Error retrieving server response at http://sw360_couchdb:5984/_all_dbs.
sw360_application  |    at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:800) ~[spring-beans-5.3.27.jar:5.3.27]
sw360_application  |    at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:229) ~[spring-beans-5.3.27.jar:5.3.27]
sw360_application  |    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1372) ~[spring-beans-5.3.27.jar:5.3.27]
sw360_application  |    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1222) ~[spring-beans-5.3.27.jar:5.3.27]
sw360_application  |    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:582) ~[spring-beans-5.3.27.jar:5.3.27]
sw360_application  |    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542) ~[spring-beans-5.3.27.jar:5.3.27]
sw360_application  |    at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335) ~[spring-beans-5.3.27.jar:5.3.27]
sw360_application  |    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[spring-beans-5.3.27.jar:5.3.27]
sw360_application  |    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333) ~[spring-beans-5.3.27.jar:5.3.27]
sw360_application  |    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208) ~[spring-beans-5.3.27.jar:5.3.27]
sw360_application  |    at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:955) ~[spring-beans-5.3.27.jar:5.3.27]
sw360_application  |    at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:920) ~[spring-context-5.3.27.jar:5.3.27]
sw360_application  |    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:583) ~[spring-context-5.3.27.jar:5.3.27]
sw360_application  |    at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:399) ~[spring-web-5.3.27.jar:5.3.27]
sw360_application  |    at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:278) ~[spring-web-5.3.27.jar:5.3.27]
sw360_application  |    at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:103) ~[spring-web-5.3.27.jar:5.3.27]
sw360_application  |    at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4768) ~[catalina.jar:9.0.56]
sw360_application  |    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5230) ~[catalina.jar:9.0.56]
sw360_application  |    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) ~[catalina.jar:9.0.56]
sw360_application  |    at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:726) ~[catalina.jar:9.0.56]
sw360_application  |    at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:698) ~[catalina.jar:9.0.56]
sw360_application  |    at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:696) ~[catalina.jar:9.0.56]
sw360_application  |    at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:1024) ~[catalina.jar:9.0.56]
sw360_application  |    at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1911) ~[catalina.jar:9.0.56]
sw360_application  |    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539) ~[?:?]
sw360_application  |    at java.util.concurrent.FutureTask.run(FutureTask.java:264) ~[?:?]
sw360_application  |    at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75) ~[tomcat-util.jar:9.0.56]
sw360_application  |    at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:123) ~[?:?]
sw360_application  |    at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:825) ~[catalina.jar:9.0.56]
sw360_application  |    at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:475) ~[catalina.jar:9.0.56]
sw360_application  |    at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1618) ~[catalina.jar:9.0.56]
sw360_application  |    at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:319) ~[catalina.jar:9.0.56]
sw360_application  |    at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:123) ~[catalina.jar:9.0.56]
sw360_application  |    at org.apache.catalina.util.LifecycleBase.setStateInternal(LifecycleBase.java:423) ~[catalina.jar:9.0.56]
sw360_application  |    at org.apache.catalina.util.LifecycleBase.setState(LifecycleBase.java:366) ~[catalina.jar:9.0.56]
sw360_application  |    at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:946) ~[catalina.jar:9.0.56]
sw360_application  |    at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:835) ~[catalina.jar:9.0.56]
sw360_application  |    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) ~[catalina.jar:9.0.56]
sw360_application  |    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1396) ~[catalina.jar:9.0.56]
sw360_application  |    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1386) ~[catalina.jar:9.0.56]
sw360_application  |    at java.util.concurrent.FutureTask.run(FutureTask.java:264) ~[?:?]
sw360_application  |    at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75) ~[tomcat-util.jar:9.0.56]
sw360_application  |    at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:145) ~[?:?]
sw360_application  |    at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:919) ~[catalina.jar:9.0.56]
sw360_application  |    at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:263) ~[catalina.jar:9.0.56]
sw360_application  |    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) ~[catalina.jar:9.0.56]
sw360_application  |    at org.apache.catalina.core.StandardService.startInternal(StandardService.java:432) ~[catalina.jar:9.0.56]
sw360_application  |    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) ~[catalina.jar:9.0.56]
sw360_application  |    at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:927) ~[catalina.jar:9.0.56]
sw360_application  |    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) ~[catalina.jar:9.0.56]
sw360_application  |    at org.apache.catalina.startup.Catalina.start(Catalina.java:772) ~[catalina.jar:9.0.56]
sw360_application  |    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
sw360_application  |    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[?:?]
sw360_application  |    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
sw360_application  |    at java.lang.reflect.Method.invoke(Method.java:568) ~[?:?]
sw360_application  |    at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:345) ~[bootstrap.jar:9.0.56]
sw360_application  |    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:476) ~[bootstrap.jar:9.0.56]
sw360_application  | Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'configContainerRepository' defined in org.eclipse.sw360.fossology.config.FossologyConfig: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.eclipse.sw360.datahandler.db.ConfigContainerRepository]: Factory method 'configContainerRepository' threw exception; nested exception is com.cloudant.client.org.lightcouch.CouchDbException: Error retrieving server response at http://sw360_couchdb:5984/_all_dbs.
sw360_application  |    at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:658) ~[spring-beans-5.3.27.jar:5.3.27]
sw360_application  |    at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:486) ~[spring-beans-5.3.27.jar:5.3.27]
sw360_application  |    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1352) ~[spring-beans-5.3.27.jar:5.3.27]
sw360_application  |    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1195) ~[spring-beans-5.3.27.jar:5.3.27]
sw360_application  |    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:582) ~[spring-beans-5.3.27.jar:5.3.27]
sw360_application  |    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542) ~[spring-beans-5.3.27.jar:5.3.27]
sw360_application  |    at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335) ~[spring-beans-5.3.27.jar:5.3.27]
sw360_application  |    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[spring-beans-5.3.27.jar:5.3.27]
sw360_application  |    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333) ~[spring-beans-5.3.27.jar:5.3.27]
sw360_application  |    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208) ~[spring-beans-5.3.27.jar:5.3.27]
sw360_application  |    at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:276) ~[spring-beans-5.3.27.jar:5.3.27]
sw360_application  |    at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1391) ~[spring-beans-5.3.27.jar:5.3.27]
sw360_application  |    at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1311) ~[spring-beans-5.3.27.jar:5.3.27]
sw360_application  |    at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:887) ~[spring-beans-5.3.27.jar:5.3.27]
sw360_application  |    at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:791) ~[spring-beans-5.3.27.jar:5.3.27]
sw360_application  |    ... 56 more
sw360_application  | Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.eclipse.sw360.datahandler.db.ConfigContainerRepository]: Factory method 'configContainerRepository' threw exception; nested exception is com.cloudant.client.org.lightcouch.CouchDbException: Error retrieving server response at http://sw360_couchdb:5984/_all_dbs.
sw360_application  |    at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:185) ~[spring-beans-5.3.27.jar:5.3.27]
sw360_application  |    at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:653) ~[spring-beans-5.3.27.jar:5.3.27]
sw360_application  |    at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:486) ~[spring-beans-5.3.27.jar:5.3.27]
sw360_application  |    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1352) ~[spring-beans-5.3.27.jar:5.3.27]
sw360_application  |    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1195) ~[spring-beans-5.3.27.jar:5.3.27]
sw360_application  |    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:582) ~[spring-beans-5.3.27.jar:5.3.27]
sw360_application  |    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542) ~[spring-beans-5.3.27.jar:5.3.27]
sw360_application  |    at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335) ~[spring-beans-5.3.27.jar:5.3.27]
sw360_application  |    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[spring-beans-5.3.27.jar:5.3.27]
sw360_application  |    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333) ~[spring-beans-5.3.27.jar:5.3.27]
sw360_application  |    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208) ~[spring-beans-5.3.27.jar:5.3.27]
sw360_application  |    at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:276) ~[spring-beans-5.3.27.jar:5.3.27]
sw360_application  |    at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1391) ~[spring-beans-5.3.27.jar:5.3.27]
sw360_application  |    at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1311) ~[spring-beans-5.3.27.jar:5.3.27]
sw360_application  |    at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:887) ~[spring-beans-5.3.27.jar:5.3.27]
sw360_application  |    at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:791) ~[spring-beans-5.3.27.jar:5.3.27]
sw360_application  |    ... 56 more
sw360_application  | Caused by: com.cloudant.client.org.lightcouch.CouchDbException: Error retrieving server response at http://sw360_couchdb:5984/_all_dbs.
sw360_application  |    at com.cloudant.client.org.lightcouch.CouchDbClient.execute(CouchDbClient.java:632) ~[datahandler-18.0.0.jar:?]
sw360_application  |    at com.cloudant.client.org.lightcouch.CouchDbClient.executeToInputStream(CouchDbClient.java:648) ~[datahandler-18.0.0.jar:?]
sw360_application  |    at com.cloudant.client.org.lightcouch.CouchDbClient.get(CouchDbClient.java:389) ~[datahandler-18.0.0.jar:?]
sw360_application  |    at com.cloudant.client.org.lightcouch.CouchDbClient.getAllDbs(CouchDbClient.java:243) ~[datahandler-18.0.0.jar:?]
sw360_application  |    at com.cloudant.client.api.CloudantClient.getAllDbs(CloudantClient.java:292) ~[datahandler-18.0.0.jar:?]
sw360_application  |    at org.eclipse.sw360.datahandler.cloudantclient.DatabaseInstanceCloudant.checkIfDbExists(DatabaseInstanceCloudant.java:37) ~[datahandler-18.0.0.jar:?]
sw360_application  |    at org.eclipse.sw360.datahandler.cloudantclient.DatabaseInstanceCloudant.createDB(DatabaseInstanceCloudant.java:33) ~[datahandler-18.0.0.jar:?]
sw360_application  |    at org.eclipse.sw360.datahandler.cloudantclient.DatabaseConnectorCloudant.<init>(DatabaseConnectorCloudant.java:68) ~[datahandler-18.0.0.jar:?]
sw360_application  |    at org.eclipse.sw360.fossology.config.FossologyConfig.configContainerRepository(FossologyConfig.java:41) ~[src-fossology-18.0.0.jar:?]
sw360_application  |    at org.eclipse.sw360.fossology.config.FossologyConfig$$EnhancerBySpringCGLIB$$d4166c27.CGLIB$configContainerRepository$4(<generated>) ~[src-fossology-18.0.0.jar:?]
sw360_application  |    at org.eclipse.sw360.fossology.config.FossologyConfig$$EnhancerBySpringCGLIB$$d4166c27$$FastClassBySpringCGLIB$$c7301fe6.invoke(<generated>) ~[src-fossology-18.0.0.jar:?]
sw360_application  |    at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:244) ~[spring-core-5.3.27.jar:5.3.27]
sw360_application  |    at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:331) ~[spring-context-5.3.27.jar:5.3.27]
sw360_application  |    at org.eclipse.sw360.fossology.config.FossologyConfig$$EnhancerBySpringCGLIB$$d4166c27.configContainerRepository(<generated>) ~[src-fossology-18.0.0.jar:?]
sw360_application  |    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
sw360_application  |    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[?:?]
sw360_application  |    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
sw360_application  |    at java.lang.reflect.Method.invoke(Method.java:568) ~[?:?]
sw360_application  |    at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:154) ~[spring-beans-5.3.27.jar:5.3.27]
sw360_application  |    at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:653) ~[spring-beans-5.3.27.jar:5.3.27]
sw360_application  |    at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:486) ~[spring-beans-5.3.27.jar:5.3.27]
sw360_application  |    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1352) ~[spring-beans-5.3.27.jar:5.3.27]
sw360_application  |    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1195) ~[spring-beans-5.3.27.jar:5.3.27]
sw360_application  |    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:582) ~[spring-beans-5.3.27.jar:5.3.27]
sw360_application  |    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542) ~[spring-beans-5.3.27.jar:5.3.27]
sw360_application  |    at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335) ~[spring-beans-5.3.27.jar:5.3.27]
sw360_application  |    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[spring-beans-5.3.27.jar:5.3.27]
sw360_application  |    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333) ~[spring-beans-5.3.27.jar:5.3.27]
sw360_application  |    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208) ~[spring-beans-5.3.27.jar:5.3.27]
sw360_application  |    at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:276) ~[spring-beans-5.3.27.jar:5.3.27]
sw360_application  |    at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1391) ~[spring-beans-5.3.27.jar:5.3.27]
sw360_application  |    at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1311) ~[spring-beans-5.3.27.jar:5.3.27]
sw360_application  |    at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:887) ~[spring-beans-5.3.27.jar:5.3.27]
sw360_application  |    at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:791) ~[spring-beans-5.3.27.jar:5.3.27]
sw360_application  |    ... 56 more
sw360_application  | Caused by: java.io.IOException: stream is closed
sw360_application  |    at sun.net.www.protocol.http.HttpURLConnection$HttpInputStream.ensureOpen(HttpURLConnection.java:3671) ~[?:?]
sw360_application  |    at sun.net.www.protocol.http.HttpURLConnection$HttpInputStream.read(HttpURLConnection.java:3696) ~[?:?]
sw360_application  |    at sun.net.www.protocol.http.HttpURLConnection$HttpInputStream.read(HttpURLConnection.java:3691) ~[?:?]
sw360_application  |    at org.apache.commons.io.IOUtils.copyLarge(IOUtils.java:1309) ~[commons-io-2.11.0.jar:2.11.0]
sw360_application  |    at org.apache.commons.io.IOUtils.copy(IOUtils.java:978) ~[commons-io-2.11.0.jar:2.11.0]
sw360_application  |    at org.apache.commons.io.IOUtils.copyLarge(IOUtils.java:1282) ~[commons-io-2.11.0.jar:2.11.0]
sw360_application  |    at org.apache.commons.io.IOUtils.copy(IOUtils.java:953) ~[commons-io-2.11.0.jar:2.11.0]
sw360_application  |    at org.apache.commons.io.IOUtils.toByteArray(IOUtils.java:2405) ~[commons-io-2.11.0.jar:2.11.0]
sw360_application  |    at com.cloudant.client.org.lightcouch.CouchDbClient.execute(CouchDbClient.java:605) ~[datahandler-18.0.0.jar:?]
sw360_application  |    at com.cloudant.client.org.lightcouch.CouchDbClient.executeToInputStream(CouchDbClient.java:648) ~[datahandler-18.0.0.jar:?]
sw360_application  |    at com.cloudant.client.org.lightcouch.CouchDbClient.get(CouchDbClient.java:389) ~[datahandler-18.0.0.jar:?]
sw360_application  |    at com.cloudant.client.org.lightcouch.CouchDbClient.getAllDbs(CouchDbClient.java:243) ~[datahandler-18.0.0.jar:?]
sw360_application  |    at com.cloudant.client.api.CloudantClient.getAllDbs(CloudantClient.java:292) ~[datahandler-18.0.0.jar:?]
sw360_application  |    at org.eclipse.sw360.datahandler.cloudantclient.DatabaseInstanceCloudant.checkIfDbExists(DatabaseInstanceCloudant.java:37) ~[datahandler-18.0.0.jar:?]
sw360_application  |    at org.eclipse.sw360.datahandler.cloudantclient.DatabaseInstanceCloudant.createDB(DatabaseInstanceCloudant.java:33) ~[datahandler-18.0.0.jar:?]
sw360_application  |    at org.eclipse.sw360.datahandler.cloudantclient.DatabaseConnectorCloudant.<init>(DatabaseConnectorCloudant.java:68) ~[datahandler-18.0.0.jar:?]
sw360_application  |    at org.eclipse.sw360.fossology.config.FossologyConfig.configContainerRepository(FossologyConfig.java:41) ~[src-fossology-18.0.0.jar:?]
sw360_application  |    at org.eclipse.sw360.fossology.config.FossologyConfig$$EnhancerBySpringCGLIB$$d4166c27.CGLIB$configContainerRepository$4(<generated>) ~[src-fossology-18.0.0.jar:?]
sw360_application  |    at org.eclipse.sw360.fossology.config.FossologyConfig$$EnhancerBySpringCGLIB$$d4166c27$$FastClassBySpringCGLIB$$c7301fe6.invoke(<generated>) ~[src-fossology-18.0.0.jar:?]
sw360_application  |    at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:244) ~[spring-core-5.3.27.jar:5.3.27]
sw360_application  |    at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:331) ~[spring-context-5.3.27.jar:5.3.27]
sw360_application  |    at org.eclipse.sw360.fossology.config.FossologyConfig$$EnhancerBySpringCGLIB$$d4166c27.configContainerRepository(<generated>) ~[src-fossology-18.0.0.jar:?]
sw360_application  |    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
sw360_application  |    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[?:?]
sw360_application  |    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
sw360_application  |    at java.lang.reflect.Method.invoke(Method.java:568) ~[?:?]
sw360_application  |    at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:154) ~[spring-beans-5.3.27.jar:5.3.27]
sw360_application  |    at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:653) ~[spring-beans-5.3.27.jar:5.3.27]
sw360_application  |    at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:486) ~[spring-beans-5.3.27.jar:5.3.27]
sw360_application  |    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1352) ~[spring-beans-5.3.27.jar:5.3.27]
sw360_application  |    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1195) ~[spring-beans-5.3.27.jar:5.3.27]
sw360_application  |    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:582) ~[spring-beans-5.3.27.jar:5.3.27]
sw360_application  |    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542) ~[spring-beans-5.3.27.jar:5.3.27]
sw360_application  |    at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335) ~[spring-beans-5.3.27.jar:5.3.27]
sw360_application  |    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[spring-beans-5.3.27.jar:5.3.27]
sw360_application  |    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333) ~[spring-beans-5.3.27.jar:5.3.27]
sw360_application  |    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208) ~[spring-beans-5.3.27.jar:5.3.27]
sw360_application  |    at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:276) ~[spring-beans-5.3.27.jar:5.3.27]
sw360_application  |    at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1391) ~[spring-beans-5.3.27.jar:5.3.27]
sw360_application  |    at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1311) ~[spring-beans-5.3.27.jar:5.3.27]
sw360_application  |    at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:887) ~[spring-beans-5.3.27.jar:5.3.27]
sw360_application  |    at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:791) ~[spring-beans-5.3.27.jar:5.3.27]
sw360_application  |    ... 56 more
sw360_application  | 19-Dec-2023 11:02:37.214 SEVERE [main] org.apache.catalina.core.StandardContext.startInternal One or more listeners failed to start. Full details will be found in the appropriate container log file
sw360_application  | 19-Dec-2023 11:02:37.215 SEVERE [main] org.apache.catalina.core.StandardContext.startInternal Context [/fossology] startup failed due to previous errors
sw360_application  | 19-Dec-2023 11:02:37.219 WARNING [main] org.apache.catalina.loader.WebappClassLoaderBase.clearReferencesObjectStreamClassCaches Failed to clear soft references from ObjectStreamClass$Caches for web application [fossology]
sw360_application  |    java.lang.ClassCastException: class java.io.ObjectStreamClass$Caches$1 cannot be cast to class java.util.Map (java.io.ObjectStreamClass$Caches$1 and java.util.Map are in module java.base of loader 'bootstrap')
sw360_application  |            at org.apache.catalina.loader.WebappClassLoaderBase.clearCache(WebappClassLoaderBase.java:2325)
sw360_application  |            at org.apache.catalina.loader.WebappClassLoaderBase.clearReferencesObjectStreamClassCaches(WebappClassLoaderBase.java:2300)
sw360_application  |            at org.apache.catalina.loader.WebappClassLoaderBase.clearReferences(WebappClassLoaderBase.java:1669)
sw360_application  |            at org.apache.catalina.loader.WebappClassLoaderBase.stop(WebappClassLoaderBase.java:1597)
sw360_application  |            at org.apache.catalina.loader.WebappLoader.stopInternal(WebappLoader.java:463)
sw360_application  |            at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:257)
sw360_application  |            at org.apache.catalina.core.StandardContext.stopInternal(StandardContext.java:5515)
sw360_application  |            at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:257)
sw360_application  |            at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:187)
sw360_application  |            at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:726)
sw360_application  |            at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:698)
sw360_application  |            at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:696)
sw360_application  |            at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:1024)
sw360_application  |            at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1911)
sw360_application  |            at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
sw360_application  |            at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
sw360_application  |            at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
sw360_application  |            at java.base/java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:123)
sw360_application  |            at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:825)
sw360_application  |            at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:475)
sw360_application  |            at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1618)
sw360_application  |            at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:319)
sw360_application  |            at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:123)
sw360_application  |            at org.apache.catalina.util.LifecycleBase.setStateInternal(LifecycleBase.java:423)
sw360_application  |            at org.apache.catalina.util.LifecycleBase.setState(LifecycleBase.java:366)
sw360_application  |            at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:946)
sw360_application  |            at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:835)
sw360_application  |            at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
sw360_application  |            at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1396)
sw360_application  |            at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1386)
sw360_application  |            at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
sw360_application  |            at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
sw360_application  |            at java.base/java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:145)
sw360_application  |            at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:919)
sw360_application  |            at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:263)
sw360_application  |            at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
sw360_application  |            at org.apache.catalina.core.StandardService.startInternal(StandardService.java:432)
sw360_application  |            at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
sw360_application  |            at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:927)
sw360_application  |            at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
sw360_application  |            at org.apache.catalina.startup.Catalina.start(Catalina.java:772)
sw360_application  |            at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sw360_application  |            at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
sw360_application  |            at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
sw360_application  |            at java.base/java.lang.reflect.Method.invoke(Method.java:568)
sw360_application  |            at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:345)
sw360_application  |            at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:476)
sw360_application  | #
sw360_application  | # Copyright Siemens AG, 2017. Part of the SW360 Portal Project.
sw360_application  | #
sw360_application  | # This program and the accompanying materials are made
sw360_application  | # available under the terms of the Eclipse Public License 2.0
sw360_application  | # which is available at https://www.eclipse.org/legal/epl-2.0/
sw360_application  | #
sw360_application  | # SPDX-License-Identifier: EPL-2.0
sw360_application  | #
sw360_application  | 
sw360_application  |                 ________   _______________
sw360_application  |   ________  _  _\_____  \ /  _____/\   _  \
sw360_application  |  /  ___/\ \/ \/ / _(__  </   __  \ /  /_\  \
sw360_application  |  \___ \  \     / /       \  |__\  \\  \_/   \
sw360_application  | /____  >  \/\_/ /______  /\_____  / \_____  /
sw360_application  |      \/                \/       \/        \/
sw360_application  | :: sw360 Resource Server :: Running Spring Boot 2.7.6 ::
sw360_application  | 
sw360_application  | 2023-12-19 11:02:37 INFO  Sw360ResourceServer:55 - Starting Sw360ResourceServer using Java 17.0.9 on f4d9a33019b6 with PID 29 (/app/sw360/tomcat-9.0.56/webapps/resource/WEB-INF/classes started by sw360 in /app/sw360/tomcat-9.0.56/bin)
sw360_application  | 2023-12-19 11:02:37 INFO  Sw360ResourceServer:631 - No active profile set, falling back to 1 default profile: "default"
heliocastro commented 10 months ago

@thetredev Fossology is optional and is an independent application. So, if the fossology portlet is not starting correctly, and the log shows clearly, it means that:

1 - You tried to configure fossology without having it installed correctly ( https://www.fossology.org/ ), and maybe the instructions for fossolofy are not entirely complete after recent changes 2 - The misbehaving fossology portlet must be fixed, but it should not interfere with the sw360 operation.

I'm picking up your branch and verifying if sw360 is behaving correctly. If yes, I will close down this bug and will ask to open another one to fossology if that is the case (I will test it as well )

thetredev commented 10 months ago

@heliocastro thanks! Maybe I misconfigured something.

heliocastro commented 10 months ago

Hey @thetredev Several things could be improved on your compose file. Number one is the fact you don't have a shared network between the containers, mostly this part:

networks:
   default:
      name: sw360net

This, and added the fact you explicitly replaced the name of the containers, so the reference is not internal anymore; this reflects on the very initial flaw on the logs:

sw360_couchdb      | [info] 2023-12-19T20:21:41.550384Z nonode@nohost <0.375.0> -------- Apache CouchDB has started on http://any:5984/
sw360_couchdb      | [notice] 2023-12-19T20:21:41.558772Z nonode@nohost <0.398.0> -------- chttpd_auth_cache changes listener died because the _users database does not exist. Create the database to silence this notice.
sw360_couchdb      | [error] 2023-12-19T20:21:41.558810Z nonode@nohost emulator -------- Error in process <0.399.0> with exit value:
sw360_couchdb      | {database_does_not_exist,[{mem3_shards,load_shards_from_db,[<<"_users">>],[{file,"src/mem3_shards.erl"},{line,430}]},{mem3_shards,load_shards_from_disk,1,[{file,"src/mem3_shards.erl"},{line,405}]},{mem3_shards,load_shards_from_disk,2,[{file,"src/mem3_shards.erl"},{line,434}]},{mem3_shards,for_docid,3,[{file,"src/mem3_shards.erl"},{line,100}]},{fabric_doc_open,go,3,[{file,"src/fabric_doc_open.erl"},{line,39}]},{chttpd_auth_cache,ensure_auth_ddoc_exists,2,[{file,"src/chttpd_auth_cache.erl"},{line,214}]},{chttpd_auth_cache,listen_for_changes,1,[{file,"src/chttpd_auth_cache.erl"},{line,160}]}]}

The entire system will fail since the couchdb connection failed at the very start. It would be best if you revised your compose file.

thetredev commented 10 months ago

Docker compose creates a default network for the deployment, so the network definition isn't necessary. As I displayed in the issue's description, I can connect to couchdb from the application container totally fine manually:

$ docker exec -it sw360_application bash
sw360@364860d9cb3f:/app/sw360$ curl http://admin:password@sw360_couchdb:5984/_all_dbs
["_global_changes","_replicator","_users","sw360db","sw360oauthclients","sw360vm"]

So that's not the problem unfortunately.

heliocastro commented 10 months ago

@thetredev I found a discrepancy. The image built on github is failing on tomcat bootstrap, but the same image built locally with ./docker_build.sh works. Something weird is happening with the upstream image, so I need to verify it. Are you able to build the image locally and test It?

thetredev commented 9 months ago

@heliocastro First of all happy new year!

I was on vacation the last couple weeks so I couldn't answer. I built the image locally, pushing to the registry at https://github.com/thetredev/sw360-docker-issue-2240 at the moment. I'll get back to you with the results.

thetredev commented 9 months ago

@heliocastro turns out I can just run the image locally so push wasn't needed.

Anyways now I get a different exception. See the attached file: logs.txt

harshadsinkar commented 9 months ago

@heliocastro turns out I can just run the image locally so push wasn't needed.

Anyways now I get a different exception. See the attached file: logs.txt

After pulling the latest image, I too can confirm this issue and getting the same error/exceptions as posted by @thetredev.

thetredev commented 9 months ago

SUCCESS! I can start the containers successfully with the following change in the docker-compose.yml file regarding the couchdb service:

  couchdb:
    image: couchdb:3.3.3
    container_name: sw360_couchdb
    restart: unless-stopped
    environment:
      COUCHDB_USER: admin
      COUCHDB_PASSWORD: password
-     COUCHDB_CREATE_DATABASE: "yes"
+     COUCHDB_CREATE_DATABASE: yes
    volumes:
      - ./couchdb:/opt/couchdb/data
    healthcheck:
      test: [ "CMD-SHELL", "curl --fail -s http://sw360_couchdb:5984/_up" ]
      interval: 10s
      timeout: 5s
      retries: 5

It seems like couchdb doesn't like it when yes is surrounded by quotes.

That being said, this only works with my locally built sw360 image. Using ghcr.io/eclipse-sw360/sw360:18.0.0 the web frontend is not reachable.

heliocastro commented 9 months ago

Good catch @thetredev I will fix this one right now before the 18.1 release

heliocastro commented 9 months ago

Upstream version already is this way. Would explain why is working

    environment:
      - COUCHDB_USER=admin
      - COUCHDB_PASSWORD=password
      - COUCHDB_CREATE_DATABASE=yes
thetredev commented 9 months ago

@heliocastro yes I converted the environment block to a key-value pair and didn't realize that there could be such a difference. The only thing you'd have to take a look at is why the upstream image itself isn't working.

thetredev commented 9 months ago

Closing this issue as the exceptions were due to my misconfiguration. See https://github.com/eclipse-sw360/sw360/issues/2274 for the docker image discrepancy issue.