XNAT docker-compose with dependency management failed

395 views
Skip to first unread message

wenq...@gmail.com

unread,
Jun 3, 2021, 6:59:26 PM6/3/21
to xnat_discussion
Hi All,

I got errors as below:

ruoqing@ruoqing-pc:~$ git clone https://github.com/NrgXnat/xnat-docker-compose
Cloning into 'xnat-docker-compose'...
remote: Enumerating objects: 695, done.
remote: Counting objects: 100% (125/125), done.
remote: Compressing objects: 100% (86/86), done.
remote: Total 695 (delta 58), reused 76 (delta 26), pack-reused 570
Receiving objects: 100% (695/695), 90.72 MiB | 11.00 MiB/s, done.
Resolving deltas: 100% (335/335), done.
ruoqing@ruoqing-pc:~$ cd xnat-docker-compose
ruoqing@ruoqing-pc:~/xnat-docker-compose$ git checkout features/dependency-mgmt
Branch 'features/dependency-mgmt' set up to track remote branch 'features/dependency-mgmt' from 'origin'.
Switched to a new branch 'features/dependency-mgmt'
ruoqing@ruoqing-pc:~/xnat-docker-compose$ ./gradlew composeBuild composeUp

> Task :composeBuild FAILED
xnat-traefik uses an image, skipping
Building xnat-web
dockerfile parse error line 1: FROM requires either one or three arguments

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':composeBuild'.
> Exit-code 1 when calling docker-compose, stdout:

* 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
3 actionable tasks: 3 executed
ruoqing@ruoqing-pc:~/xnat-docker-compose$


Your input is greatly appreciated.
Thank you,
Renjie

wenq...@gmail.com

unread,
Jun 3, 2021, 7:18:35 PM6/3/21
to xnat_discussion
In the dockerfile there are 2"from" as highlighted below:

FROM FROM tomcat:9-jdk8-openjdk-buster
MAINTAINER Matt Kelsey <kel...@wustl.edu>


ARG XNAT_VERSION=${XNAT_VERSION}

ARG XNAT_ROOT=${XNAT_ROOT}

ARG XNAT_HOME=${XNAT_HOME}
ARG XNAT_DATASOURCE_DRIVER=${XNAT_DATASOURCE_DRIVER}

wenq...@gmail.com

unread,
Jun 3, 2021, 7:30:35 PM6/3/21
to xnat_discussion
after modifying the dockerfile, I got:

ruoqing@ruoqing-pc:~/xnat-docker-compose$ ./gradlew composeBuild composeUp

> Task :composeBuild
xnat-traefik uses an image, skipping
Building xnat-web
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/${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' returned a non-zero code: 127

> Task :composeBuild FAILED


FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':composeBuild'.
> Exit-code 1 when calling docker-compose, stdout: Step 1/31 : FROM tomcat:9-jdk8-openjdk-buster
   ---> 7253c7ce0ab9
  Step 2/31 : MAINTAINER Matt Kelsey <kel...@wustl.edu>
   ---> Using cache
   ---> a69805dfded9
  Step 3/31 : ARG XNAT_VERSION=${XNAT_VERSION}
   ---> Using cache
   ---> 4d1e777e8c92
  Step 4/31 : ARG XNAT_ROOT=${XNAT_ROOT}
   ---> Using cache
   ---> 104b1b5ec1ea
  Step 5/31 : ARG XNAT_HOME=${XNAT_HOME}
   ---> Using cache
   ---> 6a5ee2fcd8c2
  Step 6/31 : ARG XNAT_DATASOURCE_DRIVER=${XNAT_DATASOURCE_DRIVER}
   ---> Using cache
   ---> 0217055f373c
  Step 7/31 : ARG XNAT_DATASOURCE_URL=${XNAT_DATASOURCE_URL}
   ---> Using cache
   ---> 113955d23df6
  Step 8/31 : ARG XNAT_DATASOURCE_USERNAME=${XNAT_DATASOURCE_USERNAME}
   ---> Using cache
   ---> 21ae47367726
  Step 9/31 : ARG XNAT_DATASOURCE_PASSWORD=${XNAT_DATASOURCE_PASSWORD}
   ---> Using cache
   ---> f5199c4ac31f
  Step 10/31 : ARG XNAT_WEBAPP_FOLDER=${XNAT_WEBAPP_FOLDER}
   ---> Using cache
   ---> da6f6074fd54
  Step 11/31 : ARG XNAT_EMAIL=${XNAT_EMAIL}
   ---> Using cache
   ---> 6eee17d3b7be
  Step 12/31 : ARG XNAT_ACTIVEMQ_URL=${XNAT_ACTIVEMQ_URL}
   ---> Using cache
   ---> 1cad60e4282a
  Step 13/31 : ARG XNAT_ACTIVEMQ_USERNAME=${XNAT_ACTIVEMQ_USERNAME}
   ---> Using cache
   ---> f4bb8ffb2c99
  Step 14/31 : ARG XNAT_ACTIVEMQ_PASSWORD=${XNAT_ACTIVEMQ_PASSWORD}
   ---> Using cache
   ---> 6505a31e8b80
  Step 15/31 : ARG XNAT_PROCESSING_URL=http://xnat-web:8080
   ---> Using cache
   ---> 0ad7e852c0e1
  Step 16/31 : ARG XNAT_SMTP_ENABLED=${XNAT_SMTP_ENABLED}
   ---> Using cache
   ---> fe633cf0d36e
  Step 17/31 : ARG XNAT_SMTP_HOSTNAME=${XNAT_SMTP_HOSTNAME}
   ---> Using cache
   ---> 589c98c5dcbf
  Step 18/31 : ARG XNAT_SMTP_PORT=${XNAT_SMTP_PORT}
   ---> Using cache
   ---> 97bd66225727
  Step 19/31 : ARG XNAT_SMTP_AUTH=${XNAT_SMTP_AUTH}
   ---> Using cache
   ---> bc40eab0c57a
  Step 20/31 : ARG XNAT_SMTP_USERNAME=${XNAT_SMTP_USERNAME}
   ---> Using cache
   ---> 5a8106370fdb
  Step 21/31 : ARG XNAT_SMTP_PASSWORD=${XNAT_SMTP_PASSWORD}
   ---> Using cache
   ---> 95003a1f3398
  Step 22/31 : ARG XNAT_PIPELINE_ARCHIVE=xnat-pipeline-${XNAT_VERSION}.zip
   ---> Using cache
   ---> f8ce97031ea0
  Step 23/31 : ARG XNAT_PIPELINE_URL=https://ci.xnat.org/job/pipeline/job/xnat-pipeline-engine/lastSuccessfulReleaseBuild/artifact/build/libs/${XNAT_PIPELINE_ARCHIVE}
   ---> Using cache
   ---> ebd321f6f379
  Step 24/31 : ADD make-xnat-config.sh /usr/local/bin/make-xnat-config.sh
   ---> Using cache
   ---> 1ad50d174e25
  Step 25/31 : ADD wait-for-postgres.sh /usr/local/bin/wait-for-postgres.sh
   ---> Using cache
   ---> ff4d208e27c5
  Step 26/31 : ADD ${XNAT_PATH} /webapps
   ---> Using cache
   ---> 4b23c69d3db6
  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 6bf8490d0098
  /bin/sh: 1: apk: not found



* 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 5s
3 actionable tasks: 1 executed, 2 up-to-date
ruoqing@ruoqing-pc:~/xnat-docker-compose$

Herrick, Rick

unread,
Jun 4, 2021, 4:43:36 PM6/4/21
to xnat_di...@googlegroups.com

Sorry Renjie, this was my bad. I missed pushing a commit to that branch. I just tested that commit with this command:

 

$ ./gradlew -PenvFile=test-vars.env fullStackComposeBuild fullStackComposeUp

 

After a couple minutes I had a fresh new XNAT running on http://localhost.

 

-- 

Rick Herrick

XNAT Architect/Developer

Computational Imaging Laboratory

Washington University School of Medicine

 

 

From: xnat_di...@googlegroups.com <xnat_di...@googlegroups.com> on behalf of wenq...@gmail.com <wenq...@gmail.com>
Date: Thursday, June 3, 2021 at 6:30 PM
To: xnat_discussion <xnat_di...@googlegroups.com>
Subject: [XNAT Discussion] Re: XNAT docker-compose with dependency management failed

* External Email - Caution *

--
You received this message because you are subscribed to the Google Groups "xnat_discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to xnat_discussi...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/xnat_discussion/728acde3-05a9-4d6c-b258-7ef7b84818cfn%40googlegroups.com.

 


The materials in this message are private and may contain Protected Healthcare Information or other information of a sensitive nature. If you are not the intended recipient, be advised that any unauthorized use, disclosure, copying or the taking of any action in reliance on the contents of this information is strictly prohibited. If you have received this email in error, please immediately notify the sender via telephone or return mail.

Message has been deleted

wenq...@gmail.com

unread,
Jun 10, 2021, 9:45:29 AM6/10/21
to xnat_discussion
Hi Rick,

Thank you for the help!

While I run ' ./gradlew -PenvFile=test-vars.env fullStackComposeBuild fullStackComposeUp ', I got error as below:

Waiting for TCP socket on 172.21.0.1:8000 of 'xnat-web' (Connection refused (Connection refused))
Will use 172.21.0.1 (network xnat-services) as host of xnat-web
More forwarded TCP ports for service 'xnat-web:8000 [[HostIp:0.0.0.0, HostPort:8000], [HostIp:::, HostPort:8000]]'. Will use the first one.
More forwarded TCP ports for service 'xnat-web:8104 [[HostIp:0.0.0.0, HostPort:8104], [HostIp:::, HostPort:8104]]'. Will use the first one.
More forwarded TCP ports for service 'xnat-web:8144 [[HostIp:0.0.0.0, HostPort:8144], [HostIp:::, HostPort:8144]]'. Will use the first one.
psql: could not connect to server: Connection refused
        Is the server running on host "xnat-db" (172.21.0.2) and accepting
        TCP/IP connections on port 5432?
Postgres is unavailable - sleeping
psql: could not connect to server: Connection timed out
        Is the server running on host "xnat-db" (23.202.231.169) and accepting
        TCP/IP connections on port 5432?
Postgres is unavailable - sleeping
psql: could not connect to server: Connection timed out
        Is the server running on host "xnat-db" (23.221.222.250) and accepting
        TCP/IP connections on port 5432?
Postgres is unavailable - sleeping
psql: could not connect to server: Connection refused
        Is the server running on host "xnat-db" (23.221.222.250) and accepting
        TCP/IP connections on port 5432?
Postgres is unavailable - sleeping
psql: could not connect to server: Connection timed out
        Is the server running on host "xnat-db" (23.221.222.250) and accepting
        TCP/IP connections on port 5432?
Postgres is unavailable - sleeping
psql: could not connect to server: Connection timed out
        Is the server running on host "xnat-db" (23.221.222.250) and accepting
        TCP/IP connections on port 5432?
Postgres is unavailable - sleeping
psql: could not connect to server: Connection timed out
        Is the server running on host "xnat-db" (23.202.231.169) and accepting
        TCP/IP connections on port 5432?
Postgres is unavailable - sleeping
psql: could not connect to server: Connection timed out
        Is the server running on host "xnat-db" (23.202.231.169) and accepting
        TCP/IP connections on port 5432?
Postgres is unavailable - sleeping
Stopping xnat-activemq ...
Stopping xnat-web      ...
Stopping xnat-pacs     ...
Stopping xnat-traefik  ...
Stopping xnat-activemq ... done
Stopping xnat-traefik  ... done
Stopping xnat-web      ... done
Stopping xnat-pacs     ... done
Removing xnat-smtp     ...
Removing xnat-db       ...
Removing xnat-activemq ...
Removing xnat-web      ...
Removing xnat-pacs     ...
Removing xnat-traefik  ...
Removing xnat-pacs     ... done
Removing xnat-db       ... done
Removing xnat-traefik  ... done
Removing xnat-smtp     ... done
Removing xnat-web      ... done
Removing xnat-activemq ... done
Going to remove xnat-smtp, xnat-db, xnat-activemq, xnat-web, xnat-pacs, xnat-traefik

> Task :fullStackComposeUp FAILED


FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':fullStackComposeUp'.
> TCP socket on 172.21.0.1:8000 of 'xnat-web' is still failing. Logs:



* 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 15m 47s
4 actionable tasks: 2 executed, 2 up-to-date
ruoqing@ruoqing-pc:~/xnat-docker-compose$

Thank you,
Renjie

Herrick, Rick

unread,
Jun 15, 2021, 7:39:26 PM6/15/21
to xnat_di...@googlegroups.com

Sorry for not responding earlier, I was on vacation last week.

 

If I had to guess, I’d say that something is already running on port 8000 on your host machine. You can check with the following command (or something like it: this works on OSX and Ubuntu 20.04, not sure how you’d do this on Windows):

 

lsof -i :8000

 

If you can’t do anything about whatever’s blocking that port (or nothing seems to be blocking it), you can also just remove that port mapping. That’s used to connect to Java/Tomcat/XNAT for debugging purposes. If you’re not debugging then you don’t need to map it, so you could remove it. You just need to edit docker-compose.yml to remove references to port 8000. There are only two lines to remove or comment out:

 

  xnat-web:

    container_name: xnat-web

      <snip>

    ports:

      - "8000:8000" <- delete this line

      - "8104:8104"

      - "8144:8144"

      <snip>

    environment:

      CATALINA_OPTS: "-Xms${XNAT_MIN_HEAP} -Xmx${XNAT_MAX_HEAP} -Dxnat.home=${XNAT_HOME} -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=0.0.0.0:8000" <- remove the highlight bit here

      PGPASSWORD: "${XNAT_DATASOURCE_PASSWORD}"

     XNAT_HOME: "${XNAT_HOME}"

 

Presuming that ports 8104 and 8144 aren’t blocked by some other process, that should get the xnat-web container up and running.

 

-- 

Rick Herrick

Sr. Programmer/Analyst

Neuroinformatics Research Group

Washington University School of Medicine

Francis Chemorion

unread,
May 26, 2022, 9:26:29 AM5/26/22
to xnat_discussion
I solved this error by running with sudo
Reply all
Reply to author
Forward
0 new messages