Skip to content
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

Unable to find Allure CommandLine #205

Open
chandrapola opened this issue Apr 20, 2018 · 13 comments
Open

Unable to find Allure CommandLine #205

chandrapola opened this issue Apr 20, 2018 · 13 comments

Comments

@chandrapola
Copy link

chandrapola commented Apr 20, 2018

Issue

Unable to find Allure Command Line

Context

  • Jenkins version: 2.67

  • Job type: Pipeline

  • Allure plugin version:

  • Allure commandline version: 2.4.1

Problem description

Trying to run the Allure report from the Jenkins Pipeline with the below pom.xml entries in the project

<plugin>
         <groupId>io.qameta.allure</groupId>
	<artifactId>allure-maven</artifactId>
	<version>2.8</version>                     
</plugin>
<dependency>
	<groupId>ru.yandex.qatools.allure</groupId>
	<artifactId>allure-testng-adaptor</artifactId>
	<version>1.5.4</version>
</dependency>

We are using the following Allure Configuration Description in the Jenkins File

allure([
		includeProperties: false,
		jdk: '',
		properties: [],
		reportBuildPolicy: 'ALWAYS',
        	results: [[path: 'target/allure-results']]
	])

Logs & Traces

[Pipeline] // node
[Pipeline] End of Pipeline

GitHub has been notified of this commit’s build result

java.io.IOException: Can't find allure commandline <null>
	at ru.yandex.qatools.allure.jenkins.tools.AllureCommandlineInstallation$2.call(AllureCommandlineInstallation.java:63)
	at ru.yandex.qatools.allure.jenkins.tools.AllureCommandlineInstallation$2.call(AllureCommandlineInstallation.java:58)
	at hudson.remoting.UserRequest.perform(UserRequest.java:153)
	at hudson.remoting.UserRequest.perform(UserRequest.java:50)
	at hudson.remoting.Request$2.run(Request.java:336)
	at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:68)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)
	at ......remote call to ansible-rcbuild3(Native Method)
	at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1545)
	at hudson.remoting.UserResponse.retrieve(UserRequest.java:253)
	at hudson.remoting.Channel.call(Channel.java:830)
	at ru.yandex.qatools.allure.jenkins.tools.AllureCommandlineInstallation.getMajorVersion(AllureCommandlineInstallation.java:58)
	at ru.yandex.qatools.allure.jenkins.ReportBuilder.build(ReportBuilder.java:44)
	at ru.yandex.qatools.allure.jenkins.AllureReportPublisher.generateReport(AllureReportPublisher.java:298)
	at ru.yandex.qatools.allure.jenkins.AllureReportPublisher.perform(AllureReportPublisher.java:223)
	at org.jenkinsci.plugins.workflow.steps.CoreStep$Execution.run(CoreStep.java:78)
	at org.jenkinsci.plugins.workflow.steps.CoreStep$Execution.run(CoreStep.java:65)
	at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution$1$1.call(SynchronousNonBlockingStepExecution.java:49)
	at hudson.security.ACL.impersonate(ACL.java:260)
	at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution$1.run(SynchronousNonBlockingStepExecution.java:46)
	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:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)
Finished: FAILURE
@tkzv
Copy link

tkzv commented Apr 27, 2018

Same problem with freestyle project and multi-configuration project. Both for Allure installed in system and by Jenkins. Same versions.

Why can't the plugin use Allure installed in the system? Why does it need to install its own? (Which it fails to do properly.)

@wendywww
Copy link

Is this issue somehow related to my question? webdriverio-boneyard/wdio-allure-reporter#114
If anyone know how to fix it please let me know. Thx!

@klamping
Copy link

I think you can fix this by going to the tool configuration page (/configureTools/) and finding the "allure commandline" section. Then click "Add Allure Commandline" then give it a name and click "install automatically":
image

@taraspos
Copy link

Same problem here. Allure plugin doesn't resolve allure executable from path or ALLURE_HOME it works only if Allure Commandline installation is set :/

@vipinnambiar
Copy link

On the agent configuration setting,set the Allure installation home directory(without the "bin") should resolve this issue. That worked for me.
image

@taraspos
Copy link

@vipinnambiar yeah, I know, this works, but I still believe that it should work without this configuration if ALLURE_HOME is set. Thing is, I have many slaves that are configured automatically with allure installed and I can't use them until this configuration added.

@vipinnambiar
Copy link

Ok. I have only couple of slaves configured and don't have permissions to configure tools installations, they are managed by Devops Admin. Agree to your point, jenkins should resolve this using ALLURE_HOME instead of looking at the setup in tools configuration.

@binbjz
Copy link

binbjz commented Apr 9, 2019

Same problem here. Allure plugin doesn't resolve allure executable from path or ALLURE_HOME it works only if Allure Commandline installation is set :/

@trane9991
I don't know if Allure Commandline installation is set :/, ":/" what this means ?

@taraspos
Copy link

taraspos commented Apr 9, 2019

@binbjz following, on the UI is:

I think you can fix this by going to the tool configuration page (/configureTools/) and finding the "allure commandline" section. Then click "Add Allure Commandline" then give it a name and click "install automatically":
image

@binbjz
Copy link

binbjz commented Apr 9, 2019

@trane9991 I tried this solution, but it doesn't work. Allure version is 2.9.0
image

@wendywww
Copy link

@binbjz Is your jenkins job run with pipeline file? What i figured is, it needs stash/unstash for the report to be generated. #207

@ingdany
Copy link

ingdany commented Aug 4, 2020

I think you can fix this by going to the tool configuration page (/configureTools/) and finding the "allure commandline" section. Then click "Add Allure Commandline" then give it a name and click "install automatically":
image

Works fine, thank you!

@mshonichev
Copy link

mshonichev commented Oct 28, 2022

somewhat reproduced.

Allure Command line 2.13.7
Allure plugin 2.30.2

Pre conditions: home directories for Jenkins agents and command line Tool Path mismatch, e.g. all hosts have tool home at /home/ci/tools and some agent host have /home/ci/agent/tools.

When configuring allure command line installation with Install automatically and Run shell command, the tool is installed at agent host properly, but when running allure step it breaks with NPE:


Tool Path: /home/ci/tools/ru.yandex.qatools.allure.jenkins.tools.AllureCommandlineInstallation/allure/allure-2.13.7

Installation Shell command

#!/bin/bash

set -x

ALLURE_VERSION=2.13.7
ALLURE_ARCHIVE=allure-commandline-$ALLURE_VERSION.zip

if [[ -f "allure-$ALLURE_VERSION/bin/allure" ]]; then
    echo "allure binary already exists"
else
    echo "cleanup and download $ALLURE_ARCHIVE"
    rm -rfv allure-*
    wget http://***/share/allure/$ALLURE_ARCHIVE
    unzip -q $ALLURE_ARCHIVE 
    rm $ALLURE_ARCHIVE
fi

Installation successful:

2022-10-28 18:38:43  [allure] $ sh -e /home/ci/agent/tools/ru.yandex.qatools.allure.jenkins.tools.AllureCommandlineInstallation/allure/hudson7520593169652667319.sh
2022-10-28 18:38:43  + ALLURE_VERSION=2.13.7
2022-10-28 18:38:43  + ALLURE_ARCHIVE=allure-commandline-2.13.7.zip
2022-10-28 18:38:43  + [[ -f allure-2.13.7/bin/allure ]]
2022-10-28 18:38:43  + echo 'allure binary already exists'

...

Allure step crashes:

2022-10-28 18:38:43  java.io.IOException: Can't find allure commandline <null>
2022-10-28 18:38:43  	at ru.yandex.qatools.allure.jenkins.tools.AllureCommandlineInstallation$GetMajorVersion.call(AllureCommandlineInstallation.java:74)
2022-10-28 18:38:43  	at ru.yandex.qatools.allure.jenkins.tools.AllureCommandlineInstallation$GetMajorVersion.call(AllureCommandlineInstallation.java:65)
2022-10-28 18:38:43  	at hudson.remoting.UserRequest.perform(UserRequest.java:211)
2022-10-28 18:38:43  	at hudson.remoting.UserRequest.perform(UserRequest.java:54)
2022-10-28 18:38:43  	at hudson.remoting.Request$2.run(Request.java:376)
2022-10-28 18:38:43  	at hudson.remoting.InterceptingExecutorService.lambda$wrap$0(InterceptingExecutorService.java:78)
2022-10-28 18:38:43  	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
2022-10-28 18:38:43  	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
2022-10-28 18:38:43  	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
2022-10-28 18:38:43  	at hudson.remoting.Engine$1.lambda$newThread$0(Engine.java:122)
2022-10-28 18:38:43  	at java.base/java.lang.Thread.run(Thread.java:829)

ls -la /home/ci/ at ordinary agent:

-rw-r--r--  1 ci ci  666 Sep 24 23:04 agent.xml
drwxr-xr-x  3 ci   ci   4096 Sep 26 09:54 caches
drwxr-xr-x  4 ci   ci   4096 Sep 24 23:04 remoting
drwxr-xr-x  3 ci   ci   4096 Oct 28 14:31 tools
drwxr-xr-x 24 ci   ci   4096 Oct 28 22:21 workspace

ls -la /home/ci/ at broken agent:

drwxrwxr-x 8 ci   ci      4096 Sep 24 23:04 agent

Seems that plugin resolves configured agent home directory (/home/ci/agent/) for installation, but then crashes trying to find utility by using configured tool path (/home/ci/tools/...)

workaround:
symlinked /home/ci/tools to /home/ci/agent/tools at agent host and NPE disappeared

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants