Uploaded image for project: 'Red Hat Developer Hub Bugs'
  1. Red Hat Developer Hub Bugs
  2. RHDHBUGS-1069

[janus-idp/backstage-plugins] [servicenow] Invalid create record request

XMLWordPrintable

    • False
    • Hide

      None

      Show
      None
    • False
    • Release Note Not Required

      [2451404533] Upstream Reporter: Vinícius Ferraz Campos Florentino
      Upstream issue status: Closed
      Upstream description:

      Describe the bug

      The create record action should include Content-Type header, and the value should be: application/json, application/xml or text/xml

      Response error:

      {"actor":{"actorId":"scaffolder-backend"},"errors":[{"message":"Invalid content-type. Supported request media types for this service are: [application/json, application/xml, text/xml]","name":"Error","stack":"Error: Invalid content-type. Supported request media types for this service are: plication/json, application/xml, text/xml]n at Object.handler (/opt/app-root/src/dynamic-plugins-root/janus-idp-backstage-scaffolder-backend-module-servicenow-dynamic-1.4.14/dist/cjs/index-54073476.cjs.js:703:15)n at process.processTicksAndRejections (node:internal/process/task_queues:95:5)n at async NunjucksWorkflowRunner.executeStep (/opt/app-root/src/node_modules/@backstage/plugin-scaffolder-backend/dist/cjs/router-CDFi_apW.cjs.js:2805:9)n at async NunjucksWorkflowRunner.execute (/ opt/app-root/src/node_modules/@backstage/plugin-scaffolder-backend/dist/cjs/router-CDFi_apW.cjs.js:2928:9)n at async TaskWorker.runOneTask (/opt/app-root/src/node_modules/@backstage/plugin-scaffolder-backend/dist/cjs/router-CDFi_apW.cjs.js:3229:26)n at async run (/opt/app-root/src/node_modules/p-queue/dist/index.js:163:29)"}],"eventName":"S caffolderTaskStepExecution","isAuditLog":true,"level":"error","message":"Step Snow 2 (id: snowCreate) of task 1143cf43-2a64-4b2b-b71b-55933512dfb0 failed","meta":{"isDryRun":false,"stepAction":"servicenow:now:table:createRecord","stepId":"snowCreate","stepName":"Snow 2","taskId":"1143cf43-2a64-4b2b-b71b-55933512dfb0","templateRef":"template:default/quarkus-web- template"},"plugin":"scaffolder","service":"backstage","stage":"completion","status":"failed","timestamp":"2024-08-06 01:22:51"} 

      Expected Behavior

      create the record in service now

      What are the steps to reproduce this bug?

      the correctly curl command it's

      curl "https://ven05429.service-now.com/api/now/table/u_pessoa" 
      --request POST 
      --header "Accept:application/json" 
      --header "Content-Type:application/json" 
      --data "{"name": "Vinicius"}" 
      --user 'admin':'admin'

      However if you remove the Content-Type the response will be:

      {"error":{"message":"Invalid content-type. Supported request media types for this service are: [application/json, application/xml, text/xml]","detail":null},"status":"failure"}%

      Versions of software used and environment

      RHDH version 1.2 and janus-idp-backstage-scaffolder-backend-module-servicenow-dynamic 1.4.14


      Upstream URL: https://github.com/janus-idp/backstage-plugins/issues/2011

              Unassigned Unassigned
              upstream-sync Upstream Sync
              RHIDP - Plugins
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: