concourse / concourse-pipeline-resource

!!! use the `set_pipeline` step instead !!!
https://concourse-ci.org/jobs.html#schema.step.set-pipeline-step.set_pipeline
MIT License
76 stars 42 forks source link

'latest' concourse-pipeline-resource Docker image cannot log into Concourse v3.14.1 #41

Closed stuart-c-moore closed 5 years ago

stuart-c-moore commented 5 years ago

The latest docker image (updated at around 15:00 UTC 8th August) cannot log into Concourse v3.14.1, showing the following error:

Logging to /tmp/concourse-pipeline-resource-out.log013250056
2018/08/08 15:04:15 exit status 1 - not authorized. run the following to log in:

    fly -t https://***concourse-url*** login

Can the docker images please use appropriate tags, so we can use the versions of the resource appropriate for our version of concourse?

vito commented 5 years ago

Looking into this. The change was supposed to be backwards-compatible with old instances.

vito commented 5 years ago

Can you clarify whether that error is coming from get, put, or the resource check?

felixcontant commented 5 years ago

Tag latest was overridden 6 hours ago on DockerHub.

docker run -it --rm concourse/concourse-pipeline-resource /opt/resource/fly -v

now returns 4.0.0.

A possible fix would be to push the previous latest image with tag v3.14.1.

vito commented 5 years ago

I haven't been able to reproduce the error @migs reported, but I was able to get the following error:

~/w/concourse-pipeline-resource (master) $ docker run --rm -i -t foo
/ # /opt/resource/fly --version
4.0.0
/ # echo '{"source":{"debug":true,"target":"http://10.244.15.2:8080","teams":[{"name":"main","username":"foo","password":"bar"}]}}' | /opt/resource/check
Logging to /tmp/concourse-pipeline-resource-check.log055532294
2018/08/08 19:51:47 exit status 1 - error: unknown flag `json'

This happens because it fly syncs to the v3.14.1 version which doesn't have the --json flag.

I've built a new image, concourse/concourse-pipeline-resource:3 which fixes this, but I haven't tried setting any pipelines yet. I'm at least not seeing the "not authorized" error. Can someone try it out?

vito commented 5 years ago

Also, next time this happens can you hijack the step and dump the logs? They should be in /tmp.

felixcontant commented 5 years ago

I'm still experiencing the error on a put.

Received input: {Source:{Target:https://MY_CONCOURSE.com/ Teams:[{Name:MY_TEAM Username:MY_USER Password:***REDACTED-PASSWORD-TEAM-0***}] Insecure:} Params:{Pipelines:[{Name:MY_PIPELINE ConfigFile:output-pipeline/pipeline.yml VarsFiles:[] TeamName:MY_TEAM Unpaused:false}] PipelinesFile:}}
Input pipelines: [{Name:NEW_PIPELINE ConfigFile:output-pipeline/pipeline.yml VarsFiles:[] TeamName:MY_TEAM Unpaused:false}]                                                                                                                                                                                   
Setting pipelines                                                                                                                                                                                                                                                                                                 
Performing login                                                                                                                                                                                                                                                                                                  
Starting fly command: [-t https://MY_CONCOURSE.com/ login -c https://MY_CONCOURSE.com/ -n MY_TEAM -u MY_USER -p ***REDACTED-PASSWORD-TEAM-0***]                                                                                                                                         
Waiting for fly command: [-t https://MY_CONCOURSE.com/ login -c https://MY_CONCOURSE.com/ -n MY_TEAM -u MY_USER -p ***REDACTED-PASSWORD-TEAM-0***]                                                                                                                                      
Exiting with error: exit status 1 - WARNING:                                                                                                                                                                                                                                                                      

fly version (4.0.0) is out of sync with the target (3.14.1). to sync up, run the following:                                                                                                                                                                                                                       

    fly -t https://MY_CONCOURSE.com/ sync                                                                                                                                                                                                                                                           

error: EOF                                                                                                                                                                                                                                                                                                        

fly sync runs after fly login.

vito commented 5 years ago

Try again? Just pushed a version with an older fly checked in.

We're also now tagging the image with the version of fly that it was built with. So the latest is now additionally tagged with 4.0.0.

felixcontant commented 5 years ago

It's working.

Thanks!

felixcontant commented 5 years ago

For others experiencing the issue, update your resource_type.

resource_types:
  - name: concourse-pipeline
    type: docker-image
    source:
      repository: concourse/concourse-pipeline-resource
      tag: 3
colmtuohy commented 5 years ago

Similar issue, as per https://discuss.concourse-ci.org/t/concourse-pipeline-resource/442. Worked around it by pulling the older tagged image.. Will gather logs from failing task if needed, we just use it to set pipeline

vito commented 5 years ago

@felixcontant Thanks for confirming! I'll close this out then.

trobert2 commented 5 years ago

I am glad to have finally found this issue and the fix for it. Is there any chance we can better document this?

boyan-velinov commented 5 years ago

Do you plan to make a fix in latest tag to avoid such workarounds? This makes the whole funcionality broken because it is not documented in README file...

pears0 commented 4 years ago

We are now seeing this issue on tag 3, which was meant to be the work around. I also see that tag 3 image was update 13 days ago. Is it possible the issue has been introduced in tag 3 again?