WoozyMasta / archimate-ci-image

Archi container image for use in continuous integration pipelines
https://woozymasta.github.io/archimate-ci-image-example/?view=6213
MIT License
40 stars 23 forks source link

jenkins run with docker issue "Error spawning command line ?dbus-launch" error #19

Open Damounet opened 7 months ago

Damounet commented 7 months ago

Hello,

I am running the image with the jenkins of the company and i end with this error.

It seems that everything is running fine, besides that when the Archi app is starting, it looks for something with dbus and trying to run a gnome or xfce thing. And it fails.

+ mkdir -p report/html
+ mkdir -p report/jasper
+ export ARCHI_HTML_REPORT_ENABLED=true
+ export ARCHI_JASPER_REPORT_ENABLED=true
+ export ARCHI_JASPER_REPORT_FORMATS=PDF,DOCX
+ export ARCHI_CSV_REPORT_ENABLED=false
+ export ARCHI_EXPORT_MODEL_ENABLED=true
+ export ARCHI_PROJECT_PATH=/data/jenkins/workspace/workspace/sd_Architecture_Archimate_master
+ export ARCHI_REPORT_PATH=/data/jenkins/workspace/workspace/sd_Architecture_Archimate_master/report
+ export DEBUG=true
+ pwd
/data/jenkins/workspace/workspace/sd_Architecture_Archimate_master
+ ls
?
Dockerfile
Jenkinsfile
config.ini
images
model
org.eclipse.core.runtime
org.eclipse.equinox.app
org.eclipse.osgi
org.eclipse.update
p2
report
reporthtml
reportjasper
+ /opt/Archi/entrypoint.sh
+ set -euo pipefail
+ : /data/jenkins/workspace/workspace/sd_Architecture_Archimate_master
+ : /data/jenkins/workspace/workspace/sd_Architecture_Archimate_master/report
+ : true
+ : true
+ : PDF,DOCX
+ : false
+ : true
+ : com.archimatetool.commandline.app
+ : https://github.com/
+ : gh-pages
+ : .archi_report
+ _ssh_args=('-o' 'BatchMode=yes' '-o' 'UserKnownHostsFile=/dev/null' '-o' 'StrictHostKeyChecking=no')
+ declare -a _ssh_args
+ GIT_SSH_COMMAND='ssh -o BatchMode=yes -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no'
+ GIT_TERMINAL_PROMPT=0
+ DISPLAY=:1
+ export GIT_SSH_COMMAND GIT_TERMINAL_PROMPT DISPLAY
+ _re_url='([\w.@\:/~\-]+)(\.git)(\/)?'
+ _re_proto_http='(http(s)?(:(\/){0,3}))?'
+ _re_proto_ssh='((((git|user)@[\w.-]+)|(git|ssh))(:(\/){0,3}))'
+ '[' 0 -ge 1 ']'
+ '[' -f /data/jenkins/workspace/workspace/sd_Architecture_Archimate_master/model/folder.xml ']'
++ grep -Pom1 'name="\K([^"]*)' /data/jenkins/workspace/workspace/sd_Architecture_Archimate_master/model/folder.xml
++ head -1
+ _project=ASD
+ '[' '' == true ']'
+ '[' '' == true ']'
+ '[' -f /data/jenkins/workspace/workspace/sd_Architecture_Archimate_master/model/folder.xml ']'
+ echo 'Work with exist model in /data/jenkins/workspace/workspace/sd_Architecture_Archimate_master directory'
Work with exist model in /data/jenkins/workspace/workspace/sd_Architecture_Archimate_master directory
+ git -C /data/jenkins/workspace/workspace/sd_Architecture_Archimate_master pull
+ :
+ archi_run
+ _args=()
+ local -a _args
+ '[' true == true ']'
+ _args+=(--html.createReport "${ARCHI_HTML_REPORT_PATH:=$ARCHI_REPORT_PATH/html}")
+ '[' false == true ']'
+ '[' true == true ']'
+ _args+=(--saveModel "${ARCHI_EXPORT_MODEL_PATH:=$ARCHI_REPORT_PATH}/$_project.archimate")
+ '[' true == true ']'
+ _args+=(--jasper.createReport "${ARCHI_JASPER_REPORT_PATH:=$ARCHI_REPORT_PATH/jasper}" --jasper.format "$ARCHI_JASPER_REPORT_FORMATS" --jasper.filename "$_project" --jasper.title "${ARCHI_JASPER_REPORT_TITLE:=$_project}")
+ xvfb-run /opt/Archi/Archi -application com.archimatetool.commandline.app -consoleLog -nosplash --modelrepository.loadModel /data/jenkins/workspace/workspace/sd_Architecture_Archimate_master --html.createReport /data/jenkins/workspace/workspace/sd_Architecture_Archimate_master/report/html --saveModel /data/jenkins/workspace/workspace/sd_Architecture_Archimate_master/report/ASD.archimate --jasper.createReport /data/jenkins/workspace/workspace/sd_Architecture_Archimate_master/report/jasper --jasper.format PDF,DOCX --jasper.filename ASD --jasper.title ASD
WARNING: Using incubator modules: jdk.incubator.foreign, jdk.incubator.vector
SWT SessionManagerDBus: Failed to connect to org.gnome.SessionManager: Error spawning command line ?dbus-launch --autolaunch=cd0e52a8ff461c63a46cb6b4645a901b --binary-syntax --close-stderr?: Child process exited with code 1
SWT SessionManagerDBus: Failed to connect to org.xfce.SessionManager: Error spawning command line ?dbus-launch --autolaunch=cd0e52a8ff461c63a46cb6b4645a901b --binary-syntax --close-stderr?: Child process exited with code 1
java.io.IOException: Model was not loaded
    at com.archimatetool.jasperreports.commandline.JasperReportsProvider.run(JasperReportsProvider.java:64)
    at com.archimatetool.commandline.CentralScrutinizer.runProviderOptions(CentralScrutinizer.java:164)
    at com.archimatetool.commandline.CentralScrutinizer.start(CentralScrutinizer.java:82)
    at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:203)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:136)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:402)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:255)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.base/java.lang.reflect.Method.invoke(Unknown Source)
    at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:659)
    at org.eclipse.equinox.launcher.Main.basicRun(Main.java:596)
    at org.eclipse.equinox.launcher.Main.run(Main.java:1467)
    at org.eclipse.equinox.launcher.Main.main(Main.java:1440)
java.io.IOException: Model was not loaded
    at com.archimatetool.reports.commandline.HTMLReportProvider.run(HTMLReportProvider.java:66)
    at com.archimatetool.commandline.CentralScrutinizer.runProviderOptions(CentralScrutinizer.java:164)
    at com.archimatetool.commandline.CentralScrutinizer.start(CentralScrutinizer.java:82)
    at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:203)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:136)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:402)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:255)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.base/java.lang.reflect.Method.invoke(Unknown Source)
    at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:659)
    at org.eclipse.equinox.launcher.Main.basicRun(Main.java:596)
    at org.eclipse.equinox.launcher.Main.run(Main.java:1467)
    at org.eclipse.equinox.launcher.Main.main(Main.java:1440)
java.io.IOException: Model not set
    at com.archimatetool.commandline.providers.SaveModelProvider.run(SaveModelProvider.java:60)
    at com.archimatetool.commandline.CentralScrutinizer.runProviderOptions(CentralScrutinizer.java:164)
    at com.archimatetool.commandline.CentralScrutinizer.start(CentralScrutinizer.java:82)
    at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:203)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:136)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:402)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:255)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.base/java.lang.reflect.Method.invoke(Unknown Source)
    at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:659)
    at org.eclipse.equinox.launcher.Main.basicRun(Main.java:596)
    at org.eclipse.equinox.launcher.Main.run(Main.java:1467)
    at org.eclipse.equinox.launcher.Main.main(Main.java:1440)
+ printf '\n%s\n\n' 'Done. Reports saved to /data/jenkins/workspace/workspace/sd_Architecture_Archimate_master/report'

Done. Reports saved to /data/jenkins/workspace/workspace/sd_Architecture_Archimate_master/report

+ exit 0

The host does not have the dbus lib installed, I don't know if that can be a problem. The model is generating the html if I try to build it on my WSL ubuntu in local. I really don't know what can be missing, especially as it's running with docker and that normaly, it can't be related to anything on the host. I don't have a clue on what to do or what to tell the devops team to help me debug that.

I know that it might be a question for the Archimate forum but i'd give it a try here too.

5-tom commented 6 months ago

Errors like SWT SessionManagerDBus: Failed to connect to org.xfce.SessionManager are usually the result of failing to run Archi headless. Check out this: https://github.com/archimatetool/archi/wiki/Archi-Command-Line-Interface#running-on-linux-without-graphics-headless .