jenkinsci / allure-plugin

Allure Jenkins Plugin
https://plugins.jenkins.io/allure-jenkins-plugin/
Other
84 stars 63 forks source link

allure plugin doesn't work in Jenkins, throws 401 #273

Closed networkandcode closed 3 years ago

networkandcode commented 3 years ago

Issue

Context

Problem description

The allure plugin stopped working a while ago,

Trace here:

java.io.IOException: Server returned HTTP response code: 401 for URL: https://repo.jenkins-ci.org/maven-repo1/io/qameta/allure/allure-commandline/2.13.1/allure-commandline-2.13.1.zip
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1900)
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1498)
    at sun.net.www.protocol.http.HttpURLConnection.getHeaderField(HttpURLConnection.java:3061)
    at java.net.URLConnection.getHeaderFieldLong(URLConnection.java:629)
    at java.net.URLConnection.getContentLengthLong(URLConnection.java:501)
    at java.net.URLConnection.getContentLength(URLConnection.java:485)
    at sun.net.www.protocol.https.HttpsURLConnectionImpl.getContentLength(HttpsURLConnectionImpl.java:412)
    at org.jvnet.robust_http_client.RetryableHttpStream.<init>(RetryableHttpStream.java:90)
Caused: java.io.IOException: Server returned HTTP response code: 401 for URL: https://repo.jenkins-ci.org/maven-repo1/io/qameta/allure/allure-commandline/2.13.1/allure-commandline-2.13.1.zip
    at sun.reflect.GeneratedConstructorAccessor2006.newInstance(Unknown Source)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
    at sun.net.www.protocol.http.HttpURLConnection$10.run(HttpURLConnection.java:1950)
    at sun.net.www.protocol.http.HttpURLConnection$10.run(HttpURLConnection.java:1945)
    at java.security.AccessController.doPrivileged(Native Method)
    at sun.net.www.protocol.http.HttpURLConnection.getChainedException(HttpURLConnection.java:1944)
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1514)
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1498)
    at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:268)
    at org.jvnet.robust_http_client.RetryableHttpStream.getStream(RetryableHttpStream.java:98)
    at org.jvnet.robust_http_client.RetryableHttpStream.<init>(RetryableHttpStream.java:91)
    at org.jvnet.robust_http_client.RetryableHttpStream.<init>(RetryableHttpStream.java:74)
    at hudson.ProxyConfiguration.getInputStream(ProxyConfiguration.java:330)
    at hudson.FilePath.installIfNecessaryFrom(FilePath.java:924)
Caused: java.io.IOException: Failed to install https://repo.jenkins-ci.org/maven-repo1/io/qameta/allure/allure-commandline/2.13.1/allure-commandline-2.13.1.zip to /home/jenkins/agent/tools/ru.yandex.qatools.allure.jenkins.tools.AllureCommandlineInstallation/allure-report
    at hudson.FilePath.installIfNecessaryFrom(FilePath.java:938)
    at hudson.FilePath.installIfNecessaryFrom(FilePath.java:851)
    at hudson.tools.DownloadFromUrlInstaller.performInstallation(DownloadFromUrlInstaller.java:77)
    at hudson.tools.InstallerTranslator.getToolHome(InstallerTranslator.java:69)
    at hudson.tools.ToolLocationNodeProperty.getToolHome(ToolLocationNodeProperty.java:109)
    at hudson.tools.ToolInstallation.translateFor(ToolInstallation.java:206)
    at ru.yandex.qatools.allure.jenkins.tools.AllureCommandlineInstallation.forNode(AllureCommandlineInstallation.java:108)
    at ru.yandex.qatools.allure.jenkins.tools.AllureCommandlineInstallation.forNode(AllureCommandlineInstallation.java:33)
    at ru.yandex.qatools.allure.jenkins.utils.BuildUtils.setUpTool(BuildUtils.java:39)
    at ru.yandex.qatools.allure.jenkins.AllureReportPublisher.getCommandline(AllureReportPublisher.java:353)
    at ru.yandex.qatools.allure.jenkins.AllureReportPublisher.generateReport(AllureReportPublisher.java:303)
    at ru.yandex.qatools.allure.jenkins.AllureReportPublisher.perform(AllureReportPublisher.java:231)
    at jenkins.tasks.SimpleBuildStep.perform(SimpleBuildStep.java:112)
Caused: java.lang.reflect.InvocationTargetException
    at sun.reflect.GeneratedMethodAccessor5831.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.jenkinsci.plugins.workflow.steps.CoreStep$Execution.run(CoreStep.java:92)
    at org.jenkinsci.plugins.workflow.steps.CoreStep$Execution.run(CoreStep.java:70)
    at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution.lambda$start$0(SynchronousNonBlockingStepExecution.java:47)
    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)
Finished: FAILURE
gagarinfan commented 3 years ago

+1

Same here:

Jenkins 2.235.5

Allure plugin version: 2.28.1

Allure commandline version: 2.13.6 and 2.12.1

Is this project still alive?

vanangelov commented 3 years ago

Similarly:

ERROR: Step ‘Allure Report’ aborted due to exception: 
java.io.IOException: Server returned HTTP response code: 401 for URL: https://repo.jenkins-ci.org/maven-repo1/io/qameta/allure/allure-commandline/2.8.1/allure-commandline-2.8.1.zip
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1876)
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1474)
    at sun.net.www.protocol.http.HttpURLConnection.getHeaderField(HttpURLConnection.java:2982)
    at java.net.URLConnection.getHeaderFieldLong(URLConnection.java:629)
    at java.net.URLConnection.getContentLengthLong(URLConnection.java:501)
    at java.net.URLConnection.getContentLength(URLConnection.java:485)
    at sun.net.www.protocol.https.HttpsURLConnectionImpl.getContentLength(HttpsURLConnectionImpl.java:398)
    at org.jvnet.robust_http_client.RetryableHttpStream.<init>(RetryableHttpStream.java:90)
lluisStuart commented 3 years ago

Same here! any workaround?

java.io.IOException: Server returned HTTP response code: 401 for URL: https://repo.jenkins-ci.org/maven-repo1/io/qameta/allure/allure-commandline/2.13.2/allure-commandline-2.13.2.zip at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1900) at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1498) at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:268) at java.net.URL.openStream(URL.java:1068) at hudson.FilePath$Unpack.invoke(FilePath.java:948) at hudson.FilePath$Unpack.invoke(FilePath.java:942) at hudson.FilePath$FileCallableWrapper.call(FilePath.java:3073) at hudson.remoting.UserRequest.perform(UserRequest.java:211) at hudson.remoting.UserRequest.perform(UserRequest.java:54) at hudson.remoting.Request$2.run(Request.java:369) at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72) 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)

vanangelov commented 3 years ago

This has now fixed itself for me, my logs are generating fine now in Jenkins.

networkandcode commented 3 years ago

seems some one's fixed it, thanks :)

Oiuyio commented 3 years ago

Problem is reproducing again. Basic auth on https://repo.jenkins-ci.org/maven-repo1/io/qameta/allure/allure-commandline/2.8.1/allure-commandline-2.8.1.zip

vanangelov commented 3 years ago

Should we reopen this issue (it is currently closed) or open a new one?

Oiuyio commented 3 years ago

Fast solution: Global Tool Configuration -> Allure Commandline -> Add Installer -> Extract .zip/.tar.gz -> https://repo1.maven.org/maven2/io/qameta/allure/allure-commandline/2.13.6/allure-commandline-2.13.6.tgz (or other version you need)

vanangelov commented 3 years ago

I can confirm that the below configuration in the Global Tools works, thanks:

Screen Shot 2020-10-20 at 18 15 03
kpittman-securus commented 3 years ago

I was told in a Jenkins chat that this may have been implemented and may be the cause of the errors: https://groups.google.com/g/jenkins-infra/c/4B_jykZ2wi0

If this is the case, then pointing to maven sounds like the right fix.

networkandcode commented 3 years ago

ok so repo1.maven.org/maven2/ (given manually as mentioned by @vanangelov) .... works but repo.jenkins-ci.org (which is when the mvn central repo option is selected) .... doesn't

jglick commented 3 years ago

See #274.