-
Notifications
You must be signed in to change notification settings - Fork 122
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
During CI Pipeline mvn clean package fails creating HTML in target/generated-docs #565
Comments
That path is suspicious file:/home/jenkins/agent/workspace/labdocs/repo/open-uri-cached-0.0.5.gemspec. It belongs to one of the gems embedded within AsciidoctorJ jar. Is the build setting the gempath? Also, it should not affect, but just in case can you validate if Jenkins is setting GEM_HOME environment variable in the build? |
I dumped the ENV and did not see GEM_HOME or anything related to Ruby, Gems, etc. I can set GEM_HOME prior to the goal but I don't know what the path should be. |
You should not. But I wonder how is the path being injected. @robertpanzer do you know how this could be getting into asciidoctorj? |
Sorry, no real idea why it should be looking at the file system if GEM_HOME is not set. |
I create this path |
Just chiming in as I am having a very similar issue with the plugin when running as part of a Jenkins CI pipeline: Failed to execute goal org.asciidoctor:asciidoctor-maven-plugin:2.2.2:process-asciidoc (convert-to-html) on project measures_cases: Execution convert-to-html of goal org.asciidoctor:asciidoctor-maven-plugin:2.2.2:process-asciidoc failed: (ENOENT) No such file or directory - file:/var/lib/jenkins/workspace/res_cases_bugfix_reports-jenkins/ruby-rc4-0.1.5.gemspec: (LoadError) no such file to load -- asciidoctor -> [Help 1] Also like above, I am not altering the gempath in any way, and when dumping the env vars, no references to gempath or gemhome can be found |
@ciano1000 Can you run maven with |
Is it possible to see your pom.xml file? Do you have declare some dependencies for the asciidoctor-maven-plugin? Can you paste your tree of project repository, maybe you use some special features from asciidoctor-intellij plugin to support preview of asciidoc content via special extension's? |
I ran into a similar issue with my Gradle build and thought others might find this helpful. This was my original error: I turned on debug for the build and saw classpath paths like this: With that - I found that the '?' in the path was a result of not setting GRADLE_USER_HOME. I added this to my startup script along with the JVM argument '-Dfile.encoding=UTF-8' and the build now succeeds in Jenkins. This is the final command I used in the Jenkinsfile: I suppose the GRADLE_USER_HOME variable is not used by Maven but seems like a similar pathing issue. |
Also having this issue in Jenkins Ci pipeline. The build is running in a Maven docker image FROM maven:3.8.5-openjdk-11 [ERROR] Failed to execute goal org.asciidoctor:asciidoctor-maven-plugin:2.2.4:process-asciidoc (output-html) on project api: Execution output-html of goal org.asciidoctor:asciidoctor-maven-plugin:2.2.4:process-asciidoc failed: (ENOENT) No such file or directory - file:/var/jenkins/workspace/merge-request_MR-1654/Ascii85-1.1.0.gemspec: (LoadError) no such file to load -- asciidoctor "/var/jenkins/workspace/merge-request_MR-1654/" is the base path for the Jenkins workspace where build is run from. MAVEN_HOME is set and JAVA_HOME is set. GEM_HOME is not set. Any ideas to get this working? Plugin configurations in the pom
Error stack trace
|
@Datascan-Michael can you provide full logs with Also, can you explain a bit this reference to a |
merge-request_MR-1654 is the folder that was dynamically generated by Jenkins where the project was cloned and the ci pipeline is run from. I too suspect that there is something missing in the environment as this issue only happens when run thru the CI pipeline where the build is run inside the docker image I mentioned in my original comment. I don't know what it could be. Running maven on my computer the process completes successfully. I'll see what I can do about getting a full log but it probably reveals too much about our specific project. I'll attempt a simplified version and see what I can come up with. Until then... maybe some helpful information... [2023-11-02T15:41:59.473Z] Apache Maven 3.8.5 (3599d3414f046de2324203b78ddcf9b5e4388aa0) |
I tracked this down and have it working now. Buckle up since I'm going to provide a lot of details about Jenkins and how it runs docker build agents but ultimately, I think you can close this bug as I don't think it's directly related to asciidoctor-maven-plugin. By default Jenkins will run docker build agents using its user id 1000. You see something like "docker run -u 1000:1000" in the build log where it starts up the docker image for the build agent. If that build image doesn't have a user 1000 or that user doesn't have a home directory for the local maven repository to be created in, then this issue happens because the parts deep in jRuby can't figure out where the local maven repository is to be able to load the necessary gems in a jar. With maven debug turned on you should see something like "[DEBUG] Using local repository at /var/jenkins/workspace/merge-request_MR-1662/?/.m2/repository" where it's setting the local repository to a path in the workspace but note the "?" in the path. It seems that the rest of maven can deal with this in the path just fine and the normal maven builds and java compile will work just fine. I tried all three of these options and the all resulted in successful runs of the asciidoctor-maven-plugin. |
Thank you for taking your time to talk with us!
What is this issue about?
I can build my asciidoc rendering (HTML) locally using mvn clean package, however in my Jenkins pipeline the same call fails. After download of all dependencies (no local .m2/ cache) the mvn goal fails.
Description
Here's the actual error in my pipeline console log.
[INFO] --- asciidoctor-maven-plugin:2.1.0:process-asciidoc (asciidoc-to-html) @ labdocs ---
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 6.983 s
[INFO] Finished at: 2022-01-11T14:52:32Z
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.asciidoctor:asciidoctor-maven-plugin:2.1.0:process-asciidoc (asciidoc-to-html) on project labdocs: Execution asciidoc-to-html of goal org.asciidoctor:asciidoctor-maven-plugin:2.1.0:process-asciidoc failed: (ENOENT) No such file or directory - file:/home/jenkins/agent/workspace/labdocs/repo/open-uri-cached-0.0.5.gemspec -> [Help 1]
Environment information
Apache Maven 3.5.0 (ff8f5e7444045639af65f6095c62210b5713f426; 2017-04-03T15:39:06-04:00)
Maven home: /Users/dlwhitehurst/Tools/apache-maven-3.5.0
Java version: 11.0.10, vendor: AdoptOpenJDK
Java home: /Library/Java/JavaVirtualMachines/adoptopenjdk-11.jdk/Contents/Home
Default locale: en_US, platform encoding: UTF-8
OS name: "mac os x", version: "10.16", arch: "x86_64", family: "mac"
java --version
openjdk 11.0.10 2021-01-19
OpenJDK Runtime Environment AdoptOpenJDK (build 11.0.10+9)
OpenJDK 64-Bit Server VM AdoptOpenJDK (build 11.0.10+9, mixed mode)
This is frustrating because I do a Dockerfile just after the docs are generated and I want the pipeline to put the image with the docs in my Nexus ready to deploy.
Thanks in advance for any help. I hope this is the right place to address this issue.
The text was updated successfully, but these errors were encountered: