Code Monkey home page Code Monkey logo

xnat-docker-compose's People

Contributors

andylassiter avatar aswinnarayanan avatar dmd avatar einzigartigername avatar hortonw avatar ihormkl avatar johnflavin avatar jpantonisse avatar kelseym avatar manishkumr avatar mattsouth avatar radiologics-kate avatar rherrick avatar scheiblr avatar sikerdebaard avatar tclose avatar vsoch avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

xnat-docker-compose's Issues

xnat-db exposes 5432 - why?

Is there a reason to have xnat-db expose 5432 to the outside world? What is the reasoning for this, versus exposing it only on an internal 'backend' docker network to the other containers?

Unable to create new users

Just cloned the repo and started building, only change was to add alpine-9.4.25 in the postgres Dockerfile.

The database builds and the web server starts, and clicking create user takes me to the user creation page. The issue is that when I go to submit my new user, I get an error at the top of the page saying, "Email send failed. If you cannot login contact you administrator."

I can upload the output of docker-compose up if need be.

Thanks in advance.

[BUG] incorrect shell syntax in postgres/Dockerfile

  1. Clone repository.
  2. do docker-compose up
Status: Downloaded newer image for postgres:12.2-alpine
 ---> ae192c4d3ada
Step 2/3 : RUN if [ ! -z ${POSTGRES_GID} && ${POSTGRES_GID} != 70 ]; then         sed -i'' -E 's/postgres:x:70:postgres/postgres:x:'${POSTGRES_GID}':postgres/' /etc/group;         sed -i'' -E 's/postgres:x:70:70:/postgres:x:'${POSTGRES_UID}':'${POSTGRES_GID}':/' /etc/passwd;     fi;
 ---> Running in ca4bb2bd2bef
sh: missing ]

[BUG] XNAT-Web failed to build on Windows

When i run docker-compose up, i get this error
Step 18/26 : RUN /usr/local/bin/make-xnat-config.sh
---> Running in 5e26f46efdcc
/bin/sh: /usr/local/bin/make-xnat-config.sh: not found
ERROR: Service 'xnat-web' failed to build: The command '/bin/sh -c /usr/local/bin/make-xnat-config.sh' returned a non-zero code: 127

Expected behavior
xnat spins up
Screenshots
If applicable, add screenshots to help explain your problem.

Docker server environment (please complete the following information):

  • Host OS: Windows
  • Docker version Docker version 19.03.12,
    docker-compose version 1.26.2, build eefe0d31
    docker-py version: 4.2.2
    CPython version: 3.7.4
    OpenSSL version: OpenSSL 1.1.1c 28 May 2019

Configuration:

  • Branch of XNAT docker-compose project: master

[BUG] On initial deploy, site displays login screen instead of setup screen

Describe the bug
The container started without any errors, but I can't login. It displays the login screen but there's no obvious way to login. Attempting to register a new user returns

Email send failed. If you are unable to log in to your account, please contact an administrator or create an account with a different email address.

To Reproduce
Steps to reproduce the behavior:

  1. Clone repository.
  2. $ docker-compose up -d
  3. Wait until the system is running.
  4. Open http://localhost/
  5. This takes me to http://localhost/app/template/Login.vm#!

Expected behavior
I'm not entirely sure since is the first time I'm trying to run XNAT. The documentation is a bit unclear about this but it sounds like it should take me to http://<xnat_home_url>/setup.

If I try to go to /setup directly it redirects me back to the login screen.

Screenshots
If applicable, add screenshots to help explain your problem.

Docker server environment (please complete the following information):

  • Host OS: Ununtu 20.04
  • Docker version: 19.03.8
  • docker-compose version: 1.26.0
  • Anything else?

Configuration:

  • Branch of XNAT docker-compose project: master
  • Commit hash or tag: d96eaeb
  • Environment settings: [e.g. environment variables, .env file]
  • Configuration: [e.g. plugins, manifest, etc.]

Additional context
Overall what I'm trying to figure out is how to login as administrator and set up a few accounts.

[BUG] `postgres:9.4-alpine` image no longer maintained upstream

Describe the bug

postgres:9.4-alpine image no longer maintained upstream: not updated in ~1 year. Could switch to postgres:9-alpine if minor version increases are always straightforward or, if not, postgres:9-6-alpine.

To Reproduce

  1. sudo docker-compose --pull --parallel build
  2. sudo trivy image --severity HIGH,CRITICAL --ignore-unfixed xnat-docker-compose_xnat-db:latest
  3. Long list of CVEs presented

Docker server environment (please complete the following information):

  • Host OS: Arch
  • Docker version: 20.10.5
  • docker-compose version: 1.28.5
  • Anything else?

Configuration:

  • Branch of XNAT docker-compose project: master
  • Commit hash or tag: 8534c2f
  • Environment settings: defaults
  • Configuration: defaults

Errors during DB Initialisation

I get the following errors durign the xnat db initialisation (upon running docker-compose up):

xnat-db_1 | ERROR: relation "arc_archivespecification" does not exist at character 22
xnat-db_1 | STATEMENT: select count(*) from arc_archivespecification
xnat-web_1 | SOURCE: /usr/local/tomcat/webapps/ROOT/
xnat-web_1 | ===========================
xnat-web_1 | New Database -- BEGINNING Initialization
xnat-web_1 | ===========================
xnat-db_1 | ERROR: relation "xdat_element_security" does not exist at character 74
xnat-db_1 | STATEMENT: SELECT xdat_element_security.element_name AS xdat_element_security0 FROM xdat_element_security xdat_element_security
xnat-db_1 | ERROR: relation "xdat_user" does not exist at character 28
xnat-db_1 | STATEMENT: SELECT login, enabled FROM xdat_user WHERE login NOT IN (SELECT xdat_username FROM xhbm_xdat_user_auth)
xnat-db_1 | ERROR: relation "xdat_usergroup" does not exist at character 30
xnat-db_1 | STATEMENT: SELECT tag, displayname FROM xdat_usergroup WHERE tag IS NOT NULL AND substr(id, length(tag)+2) LIKE E'%\_%'

Host: CentOS-7
Docker: 19.03

However, I am able to open up the Xnat website.

Use nginx-proxy to trivially support SSL

Just a suggestion/recommendation:

Setting up SSL can be trivial, using https://github.com/nginx-proxy/nginx-proxy !

In docker-compose.yml, instead of the current xnat-nginx stanza, use this instead:

  xnat-nginx:
    image: jwilder/nginx-proxy:alpine
    ports:
      - "80:80"
      - "443:443"
    volumes:
      - /var/run/docker.sock:/tmp/docker.sock:ro
      - /PATH/TO/YOUR/SSL-CERTS:/etc/nginx/certs:ro

In /PATH/TO/YOUR/SSL-CERTS, you need your.hostname.edu.key and your.hostname.edu.crt.

Finally, two more lines to add to docker-compose. In the environment stanza, add:

    - VIRTUAL_HOST=your.hostname.edu
    - VIRTUAL_PORT=8080

That's it! Now you've got an SSL proxy!

Port 22 bind: address already in use.

Hi,
Just trying to run this on a linux machine, specifically debian. Here's the errors I get. I don't think SSH should be enabled at all on this docker container.

ERROR: for xnat-docker-compose_xnat-web_1 Cannot start service xnat-web: b'driver failed programming external connectivity on endpoint xnat-docker-compose_xnat-web_1 (b12996d0ea4772e90917e6a9d03b804b686a0c14f6eedde33fc1ea01258f24e3): Error starting userland proxy: listen tcp 0.0.0.0:22: bind: address already in use'

ERROR: for xnat-web Cannot start service xnat-web: b'driver failed programming external connectivity on endpoint xnat-docker-compose_xnat-web_1 (b12996d0ea4772e90917e6a9d03b804b686a0c14f6eedde33fc1ea01258f24e3): Error starting userland proxy: listen tcp 0.0.0.0:22: bind: address already in use'
ERROR: Encountered errors while bringing up the project.

Thanks
James

Change weight and height units

Any way to change weight unit from lbs to kgs and height units to cm?

Sorry if this is not the correct place to ask this.

Thanks.

Empty /data/xnat/pipeline folder

I'm testing xnat using this docker-compose script. Sorry if my question doesn't make much sense, I'm still learning how this system works.

The /data/xnat/pipeline folder is empty in the default build. As far as I can see, there is no way to set this correctly when setting up XNAT from the war-file.

[BUG] psql: fe_sendauth: no password supplied

docker-compose up -d does not work "out of the box" as described. Instead you get:

xnat-web_1    | Postgres is unavailable - sleeping
xnat-web_1    | Password for user xnat: 
xnat-web_1    | psql: fe_sendauth: no password supplied

This is at:

commit 8534c2faa56177fe2b33f913c0f04a36dcee6ca4 (HEAD -> master, origin/master, origin/HEAD)

I suspect this is similar to #28 .

Project Owner error message

When project owner wants to access the project there is an error message 403 "The user XX is not allowed to access this information". One cannot also add/edit other project access settings. However, owners with "All data access" do not have such problems.

xnat-web tomcat fails to start with feature/dependency-mgmt branch

Describe the bug
xnat-web container comes up but the xnat site does not come up. trafik dashboard is up
Note: Opening a new issue for the continuation of issue is closed

To Reproduce
Steps to reproduce the behavior:
$ git clone https://github.com/NrgXnat/xnat-docker-compose
$ cd xnat-docker-compose
$ git checkout features/dependency-mgmt
copied defaut.env to .env file
$ ./gradlew composeBuild composeUp
+--------------+----------------+-----------------+
| Name | Container Port | Mapping |
+--------------+----------------+-----------------+
| xnat-traefik | 80 | 172.20.0.1:80 |
| xnat-traefik | 8080 | 172.20.0.1:8080 |
+--------------+----------------+-----------------+
| xnat-web | 8000 | 172.20.0.1:8000 |
| xnat-web | 8104 | 172.20.0.1:8104 |
| xnat-web | 8144 | 172.20.0.1:8144 |
+--------------+----------------+-----------------+
All the 3 containers up

  1. xnat-web / tomcat does not come up properly with default settings.
    Errors from the xnat-web errors
Apr 21, 2021 4:17:05 PM org.apache.catalina.core.AprLifecycleListener initializeSSL
INFO: OpenSSL successfully initialized [OpenSSL 1.1.1d  10 Sep 2019]
Apr 21, 2021 4:17:05 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-apr-8080"]
Apr 21, 2021 4:17:05 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 672 ms
Apr 21, 2021 4:17:05 PM org.apache.catalina.core.StandardService startInternal
INFO: Starting service [Catalina]
Apr 21, 2021 4:17:05 PM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.108
Apr 21, 2021 4:17:05 PM org.apache.catalina.startup.HostConfig deployWAR
INFO: Deploying web application archive [/usr/local/tomcat/webapps/ROOT.war]
Debugger failed to attach: handshake failed - connection prematurally closed
Apr 21, 2021 4:17:15 PM org.apache.catalina.startup.TldConfig execute
INFO: At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
Apr 21, 2021 4:17:18 PM org.apache.catalina.core.StandardContext startInternal
SEVERE: One or more listeners failed to start. Full details will be found in the appropriate container log file
Apr 21, 2021 4:17:18 PM org.apache.catalina.core.StandardContext startInternal
SEVERE: Context [] startup failed due to previous errors
Apr 21, 2021 4:17:18 PM org.apache.catalina.startup.HostConfig deployWAR
INFO: Deployment of web application archive [/usr/local/tomcat/webapps/ROOT.war] has finished in [12,948] ms
Apr 21, 2021 4:17:18 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-apr-8080"]
Apr 21, 2021 4:17:18 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 13012 ms
root@eee2582e9503:/usr/local/tomcat/logs# ls
catalina.2021-04-21.log  host-manager.2021-04-21.log  localhost.2021-04-21.log	localhost_access_log.2021-04-21.txt  manager.2021-04-21.log
root@eee2582e9503:/usr/local/tomcat/logs# cat localhost.2021-04-21.log
Apr 21, 2021 4:17:15 PM org.apache.catalina.core.ApplicationContext log
INFO: 2 Spring WebApplicationInitializers detected on classpath
Apr 21, 2021 4:17:15 PM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring root WebApplicationContext
Apr 21, 2021 4:17:18 PM org.apache.catalina.core.StandardContext listenerStart
SEVERE: Exception sending context initialized event to listener instance of class [org.springframework.web.context.ContextLoaderListener]
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'properties' defined in org.nrg.xnat.initialization.PropertiesConfig: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.context.support.PropertySourcesPlaceholderConfigurer]: Factory method 'properties' threw exception; nested exception is java.lang.RuntimeException: No XNAT home specified in any of the accepted locations: ${xnat.config}/, ${xnat.config.home}/xnat-conf.properties, ${xnat.home}/config/xnat-conf.properties, ${XNAT_HOME}/config/xnat-conf.properties, ${HOME}/xnat/config/xnat-conf.properties, ${HOME}/config/xnat-conf.properties
	at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:599)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1176)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1071)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:511)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:481)
	at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:312)
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:308)
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202)
	at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:151)
	at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:687)
	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:524)
	at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:443)
	at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:325)
	at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:107)
	at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:5126)
	at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5653)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
	at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:1007)
	at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:983)
	at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:639)
	at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:1128)
	at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:2020)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)
Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.context.support.PropertySourcesPlaceholderConfigurer]: Factory method 'properties' threw exception; nested exception is java.lang.RuntimeException: No XNAT home specified in any of the accepted locations: ${xnat.config}/, ${xnat.config.home}/xnat-conf.properties, ${xnat.home}/config/xnat-conf.properties, ${XNAT_HOME}/config/xnat-conf.properties, ${HOME}/xnat/config/xnat-conf.properties, ${HOME}/config/xnat-conf.properties
	at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:189)
	at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:588)
	... 27 more

Expected behavior
The Xnat site to come up with default settings

Docker server environment (please complete the following information):
Host OS: - RHEL 7.7
Docker version - 20.10.6, build 370c289
docker-compose version -- version 1.29.1, build c34c88b2
Anything else? Java 8

Configuration:
Environment settings: default
Configuration: .manifest-XNAT-ML-18.json

"/data/xnat/archive" data gone after `docker-compose down` - best practices?

Hi @johnflavin @vsoch

I appreciate your effort of creating this docker-compose container for XNAT1.7. I'm fairly new to both but was able to get an XNAT server up and running for within a short amount of time.

Maybe I missed something in the README, but after uploading my test subjects DICOMs into XNAT archive, I was able to manage the files within the XNAT GUI as well as see it on the docker host with:

docker exec -it $NAME ls -laR /data/xnat/archive

However after after shutting down the server with docker-compose down and restarting it, I get a XNAT System Path Verification Failure error stating that /data/xnat/archive is missing. After further examination, all DICOMs in /data/xnat/archive are gone.

What would be the best practice to permanently store my archived data when using this container? Thanks for your help!

[BUG] Bad Gateway returned by Nginx

When compose services have started and xnat is accessed on http://localhost Nginx returns a bad gateway error.

image

The logs of Nginx show:

2020/06/25 06:50:28 [error] 6#6: *1 connect() failed (111: Connection refused) while connecting to upstream, client: 172.31.0.1, server: , request: "GET / HTTP/1.1", upstream: "http://172.31.0.3:8081/", host: "localhost"
2020/06/25 06:50:28 [error] 6#6: *1 connect() failed (111: Connection refused) while connecting to upstream, client: 172.31.0.1, server: , request: "GET /favicon.ico HTTP/1.1", upstream: "http://172.31.0.3:8081/favicon.ico", host: "localhost", referrer: "http://localhost/"

To Reproduce
Steps to reproduce the behavior:

  1. Clone repository.
  2. Check out branch master
  3. Run docker-compose up -d and wait for the Xnat service to start.
  4. Attach shell to xnat-nginx service:
docker exec -it xnat-docker-compose_xnat-nginx_1 sh
  1. Inspect error log:
tail -f /var/log/nginx/xnat.error.log
  1. Open http://localhost in browser
  2. Check Nginx log (see Step 4)

Expected behavior
I expect to be redirected to the xnat-web service.

Docker server environment (please complete the following information):

  • Ubuntu 18.04
  • Docker version 19.03.11, build 42e35e61f3
  • docker-compose version 1.25.4, build 8d51620a

Configuration:

  • Branch of XNAT docker-compose project:master
  • Commit hash or tag: d96eaeb
  • Environment settings: none
  • Configuration: none

Additional context

image

  • On a side note: wthat is the reason for exposing ports 8000 and 8080 on the host system by the xnat-web service? Should all traffic not go through Nginx?

Admin user cannot use config page

Overall I experience many issues deploying your docker-compose solution. I encounter:

  • Error that causes the database not to initiate as described here.
  • The ngix proxy not starting (that is at least my diagnosis) as described here.

Problem

To test drive XNAT I have created by own docker compose solution that uses an Apache HTTPD reverse proxy that hosts XNAT at address https://hostname/xnat.

When doing this all initialization is fine, but while logging in as admin after first start I encounter session problems. As soon as I log in, immediately a message User session ended is shown and I cannot use the config page (see movie below). The page continues to auto-reload every 30 seconds or so.

Do you know what may be the problem here? Do you have suggestions to find the cause?

Peek 2020-06-23 16-27

System setup

Operating system

  • Ubuntu 18.04
  • Docker version 19.03.11, build 42e35e61f3
  • docker-compose version 1.25.4, build 8d51620a

Apache HTTPD config

Reverse proxy that hosts XNAT at address https://localhost/xnat.

Listen 80
Listen 443

<VirtualHost *:80>
  ServerName localhost
  Redirect / https://localhost/
</VirtualHost>

<VirtualHost *:443>
  SSLEngine on
  SSLCertificateFile /etc/ssl/cbio_https/cert.crt
  SSLCertificateKeyFile /etc/ssl/cbio_https/key.key
  ServerName localhost

  Header always set Strict-Transport-Security "max-age=15768000"

  ErrorLog /tmp/cbio_https_error.log
  LogLevel warn
  CustomLog /tmp/cbio_https_access.log combined

  ProxyPass /xnat http://xnat:8080/xnat
  ProxyPassReverse /xnat http://xnat:8080/xnat

  ProxyPreserveHost On

  <Location "/">
    AuthType None
    Require all granted
  </Location>

</VirtualHost>

docker compose

The XNAT service is built with TOMCAT_XNAT_FOLDER set to xnat to support the https://localhost/xnat URL pattern.

version: '2.4'
networks:
  xnat-net:
    name: xnat-net

services:
  xnat:
    build:
      context: https://github.com/NrgXnat/xnat-docker-compose.git#:xnat
      args:
        XNAT_VER: '1.7.6'
        XNAT_DATASOURCE_DRIVER: 'org.postgresql.Driver'
        XNAT_DATASOURCE_URL: 'jdbc:postgresql://xnat-db/xnat'
        XNAT_DATASOURCE_USERNAME: 'xnat'
        XNAT_DATASOURCE_PASSWORD: 'xnat'
        XNAT_HIBERNATE_DIALECT: 'org.hibernate.dialect.PostgreSQL9Dialect'
        TOMCAT_XNAT_FOLDER: xnat
        XNAT_ROOT: /data/xnat
        XNAT_HOME: /data/xnat/home
    container_name: xnat
    networks:
      - xnat-net
    volumes:
      - ./client/xnat/plugins:/data/xnat/home/plugins
      - ./log/xnat:/data/xnat/home/logs
      - ${XNAT_FILE_DIR:-../xnat_application/}/archive:/data/xnat/archive
      - ${XNAT_FILE_DIR:-../xnat_application/}/build:/data/xnat/build
      - /var/run/docker.sock:/var/run/docker.sock
    depends_on:
      - xnat-db
    environment:
      - CATALINA_OPTS=-Xms128m -Xmx2048m -Dxnat.home=/data/xnat/home
      - XNAT_HOME=/data/xnat/home

  xnat-db:
    build:
      context: https://github.com/NrgXnat/xnat-docker-compose.git#:postgres
    container_name: xnatdb
    networks:
      - xnat-net
    volumes:
      - ${XNAT_DATA_DIR:-../xnat_files/}:/var/lib/postgresql/data
    expose:
      - "5432"

  apache-proxy:
    networks:
      - xnat-net
    image: httpd:2.4.29
    container_name: apache-proxy
    restart: always
    volumes:
      - ./service/apache-proxy/httpd.conf:/usr/local/apache2/conf/httpd.conf:ro
      - ./service/apache-proxy/virtual-hosts/keycloak.conf:/usr/local/apache2/conf/sites/keycloak.conf:ro
      - ${PROXY_SSL_CERTIFICATE:-./client/ssl_cert/cert.crt}:/etc/ssl/cbio_https/cert.crt:ro
      - ${PROXY_SSL_KEY:-./client/ssl_cert/key.key}:/etc/ssl/cbio_https/key.key:ro
    ports:
      - 80:80
      - 443:443
    depends_on:
      - xnat

XNAT time in UTC

Time inside the container appears to be UTC (even though time on the host is my local TZ). Is that expected/desired behavior?

Similarly, when I look at "Date Added" in an MR session, that datetime is in UTC, but there's no indication to the user that that's the case.

unable to run Tomcat server

@johnflavin I'm excited to take advantage of your project. I'd like to get an xnat instance up on my machine to experiment with before I use my lab's XNAT server.

Right now I'm unable to run Tomcat. I follow steps 1-4 but localhost/xnat responds with 404. When I look at the logs with docker-compose logs -f --tail=20 xnat-web I see the following error:

java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/xnat]] xnat-web_1 | at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:1019) xnat-web_1 | at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:991) xnat-web_1 | at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:652) xnat-web_1 | at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:1127) xnat-web_1 | at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:2020) xnat-web_1 | at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) xnat-web_1 | at java.util.concurrent.FutureTask.run(FutureTask.java:262) xnat-web_1 | at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) xnat-web_1 | at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) xnat-web_1 | at java.lang.Thread.run(Thread.java:745) xnat-web_1 | xnat-web_1 | Apr 11, 2018 9:19:03 PM org.apache.catalina.startup.HostConfig deployWAR xnat-web_1 | INFO: Deployment of web application archive /opt/tomcat/webapps/xnat.war has finished in 140 ms xnat-web_1 | Apr 11, 2018 9:19:03 PM org.apache.coyote.AbstractProtocol start xnat-web_1 | INFO: Starting ProtocolHandler ["http-bio-8080"] xnat-web_1 | Apr 11, 2018 9:19:03 PM org.apache.coyote.AbstractProtocol start xnat-web_1 | INFO: Starting ProtocolHandler ["ajp-bio-8009"] xnat-web_1 | Apr 11, 2018 9:19:03 PM org.apache.catalina.startup.Catalina start xnat-web_1 | INFO: Server startup in 381 ms
(One thing I was a little unclear on from the readme was the appropriate location of the .war file. Right now I have redundant copies both in a webapp dir that's sibling to the ngingx, postgres etc. direrectories, and in a webapp dir that's sibling to the xnat-docker-compose-directory. )

Thanks for considering this issue!

dicom scp receiver on 8104 unreachable

Hi, I am referring to the basic docker installation (without gradle) consisting of the NGINX, XNAT and PostGre. Within the Xnat docker I see that the Dicom SCP Receiver on port 8104 is on by default, but there seems no way of reaching this using the dicom export service of an application like Clinical Trial Processor.
Is it the case that nginx does not permit any traffic on 8104? I have tried to ping on this port and tried to push dicom images to the XNAT SCP Receiver without success.
Would you be able to provide a version where the XNAT SCP Receiver can be reached, or please guide me how to make this possible? Thank you in advance.

Gradlew build fails for the xnat-web

Describe the bug
A clear and concise description of what the bug is.

To Reproduce
Steps to reproduce the behavior:
$ git clone https://github.com/NrgXnat/xnat-docker-compose
$ cd xnat-docker-compose
$ git checkout features/dependency-mgmt
4. See error while building using gradlew and failing to build the Dockerfile under xnat-web.

  Step 27/31 : RUN apk add --no-cache         postgresql-client wget &&     rm -rf ${CATALINA_HOME}/webapps/* &&     mkdir -p         ${CATALINA_HOME}/webapps/${XNAT_WEBAPP_FOLDER}         ${XNAT_HOME}/config         ${XNAT_HOME}/logs         ${XNAT_HOME}/plugins         ${XNAT_HOME}/work         ${XNAT_ROOT}/archive         ${XNAT_ROOT}/build         ${XNAT_ROOT}/cache         ${XNAT_ROOT}/ftp         ${XNAT_ROOT}/pipeline         ${XNAT_ROOT}/prearchive &&     /usr/local/bin/make-xnat-config.sh &&     rm /usr/local/bin/make-xnat-config.sh
   ---> Running in 3a75c232a180
  fetch http://dl-cdn.alpinelinux.org/alpine/v3.9/main/x86_64/APKINDEX.tar.gz
  fetch http://dl-cdn.alpinelinux.org/alpine/v3.9/community/x86_64/APKINDEX.tar.gz
  WARNING: Ignoring http://dl-cdn.alpinelinux.org/alpine/v3.9/main/x86_64/APKINDEX.tar.gz: temporary error (try again later)
  WARNING: Ignoring http://dl-cdn.alpinelinux.org/alpine/v3.9/community/x86_64/APKINDEX.tar.gz: temporary error (try again later)
  ERROR: unsatisfiable constraints:
    postgresql-client (missing):
      required by: world[postgresql-client]
    wget (missing):
      required by: world[wget]

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 2s

Expected behavior
Build to succeed.

Screenshots
If applicable, add screenshots to help explain your problem.

Docker server environment (please complete the following information):

  • Host OS: - RHEL 7.7
  • Docker version - 20.10.6, build 370c289
  • docker-compose version -- version 1.29.1, build c34c88b2
  • Anything else? Java 8

Configuration:

  • Environment settings: default
  • Configuration: .manifest-XNAT-ML-18.json

Additional context
The docker build with out dependency mgmt repo is working well from https://github.com/NrgXnat/xnat-docker-compose. Also noticed xnat-web dockerfile has differences between these two branches

Sessions not archiving due to "unexpected condition"

Sessions that are sent to the DICOM receiver appear in the prearchive without any problem but then fail to archive (automatically & manually) with the following (quite unhelpful) error message

The server encountered an unexpected condition which prevented it from fulfilling the request

You can get technical details here.

Please continue your visit at our home page.

Can't find anything in the logs corresponding to it. Has anyone else had an issue with this?

[BUG] tomcat:7-jre8-alpine Docker image no longer seems to be maintained upstream.

Describe the bug

tomcat:7-jre8-alpine image no longer maintained upstream. No Alpine-related Tomcat images updated in ~2 years. Suggest switching to Debian Buster or Buster Slim-based Tomcat images.

To Reproduce

  1. sudo docker-compose --pull --parallel build
  2. sudo trivy image --severity HIGH,CRITICAL --ignore-unfixed xnat-docker-compose_xnat-web:latest
  3. Long list of CVEs presented

Docker server environment (please complete the following information):

  • Host OS: Arch
  • Docker version: 20.10.5
  • docker-compose version: 1.28.5
  • Anything else?

Configuration:

  • Branch of XNAT docker-compose project: master
  • Commit hash or tag: 8534c2f
  • Environment settings: defaults
  • Configuration: defaults

Unable to find these plug ins mentioned in the XNAT ML setup.

{
"version": "1.0",
"base": "xnat-data",
"webapps": "org.nrg.xnat.web:xnat-web:1.8 -> ROOT.war",
"plugins": [
"org.nrg.xnatx.plugins:batch-launch:0.4.0",
"org.nrg.xnatx.plugins:container-service:3.0.0:fat",
"org.nrg.xnatx.plugins:dicom-query-retrieve:ML-BETA:xpl",
"org.nrg.xnatx.plugins:xnatx-clara:1.0",
"org.nrg.xnatx.plugins:xnatx-collection:1.0",
"org.nrg.xnatx.plugins:ohif-viewer:3.0.0:fat"
]
}

Fresh install crashes immediately upon launch

I just did a fresh git-clone of the repo. I cd'd into the directory and ran docker-compose up -d. It downloaded a number of packages and seemed fine, but then it crashed with a python error. Here's the end of the output:

Successfully built 8b880479e1a0                                                      
Successfully tagged xnat-docker-compose_xnat-web:latest                                                                                                                    WARNING: Image for service xnat-web was built because it did not already exist. To rebuild this image you must use `docker-compose build` or `docker-compose up --build`.
Building xnat-nginx
Step 1/3 : FROM nginx:1.12-alpine-perl                                               
1.12-alpine-perl: Pulling from library/nginx
550fe1bea624: Pull complete       
20a55c7b3b0e: Pull complete                                                          
552be5624b14: Pull complete                                                                                                                                                
40fc04944e91: Pull complete                                                          
Digest: sha256:b7970b06de2b70acca1784ab92fb06d60f4f714e901a55b6b5211c22a446dbd2
Status: Downloaded newer image for nginx:1.12-alpine-perl                                                                                                                  
 ---> b6a456f1d7ae                   
Step 2/3 : RUN rm /etc/nginx/conf.d/default.conf                             
 ---> Running in 57caeecfb592
Removing intermediate container 57caeecfb592                                 
 ---> eedecbc82178         
Step 3/3 : COPY nginx.conf /etc/nginx                                                
 ---> 6bb4c0d604d6                                                                   
Successfully built 6bb4c0d604d6                                                                                                                                            
Successfully tagged xnat-docker-compose_xnat-nginx:latest
WARNING: Image for service xnat-nginx was built because it did not already exist. To rebuild this image you must use `docker-compose build` or `docker-compose up --build`.
Creating xnat-docker-compose_xnat-db_1 ... done
Creating xnat-docker-compose_xnat-web_1 ...                                
                                                                                     
ERROR: for xnat-docker-compose_xnat-web_1  a bytes-like object is required, not 'str'            
                                                                                     
ERROR: for xnat-web  a bytes-like object is required, not 'str'                                                                                                            
Traceback (most recent call last):                                                   
  File "/usr/lib/python3/dist-packages/docker/api/client.py", line 261, in _raise_for_status
    response.raise_for_status()
  File "/usr/lib/python3/dist-packages/requests/models.py", line 940, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 500 Server Error: Internal Server Error for url: http+docker://localhost/v1.22/containers/6a2f94643b89a7aec22c3c14a129b076b5efd41637081d94e8
3204fdb77de6e8/start                                                                 
                                                                                                                                                                           
During handling of the above exception, another exception occurred:
                                                                                                                                                                           
Traceback (most recent call last):                                                   
  File "/usr/lib/python3/dist-packages/compose/service.py", line 625, in start_container
    container.start()                                                                                                                                                      
  File "/usr/lib/python3/dist-packages/compose/container.py", line 241, in start
    return self.client.start(self.id, **options)
  File "/usr/lib/python3/dist-packages/docker/utils/decorators.py", line 19, in wrapped
    return f(self, resource_id, *args, **kwargs)
  File "/usr/lib/python3/dist-packages/docker/api/container.py", line 1095, in start
    self._raise_for_status(res)
  File "/usr/lib/python3/dist-packages/docker/api/client.py", line 263, in _raise_for_status
    raise create_api_error_from_http_exception(e)
  File "/usr/lib/python3/dist-packages/docker/errors.py", line 31, in create_api_error_from_http_exception
    raise cls(e, response=response, explanation=explanation)
docker.errors.APIError: 500 Server Error: Internal Server Error ("b'driver failed programming external connectivity on endpoint xnat-docker-compose_xnat-web_1 (7e4d4088a2e
ce5a1d2ae7f80c4488ebdeb3168072b30599220bb4941fc166369): Error starting userland proxy: listen tcp 0.0.0.0:22: bind: address already in use'")

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/bin/docker-compose", line 11, in <module>
    load_entry_point('docker-compose==1.25.0', 'console_scripts', 'docker-compose')() 
  File "/usr/lib/python3/dist-packages/compose/cli/main.py", line 72, in main
    command()
  File "/usr/lib/python3/dist-packages/compose/cli/main.py", line 128, in perform_command
    handler(command, command_options)
  File "/usr/lib/python3/dist-packages/compose/cli/main.py", line 1107, in up
    to_attach = up(False)
  File "/usr/lib/python3/dist-packages/compose/cli/main.py", line 1088, in up
    return self.project.up(
  File "/usr/lib/python3/dist-packages/compose/project.py", line 565, in up
    results, errors = parallel.parallel_execute(
  File "/usr/lib/python3/dist-packages/compose/parallel.py", line 112, in parallel_execute
    raise error_to_reraise
  File "/usr/lib/python3/dist-packages/compose/parallel.py", line 210, in producer
    result = func(obj)
  File "/usr/lib/python3/dist-packages/compose/project.py", line 548, in do
    return service.execute_convergence_plan(
  File "/usr/lib/python3/dist-packages/compose/service.py", line 545, in execute_convergence_plan
    return self._execute_convergence_create(
  File "/usr/lib/python3/dist-packages/compose/service.py", line 460, in _execute_convergence_create
    containers, errors = parallel_execute( 
  File "/usr/lib/python3/dist-packages/compose/parallel.py", line 112, in parallel_execute
    raise error_to_reraise
  File "/usr/lib/python3/dist-packages/compose/parallel.py", line 210, in producer
    result = func(obj)
  File "/usr/lib/python3/dist-packages/compose/service.py", line 465, in <lambda>
    lambda service_name: create_and_start(self, service_name.number),
  File "/usr/lib/python3/dist-packages/compose/service.py", line 457, in create_and_start
    self.start_container(container)
 File "/usr/lib/python3/dist-packages/compose/service.py", line 627, in start_container
    if "driver failed programming external connectivity" in ex.explanation:
TypeError: a bytes-like object is required, not 'str'

master branch does not run XNAT

master branch is currently broken out of the box.

To reproduce:

git clone [email protected]:NrgXnat/xnat-docker-compose.git \
&& cd xnat-docker-compose \
&& cp default.env .env \
&& docker-compose up
  1. In docker-compose logs -f observe this suspicious final entry:
xnat-web_1    | 20-May-2021 17:52:08.159 INFO [main] org.apache.catalina.startup.Catalina.start Server startup in [103] milliseconds

103 millseconds, huh? That seems short.

  1. Just for safety wait another few minutes

  2. Go to http://localhost and see:

HTTP Status 404 โ€“ Not Found
Type Status Report

Description The origin server did not find a current representation for the target resource or is not willing to disclose that one exists.

Apache Tomcat/9.0.46

Postgres database is uninitialized and superuser password is not specified

A recent update to the official postgres docker image breaks xnat-docker-compose out the box, causing it to fail with the following error.

$ docker-compose up
Starting xnat-docker-compose_xnat-db_1 ... done
Recreating xnat-docker-compose_xnat-web_1 ... done
Creating xnat-docker-compose_xnat-nginx_1 ... done
Attaching to xnat-docker-compose_xnat-db_1, xnat-docker-compose_xnat-web_1, xnat-docker-compose_xnat-nginx_1
xnat-db_1     | Error: Database is uninitialized and superuser password is not specified.
xnat-db_1     |        You must specify POSTGRES_PASSWORD for the superuser. Use
xnat-db_1     |        "-e POSTGRES_PASSWORD=password" to set it in "docker run".
xnat-db_1     | 
xnat-db_1     |        You may also use POSTGRES_HOST_AUTH_METHOD=trust to allow all connections
xnat-db_1     |        without a password. This is *not* recommended. See PostgreSQL
xnat-db_1     |        documentation about "trust":
xnat-db_1     |        https://www.postgresql.org/docs/current/auth-trust.html
xnat-web_1    | psql: could not translate host name "xnat-db" to address: Name does not resolve
xnat-web_1    | Postgres is unavailable - sleeping

One simple work around (which it appears you are aware of by looking at some of the more recent code in branches other than master) is to add the following lines to the xnat-db definition in docker-compose.yml:

    environment:
      POSTGRES_HOST_AUTH_METHOD: trust

However this is not really best practice security wise, as it means any other service on the same docker network can get access to the xnat postgres database without authentication.

Ideally I think the xnat-db image should be pre-configured with a password using the POSTGRES_PASSWORD environment variable, and the the xnat-web container should be made aware of this value and use it when connecting.

I would love to hear your thoughts on this.

Deploy Xnat on Kubernetes Cluster

Is your feature request related to a problem? Please describe.
For scalability purposes and for ease of management, can we have this available as K8S deployable?

Describe the solution you'd like
An YAML file package with all the dependencies assuming a functioning K8S cluster with a proxy available

add config files for plugins?

I'd like to use the xnat-ldap-plugin. It seems to want me to write a file into /data/xnat/home/config, but that path seems to be internal to this container, not mounted from outside.

What's the right thing to do?

Automated periodic checks for stale base images.

Is your feature request related to a problem? Please describe.

Base image tags referenced in Dockerfiles in this repo are quite old and relate to images with lots of associated serious CVEs.

Describe the solution you'd like

GitHub Actions workflow to periodically build Docker images from this repo, scan with a vuln scanner such as Trivy (but other options exist) then alert if high-severity unfixed vulns are found. These alerts could potentially autogenerate public Issues or private security alerts to maintainers.

Describe alternatives you've considered
This scanning could also potentially be handled by an image registry.

[issue] is there a limitation on the number of subjects/studies in docker compose xnat?

Dear all, I am using a git clone from the current master branch on a 100GB storage ubuntu 18.04 machine.
Question : Is there a limitation on the number of subjects/studies that the docker xnat can support?
Problem : I have currently 116 subjects with DICOM CT and DICOM SEG each, all inside a single XNAT project, but it seems that I am unable to add any more patients to this project. However if I delete a few subjects I can then add some more, until I seem to hit some sort of limitation and then I get errors. For info, I am using the python xnat api to upload zip files, but I see the exact same effect when I use the compressed dicom upload function direct from the GUI. Thanks in advance.

[BUG] incorrect bash syntax

in commit ebf8d37e40354c70898bde9d14ef0de0fec9e664:

  1. Clone repository.
  2. do docker-compose up
Status: Downloaded newer image for postgres:12.2-alpine
 ---> ae192c4d3ada
Step 2/3 : RUN if [ ! -z ${POSTGRES_GID} && ${POSTGRES_GID} != 70 ]; then         sed -i'' -E 's/postgres:x:70:postgres/postgres:x:'${POSTGRES_GID}':postgres/' /etc/group;         sed -i'' -E 's/postgres:x:70:70:/postgres:x:'${POSTGRES_UID}':'${POSTGRES_GID}':/' /etc/passwd;     fi;
 ---> Running in ca4bb2bd2bef
sh: missing ]

Service does not start - database schema issue?

Nothing responds on port 80 after running sudo docker-compose up, even after several minutes. Using commit f9e74d1.

From the docker-compose (foreground) output:

...
xnat-web_1    | May 15, 2018 12:28:42 PM org.apache.catalina.startup.TldConfig execute
xnat-web_1    | INFO: At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
xnat-db_1     | ERROR:  relation "arc_archivespecification" does not exist at character 22
xnat-db_1     | STATEMENT:  select count(*) from arc_archivespecification
xnat-web_1    | SOURCE: /opt/tomcat/webapps/xnat/
xnat-db_1     | ERROR:  relation "xdat_user" does not exist at character 22
xnat-db_1     | STATEMENT:  SELECT COUNT(*) FROM xdat_user
xnat-web_1    | ===========================
xnat-web_1    | New Database -- BEGINNING Initialization
xnat-web_1    | ===========================
xnat-db_1     | ERROR:  relation "xdat_user" does not exist at character 28
xnat-db_1     | STATEMENT:  SELECT login, enabled FROM xdat_user WHERE login NOT IN (SELECT xdat_username FROM xhbm_xdat_user_auth)
xnat-db_1     | ERROR:  relation "xdat_usergroup" does not exist at character 30
xnat-db_1     | STATEMENT:  SELECT tag, displayname FROM xdat_usergroup WHERE tag IS NOT NULL AND substr(id, length(tag)+2) LIKE E'%\\_%'
xnat-db_1     | ERROR:  relation "xdat_element_security" does not exist at character 74
xnat-db_1     | STATEMENT:  SELECT xdat_element_security.element_name AS xdat_element_security0 FROM xdat_element_security xdat_element_security
xnat-db_1     | ERROR:  relation "xdat_user" does not exist at character 28
xnat-db_1     | STATEMENT:  SELECT login, enabled FROM xdat_user WHERE login NOT IN (SELECT xdat_username FROM xhbm_xdat_user_auth)
xnat-db_1     | ERROR:  relation "xdat_usergroup" does not exist at character 30
xnat-db_1     | STATEMENT:  SELECT tag, displayname FROM xdat_usergroup WHERE tag IS NOT NULL AND substr(id, length(tag)+2) LIKE E'%\\_%'
xnat-web_1    | ===========================
xnat-web_1    | Database initialization complete.
xnat-web_1    | ===========================
xnat-web_1    | May 15, 2018 12:29:34 PM org.apache.catalina.startup.HostConfig deployWAR
xnat-web_1    | INFO: Deployment of web application archive /opt/tomcat/webapps/xnat.war has finished in 59,967 ms
xnat-web_1    | May 15, 2018 12:29:34 PM org.apache.coyote.AbstractProtocol start
xnat-web_1    | INFO: Starting ProtocolHandler ["http-bio-8080"]
xnat-web_1    | May 15, 2018 12:29:34 PM org.apache.coyote.AbstractProtocol start
xnat-web_1    | INFO: Starting ProtocolHandler ["ajp-bio-8009"]
xnat-web_1    | May 15, 2018 12:29:34 PM org.apache.catalina.startup.Catalina start
xnat-web_1    | INFO: Server startup in 60026 ms

From /opt/tomcat/logs/catalina.$(date +%F).log:

...
INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: /usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib
May 15, 2018 12:28:34 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-bio-8080"]
May 15, 2018 12:28:34 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["ajp-bio-8009"]
May 15, 2018 12:28:34 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 544 ms
May 15, 2018 12:28:34 PM org.apache.catalina.core.StandardService startInternal
INFO: Starting service Catalina
May 15, 2018 12:28:34 PM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.85
May 15, 2018 12:28:34 PM org.apache.catalina.startup.HostConfig deployWAR
INFO: Deploying web application archive /opt/tomcat/webapps/xnat.war
May 15, 2018 12:28:42 PM org.apache.catalina.startup.TldConfig execute
INFO: At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
May 15, 2018 12:29:34 PM org.apache.catalina.startup.HostConfig deployWAR
INFO: Deployment of web application archive /opt/tomcat/webapps/xnat.war has finished in 59,967 ms
May 15, 2018 12:29:34 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-bio-8080"]
May 15, 2018 12:29:34 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["ajp-bio-8009"]
May 15, 2018 12:29:34 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 60026 ms

The error messages re SQL relations not existing look suspicious. However, if I connect directly to the database container I can see that those relations do exist:

$ sudo docker exec -it xnat-docker-compose_xnat-db_1 /bin/bash
bash-4.4# echo '\dt' | psql -U xnat xnat | grep -E '\W(xdat_user|arc_archivespecification|xdat_usergroup)\W'
 public | arc_archivespecification                                | table | xnat
 public | xdat_user                                               | table | xnat
 public | xdat_usergroup                                          | table | xnat

xnat-web: build error: bin/sh

Hi
while building xnat-web in docker i am getting the following error. Please advise

/bin/sh: /usr/local/bin/make-xnat-config.sh: not found
ERROR: Service 'xnat-web' failed to build: The command '/bin/sh -c apk add --no-cache postgresql-client wget && rm -rf $CATALINA_HOME/webapps/* && mkdir -p $CATALINA_HOME/webapps/${TOMCAT_XNAT_FOLDER} ${XNAT_HOME}/config ${XNAT_HOME}/logs ${XNAT_HOME}/plugins ${XNAT_HOME}/work ${XNAT_ROOT}/archive ${XNAT_ROOT}/build ${XNAT_ROOT}/cache ${XNAT_ROOT}/ftp ${XNAT_ROOT}/pipeline ${XNAT_ROOT}/prearchive && /usr/local/bin/make-xnat-config.sh && rm /usr/local/bin/make-xnat-config.sh && cd $CATALINA_HOME/webapps/ && wget https://api.bitbucket.org/2.0/repositories/xnatdev/xnat-web/downloads/xnat-web-${XNAT_VER}.war && cd ${TOMCAT_XNAT_FOLDER} && unzip -o ../xnat-web-${XNAT_VER}.war && rm -f ../xnat-web-${XNAT_VER}.war && apk del wget' returned a non-zero code: 127

.env should not be part of git commit set

Best practice is that .env should never be part of a repository. Doing so makes merging upstream changes more difficult and can lead to accidentally committing sensitive data (like postgres and smtp passwords) to a repository.

Instead, create an example file .env-dist which should be copied by the user.

.env should be in .gitignore.

[XSync] current transaction is aborted, commands ignored until end of transaction block

I'm trying to sync from a remote xnat to local (w/docker compose) with xsync. Data is transferred. I see all 360Gb+ in /data/xnat/archive/$project/arc001/ and the subject and dicom counts seem correct. But the remote sends a failure notification with subject assessment log rows like

2018-08-17-13-27-32 | FAILED | Sync failed. Scan 37 failed to sync. Scan 39 failed to sync. Scan 42 failed to sync. Scan 44 failed to sync.

The local (docker compose) log has a long list of errors related to ACTIVEQ_...:

xnat-db_1     | LOG:  autovacuum launcher started
xnat-web_1    | INFO: Starting Servlet Engine: Apache Tomcat/7.0.94
xnat-db_1     | ERROR:  relation "activemq_msgs" already exists
xnat-web_1    | May 31, 2019 4:07:34 PM org.apache.catalina.startup.HostConfig deployDirectory
xnat-db_1     | STATEMENT:  CREATE TABLE ACTIVEMQ_MSGS(ID BIGINT NOT NULL, CONTAINER VARCHAR(250), MSGID_PROD VARCHAR(250), MSGID_SEQ BIGINT, EXPIRATION BIGINT, MSG BYTEA, PRIMARY KEY ( ID ) )
xnat-web_1    | INFO: Deploying web application directory /usr/local/tomcat/webapps/ROOT
xnat-db_1     | ERROR:  current transaction is aborted, commands ignored until end of transaction block
xnat-web_1    | May 31, 2019 4:07:49 PM org.apache.catalina.startup.TldConfig execute
xnat-db_1     | STATEMENT:  CREATE INDEX ACTIVEMQ_MSGS_MIDX ON ACTIVEMQ_MSGS (MSGID_PROD,MSGID_SEQ)
xnat-web_1    | INFO: At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
xnat-db_1     | ERROR:  current transaction is aborted, commands ignored until end of transaction block

here's the full log: https://pastebin.com/vnYgte5N

apologies if this is something dumb I've done or an upstream issue!

[BUG] `nginx:1.12-alpine-perl` image very old

Describe the bug

nginx:1.12-alpine-perl image last updated on DockerHub ~3 years ago. Suggest switching to a tag like nginx:1.19-alpine-perl.

To Reproduce

  1. sudo docker-compose --pull --parallel build
  2. sudo trivy image --severity HIGH,CRITICAL --ignore-unfixed xnat-docker-compose_xnat-nginx:latest
  3. Long list of CVEs presented

Docker server environment (please complete the following information):

  • Host OS: Arch
  • Docker version: 20.10.5
  • docker-compose version: 1.28.5
  • Anything else?

Configuration:

  • Branch of XNAT docker-compose project: master
  • Commit hash or tag: 8534c2f
  • Environment settings: defaults
  • Configuration: defaults

Add xnat/docker-entrypoint.sh to handle tomcat container running as non-root

As of 2d2a350, xnat/Dockerfile uses variables XNAT_UID / XNAT_GID to launch tomcat with arbitrary non-root user. If ./xnat-data/* folders don't already exist, docker-compose will create them with root ownership (designed docker behavior), making them inaccessible to xnat-web container.

A couple alternatives to simply requiring ./xnat-data/* folders exist ahead of time with appropriate ownership:

  1. Always launch xnat-web container as root, but with xnat/docker-entrypoint.sh script to chown ./xnat-data/* folders and then launch tomcat as XNAT_UID.XNAT_GID. Postgres container does this: https://github.com/docker-library/postgres/blob/master/11/alpine/docker-entrypoint.sh
  2. User alternate tomcat container like https://hub.docker.com/r/unidata/tomcat-docker

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.