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

Env vars with '.' in the name fail sending to ElasticSearch

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • logstash-plugin
    • None
    • Jenkins Core 2.190.1
      Logstash Plugin 2.3.1

      I came across an error like this: 

      [logstash-plugin]: Failed to send log data: <URL>
      [logstash-plugin]: No Further logs will be sent to <URL>
      java.io.IOException: HTTP error code: 400
      RESPONSE: HttpResponseProxy{HTTP/1.1 400 Bad Request [content-type: application/json; charset=UTF-8] org.apache.http.client.entity.DecompressingEntity@3a22308c}
      {"error":{"root_cause":[{"type":"illegal_argument_exception","reason":"mapper [data.buildVariables.Foo] of different type, current_type [text], merged_type [ObjectMapper]"}],"type":"illegal_argument_exception","reason":"mapper [data.buildVariables.Foo] of different type, current_type [text], merged_type [ObjectMapper]"},"status":400}
      at jenkins.plugins.logstash.persistence.ElasticSearchDao.push(ElasticSearchDao.java:190)
      at jenkins.plugins.logstash.LogstashWriter.write(LogstashWriter.java:172)
      at jenkins.plugins.logstash.LogstashWriter.writeBuildLog(LogstashWriter.java:137)
      at jenkins.plugins.logstash.pipeline.LogstashSendStep$Execution.run(LogstashSendStep.java:77)
      at jenkins.plugins.logstash.pipeline.LogstashSendStep$Execution.run(LogstashSendStep.java:54)

      Doing some investigation I found that one of our plugins was adding an environment variable with "." in the name like "foo.bar".  When I removed those environment variables it fixed the issue.  I believe the logstash plugin could and probably should handle this case in a more graceful way - even if just erroring and saying the variable that can't be sent to Elastic.  Or more advanced might be replacing the "." with something else so it just works.

          [JENKINS-59941] Env vars with '.' in the name fail sending to ElasticSearch

            Unassigned Unassigned
            wbrode William Brode
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: