Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-67519

Token required for authentication with influxdb 2.1.1

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Blocker Blocker
    • influxdb-plugin
    • None
    • Jenkins 2.319.1, InfluxDB Plugin 3.0.2

      Since we updated to influxdb 2.1.1 the plugin stopped reporting events to influxdb.

      The following error can be found in our jenkins logs whenever an event should be pushed to influxdb:

      2022-01-06 07:39:14.384+0000 [id=37596]	WARNING	h.model.listeners.RunListener#report: RunListener failed
      com.influxdb.exceptions.UnauthorizedException: unauthorized access
      	at com.influxdb.internal.AbstractRestClient.responseToError(AbstractRestClient.java:98)
      	at com.influxdb.internal.AbstractRestClient.execute(AbstractRestClient.java:81)
      	at com.influxdb.client.internal.WriteApiBlockingImpl.write(WriteApiBlockingImpl.java:235)
      	at com.influxdb.client.internal.WriteApiBlockingImpl.lambda$writePoints$1(WriteApiBlockingImpl.java:152)
      	at java.base/java.util.LinkedHashMap.forEach(LinkedHashMap.java:684)
      	at com.influxdb.client.internal.WriteApiBlockingImpl.writePoints(WriteApiBlockingImpl.java:152)
      	at com.influxdb.client.internal.WriteApiBlockingImpl.writePoints(WriteApiBlockingImpl.java:136)
      	at jenkinsci.plugins.influxdb.InfluxDbPublicationService.writeToInflux(InfluxDbPublicationService.java:361)
      Caused: jenkinsci.plugins.influxdb.InfluxReportException
      	at jenkinsci.plugins.influxdb.InfluxDbPublicationService.writeToInflux(InfluxDbPublicationService.java:364)
      	at jenkinsci.plugins.influxdb.InfluxDbPublicationService.perform(InfluxDbPublicationService.java:301)
      	at jenkinsci.plugins.influxdb.global.GlobalRunListener.onCompleted(GlobalRunListener.java:75)
      	at hudson.model.listeners.RunListener.fireCompleted(RunListener.java:208)
      	at org.jenkinsci.plugins.workflow.job.WorkflowRun.finish(WorkflowRun.java:625)
      	at org.jenkinsci.plugins.workflow.job.WorkflowRun.access$800(WorkflowRun.java:138)
      	at org.jenkinsci.plugins.workflow.job.WorkflowRun$GraphL.onNewHead(WorkflowRun.java:1045)
      	at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.notifyListeners(CpsFlowExecution.java:1473)
      	at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$3.run(CpsThreadGroup.java:491)
      	at org.jenkinsci.plugins.workflow.cps.CpsVmExecutorService$1.run(CpsVmExecutorService.java:38)
      	at hudson.remoting.SingleLaneExecutorService$1.run(SingleLaneExecutorService.java:139)
      	at jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:28)
      	at jenkins.security.ImpersonatingExecutorService$1.run(ImpersonatingExecutorService.java:68)
      	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
      	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
      	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
      	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
      	at java.base/java.lang.Thread.run(Thread.java:829)
      

      at the same time the following error can be found in the influxdb log:

      ts=2022-01-06T07:44:11.169611Z lvl=debug msg=Request log_id=0YsTKpqW000 service=http method=POST host=myhost path=/api/v2/signin query= proto=HTTP/1.1 status_code=204 response_size=0 content_length=0 referrer= remote=10.141.4.1:33740 user_agent=influxdb-client-java took=63.624ms
      ts=2022-01-06T07:44:11.172385Z lvl=info msg=Unauthorized log_id=0YsTKpqW000 error="token required"
      ts=2022-01-06T07:44:11.172458Z lvl=debug msg=Request log_id=0YsTKpqW000 service=http method=POST host=myhost path=/api/v2/write query="bucket=jenkins&org=Myorg&precision=ns" proto=HTTP/1.1 status_code=401 response_size=55 content_length=654 referrer= remote=10.141.4.1:33740 user_agent=influxdb-client-java took=0.117ms error=unauthorized error_code=unauthorized
      ts=2022-01-06T07:44:11.173602Z lvl=error msg="api error encountered" log_id=0YsTKpqW000 handler=session error="unauthorized access"
      

      It seems that authentication via token is now required and the plugin needs to support this.

            aleksisimell Aleksi Simell
            pmr Philipp Moeller
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: