Skip to content

"%" percent character in pipeline or job name causes display issues #3724

@mockersf

Description

@mockersf

Bug Report

"%" in the pipeline name causes a crash in fly set-pipeline when creating the pipeline. Then the pipeline or its jobs can't be displayed in the UI.
If a job has a "%" in its name, the direct link from the dashboard will fail. When displaying the job, build history will not be displayed.

"%" in pipeline name

> fly -t test set-pipeline -p "percent: %" -c ci/pipeline.yml
[...]

apply configuration? [yN]: y
Could not parse pipelineURL
pipeline created!
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x611626]

goroutine 1 [running]:
net/url.(*URL).ResolveReference(0xc0001fbe80, 0x0, 0x1)
	/usr/local/go/src/net/url/url.go:978 +0x36
github.com/concourse/concourse/fly/commands/internal/setpipelinehelpers.ATCConfig.showPipelineUpdateResult(0x7ffe75e8dee4, 0xa, 0xb322e0, 0xc000244820, 0x7ffe75e8decf, 0x4, 0xc0000acd20, 0x1b, 0x0, 0x1)
	/src/fly/commands/internal/setpipelinehelpers/atc_config.go:110 +0x19a
github.com/concourse/concourse/fly/commands/internal/setpipelinehelpers.ATCConfig.Set(0x7ffe75e8dee4, 0xa, 0xb322e0, 0xc000244820, 0x7ffe75e8decf, 0x4, 0xc0000acd20, 0x1b, 0x0, 0x7ffe75e8def2, ...)
	/src/fly/commands/internal/setpipelinehelpers/atc_config.go:86 +0x38b
github.com/concourse/concourse/fly/commands.(*SetPipelineCommand).Execute(0xfb0200, 0xc00023c2a0, 0x0, 0x7, 0xfb0200, 0x1)
	/src/fly/commands/set_pipeline.go:62 +0x466
github.com/jessevdk/go-flags.(*Parser).ParseArgs(0xc000098f60, 0xc00009c010, 0x7, 0x7, 0x987340, 0xc0002285a0, 0xc0000e3f38, 0x917577, 0xc00011c870)
	/go/pkg/mod/github.com/jessevdk/go-flags@v1.4.0/parser.go:316 +0x80b
github.com/jessevdk/go-flags.(*Parser).Parse(0xc000098f60, 0xa6e26d, 0x8, 0xc00009cc80, 0x0, 0x0)
	/go/pkg/mod/github.com/jessevdk/go-flags@v1.4.0/parser.go:186 +0x71
main.main()
	/src/fly/main.go:24 +0x101

The URL in the UI is http://localhost:8080/teams/main/pipelines/percent:%20% which is not properly URL encoded.

> curl -i 'http://concourse_web_1:8080/api/v1/teams/main/pipelines/percent:%20%' -H 'Cookie: skymarshal_auth="Bearer [...]"'
HTTP/1.1 400 Bad Request
Content-Type: text/plain; charset=utf-8
Connection: close

400 Bad Request

The URL should be http://localhost:8080/teams/main/pipelines/percent%3A%20%25

"%" in job name

with the following pipeline:

jobs:
  - name: "percent: %"
    plan:
      - task: hello-world
        config:
          platform: linux
          image_resource:
            type: docker-image
            source: {repository: busybox}
          run:
            path: ls

The URL for the job in the dashboard is http://localhost:8080/teams/main/pipelines/my-pipeline/jobs/percent:%20% which is not properly URL encoded.
From the pipeline screen, the job URL is http://localhost:8080/teams/main/pipelines/my-pipeline/jobs/percent%3A%20%25 which is good, but it tries to load build history from the URL http://localhost:8080/api/v1/teams/main/pipelines/my-pipeline/jobs/percent:%20%/builds which fails.

Version Info

  • Concourse version: 5.0.0 and master
  • Deployment type (BOSH/Docker/binary): docker
  • Infrastructure/IaaS:
  • Browser (if applicable): Firefox, Chrome and Safari
  • Did this used to work? I don't know

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions