{"action":"created","issue":{"url":"https://api.github.com/repos/codeship/jet-tutorial/issues/8","repository_url":"https://api.github.com/repos/codeship/jet-tutorial","labels_url":"https://api.github.com/repos/codeship/jet-tutorial/issues/8/labels{/name}","comments_url":"https://api.github.com/repos/codeship/jet-tutorial/issues/8/comments","events_url":"https://api.github.com/repos/codeship/jet-tutorial/issues/8/events","html_url":"https://github.com/codeship/jet-tutorial/issues/8","id":138267464,"number":8,"title":"Weird intermittent issue with cache","user":{"login":"kreisys","id":1857338,"avatar_url":"https://avatars.githubusercontent.com/u/1857338?v=3","gravatar_id":"","url":"https://api.github.com/users/kreisys","html_url":"https://github.com/kreisys","followers_url":"https://api.github.com/users/kreisys/followers","following_url":"https://api.github.com/users/kreisys/following{/other_user}","gists_url":"https://api.github.com/users/kreisys/gists{/gist_id}","starred_url":"https://api.github.com/users/kreisys/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kreisys/subscriptions","organizations_url":"https://api.github.com/users/kreisys/orgs","repos_url":"https://api.github.com/users/kreisys/repos","events_url":"https://api.github.com/users/kreisys/events{/privacy}","received_events_url":"https://api.github.com/users/kreisys/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-03-03T19:00:51Z","updated_at":"2016-03-03T23:37:00Z","closed_at":null,"body":"This has been baffling me for several days now. Using a cached service, jet intermittently tries to pull the :latest tag instead of the :codeship-cache-{branch} tag. Since I don't push the :latest tag to the registry I end up with intermittent failures that seem very much random:\r\n\r\n```\r\n$ docker rmi myregistry.com/myapp:{latest,codeship-cache-master} ; jet steps --ci-branch=master\r\nError response from daemon: could not find image: no such id: myregistry.com/myapp:latest\r\nError response from daemon: could not find image: no such id: myregistry.com/myapp:codeship-cache-master\r\nError: failed to remove images: [myregistry.com/myapp:latest myregistry.com/myapp:codeship-cache-master]\r\n{StepStarted=step_name:\"Build myapp image\"}\r\n{PullImageStarted=image_name:\"myregistry.com/myapp\" service_name:\"myapp_build\"}\r\n{StepFinished=step_name:\"Build myapp image\" type:STEP_FINISHED_TYPE_ERROR}\r\nError: image myapp:latest not found\r\n\r\n$ docker rmi myregistry.com/myapp:{latest,codeship-cache-master} ; jet steps --ci-branch=master\r\nError response from daemon: could not find image: no such id: myregistry.com/myapp:latest\r\nError response from daemon: could not find image: no such id: myregistry.com/myapp:codeship-cache-master\r\nError: failed to remove images: [myregistry.com/myapp:latest myregistry.com/myapp:codeship-cache-master]\r\n{StepStarted=step_name:\"Build myapp image\"}\r\n{PullImageStarted=image_name:\"myregistry.com/myapp\" service_name:\"myapp_build\"}\r\n{StepFinished=step_name:\"Build myapp image\" type:STEP_FINISHED_TYPE_ERROR}\r\nError: image myapp:latest not found\r\n\r\n$ docker rmi myregistry.com/myapp:{latest,codeship-cache-master} ; jet steps --ci-branch=master\r\nError response from daemon: could not find image: no such id: myregistry.com/myapp:latest\r\nError response from daemon: could not find image: no such id: myregistry.com/myapp:codeship-cache-master\r\nError: failed to remove images: [myregistry.com/myapp:latest myregistry.com/myapp:codeship-cache-master]\r\n{StepStarted=step_name:\"Build myapp image\"}\r\n{PullImageStarted=image_name:\"myregistry.com/myapp\" service_name:\"myapp_build\"}\r\n{StepFinished=step_name:\"Build myapp image\" type:STEP_FINISHED_TYPE_ERROR}\r\nError: image myapp:latest not found\r\n\r\n$ docker rmi myregistry.com/myapp:{latest,codeship-cache-master} ; jet steps --ci-branch=master\r\nError response from daemon: could not find image: no such id: myregistry.com/myapp:latest\r\nError response from daemon: could not find image: no such id: myregistry.com/myapp:codeship-cache-master\r\nError: failed to remove images: [myregistry.com/myapp:latest myregistry.com/myapp:codeship-cache-master]\r\n{StepStarted=step_name:\"Build myapp image\"}\r\n{PullImageStarted=image_name:\"myregistry.com/myapp\" service_name:\"myapp_build\"}\r\n{StepFinished=step_name:\"Build myapp image\" type:STEP_FINISHED_TYPE_ERROR}\r\nError: image myapp:latest not found\r\n\r\n$ docker rmi myregistry.com/myapp:{latest,codeship-cache-master} ; jet steps --ci-branch=master\r\nError response from daemon: could not find image: no such id: myregistry.com/myapp:latest\r\nError response from daemon: could not find image: no such id: myregistry.com/myapp:codeship-cache-master\r\nError: failed to remove images: [myregistry.com/myapp:latest myregistry.com/myapp:codeship-cache-master]\r\n{StepStarted=step_name:\"Build myapp image\"}\r\n{PullImageStarted=image_name:\"myregistry.com/myapp:codeship-cache-master\" service_name:\"myapp_build\"}\r\n{PullImageFinished=image_name:\"myregistry.com/myapp:codeship-cache-master\" service_name:\"myapp_build\"}\r\n{BuildImageStarted=image_name:\"myregistry.com/myapp\" service_name:\"myapp_build\"}\r\n{BuildImageStdout=image_name:\"myregistry.com/myapp\" service_name:\"myapp_build\"}: Step 1 : FROM node:4.2.3\r\n{BuildImageStdout=image_name:\"myregistry.com/myapp\" service_name:\"myapp_build\"}:  ---> 14aadd36ad0c\r\n{BuildImageStdout=image_name:\"myregistry.com/myapp\" service_name:\"myapp_build\"}: Step 2 : MAINTAINER Me\r\n{BuildImageStdout=image_name:\"myregistry.com/myapp\" service_name:\"myapp_build\"}:  ---> Using cache\r\n{BuildImageStdout=image_name:\"myregistry.com/myapp\" service_name:\"myapp_build\"}:  ---> 85162f600fc1\r\n{BuildImageStdout=image_name:\"myregistry.com/myapp\" service_name:\"myapp_build\"}: Successfully built 85162f600fc1\r\n{PushImageStarted=step_name:\"Build myapp image\" service_name:\"myapp_build\" image_name:\"myregistry.com/myapp\"}\r\n{PushImageStdout=step_name:\"Build myapp image\" service_name:\"myapp_build\" image_name:\"myregistry.com/myapp\"}: The push refers to a repository [myregistry.com/myapp] (len: 1)\r\n{PushImageStdout=step_name:\"Build myapp image\" service_name:\"myapp_build\" image_name:\"myregistry.com/myapp\"}: Image already exists\r\n{PushImageStdout=step_name:\"Build myapp image\" service_name:\"myapp_build\" image_name:\"myregistry.com/myapp\"}: Image already exists\r\n{PushImageStdout=step_name:\"Build myapp image\" service_name:\"myapp_build\" image_name:\"myregistry.com/myapp\"}: Image already exists\r\n{PushImageStdout=step_name:\"Build myapp image\" service_name:\"myapp_build\" image_name:\"myregistry.com/myapp\"}: Image already exists\r\n{PushImageStdout=step_name:\"Build myapp image\" service_name:\"myapp_build\" image_name:\"myregistry.com/myapp\"}: Image already exists\r\n{PushImageStdout=step_name:\"Build myapp image\" service_name:\"myapp_build\" image_name:\"myregistry.com/myapp\"}: Image already exists\r\n{PushImageStdout=step_name:\"Build myapp image\" service_name:\"myapp_build\" image_name:\"myregistry.com/myapp\"}: Image already exists\r\n{PushImageStdout=step_name:\"Build myapp image\" service_name:\"myapp_build\" image_name:\"myregistry.com/myapp\"}: codeship-cache-master: digest: sha256:bb461ab189138c02d674bb35b50220961c6c1acef3b229cb834cabc708092f76 size: 18846\r\n{PushImageFinished=step_name:\"Build myapp image\" service_name:\"myapp_build\" image_name:\"myregistry.com/myapp\"}\r\n{BuildImageFinished=image_name:\"myregistry.com/myapp\" service_name:\"myapp_build\"}\r\n{StepFinished=step_name:\"Build myapp image\" type:STEP_FINISHED_TYPE_SUCCESS}\r\n\r\n$ docker rmi myregistry.com/myapp:{latest,codeship-cache-master} ; jet steps --ci-branch=master\r\nUntagged: myregistry.com/myapp:latest\r\nUntagged: myregistry.com/myapp:codeship-cache-master\r\n{StepStarted=step_name:\"Build myapp image\"}\r\n{PullImageStarted=image_name:\"myregistry.com/myapp\" service_name:\"myapp_build\"}\r\n{StepFinished=step_name:\"Build myapp image\" type:STEP_FINISHED_TYPE_ERROR}\r\nError: image myapp:latest not found\r\n\r\n$ docker rmi myregistry.com/myapp:{latest,codeship-cache-master} ; jet steps --ci-branch=master\r\nError response from daemon: could not find image: no such id: myregistry.com/myapp:latest\r\nError response from daemon: could not find image: no such id: myregistry.com/myapp:codeship-cache-master\r\nError: failed to remove images: [myregistry.com/myapp:latest myregistry.com/myapp:codeship-cache-master]\r\n{StepStarted=step_name:\"Build myapp image\"}\r\n{PullImageStarted=image_name:\"myregistry.com/myapp:codeship-cache-master\" service_name:\"myapp_build\"}\r\n{PullImageFinished=image_name:\"myregistry.com/myapp:codeship-cache-master\" service_name:\"myapp_build\"}\r\n{BuildImageStarted=image_name:\"myregistry.com/myapp\" service_name:\"myapp_build\"}\r\n{BuildImageStdout=image_name:\"myregistry.com/myapp\" service_name:\"myapp_build\"}: Step 1 : FROM node:4.2.3\r\n{BuildImageStdout=image_name:\"myregistry.com/myapp\" service_name:\"myapp_build\"}:  ---> 14aadd36ad0c\r\n{BuildImageStdout=image_name:\"myregistry.com/myapp\" service_name:\"myapp_build\"}: Step 2 : MAINTAINER Me\r\n{BuildImageStdout=image_name:\"myregistry.com/myapp\" service_name:\"myapp_build\"}:  ---> Using cache\r\n{BuildImageStdout=image_name:\"myregistry.com/myapp\" service_name:\"myapp_build\"}:  ---> 85162f600fc1\r\n{BuildImageStdout=image_name:\"myregistry.com/myapp\" service_name:\"myapp_build\"}: Successfully built 85162f600fc1\r\n{PushImageStarted=step_name:\"Build myapp image\" service_name:\"myapp_build\" image_name:\"myregistry.com/myapp\"}\r\n{PushImageStdout=step_name:\"Build myapp image\" service_name:\"myapp_build\" image_name:\"myregistry.com/myapp\"}: The push refers to a repository [myregistry.com/myapp] (len: 1)\r\n{PushImageStdout=step_name:\"Build myapp image\" service_name:\"myapp_build\" image_name:\"myregistry.com/myapp\"}: Image already exists\r\n{PushImageStdout=step_name:\"Build myapp image\" service_name:\"myapp_build\" image_name:\"myregistry.com/myapp\"}: Image already exists\r\n{PushImageStdout=step_name:\"Build myapp image\" service_name:\"myapp_build\" image_name:\"myregistry.com/myapp\"}: Image already exists\r\n{PushImageStdout=step_name:\"Build myapp image\" service_name:\"myapp_build\" image_name:\"myregistry.com/myapp\"}: Image already exists\r\n{PushImageStdout=step_name:\"Build myapp image\" service_name:\"myapp_build\" image_name:\"myregistry.com/myapp\"}: Image already exists\r\n{PushImageStdout=step_name:\"Build myapp image\" service_name:\"myapp_build\" image_name:\"myregistry.com/myapp\"}: Image already exists\r\n{PushImageStdout=step_name:\"Build myapp image\" service_name:\"myapp_build\" image_name:\"myregistry.com/myapp\"}: Image already exists\r\n{PushImageStdout=step_name:\"Build myapp image\" service_name:\"myapp_build\" image_name:\"myregistry.com/myapp\"}: codeship-cache-master: digest: sha256:bb461ab189138c02d674bb35b50220961c6c1acef3b229cb834cabc708092f76 size: 18846\r\n{PushImageFinished=step_name:\"Build myapp image\" service_name:\"myapp_build\" image_name:\"myregistry.com/myapp\"}\r\n{BuildImageFinished=image_name:\"myregistry.com/myapp\" service_name:\"myapp_build\"}\r\n{StepFinished=step_name:\"Build myapp image\" type:STEP_FINISHED_TYPE_SUCCESS}\r\n```\r\nThis is legit copy paste of this happening. I just search/replaced some identifying bits and added newlines between runs.\r\n\r\ncodeship-steps.yml:\r\n```\r\n- name: Build\r\n  service: myapp_build\r\n  command: /bin/true\r\n  encrypted_dockercfg_path: dockercfg.encrypted\r\n```\r\n\r\ncodeship-services.yml:\r\n```\r\nmyapp_build:\r\n  build:\r\n    image: myregistry.com/myapp\r\n    dockerfile_path: docker/build/myapp/Dockerfile\r\n  cached: true\r\n  encrypted_env_file: codeship.env.encrypted\r\n```\r\n\r\nDockerfile:\r\n```\r\nFROM node:4.2.3\r\nMAINTAINER Me\r\n```\r\nJet version is 1.1.3\r\n\r\nThe weirdest thing is that it only happens in one project. If I take the files in here as pasted and start in a new directory, it will NEVER happen (put it in a loop for an hour). If I dumb down my project commenting everything until it's as pasted here, the strange behaviour continues. Any idea what would cause jet to alternate like this in a seemingly random fashion?"},"comment":{"url":"https://api.github.com/repos/codeship/jet-tutorial/issues/comments/192021653","html_url":"https://github.com/codeship/jet-tutorial/issues/8#issuecomment-192021653","issue_url":"https://api.github.com/repos/codeship/jet-tutorial/issues/8","id":192021653,"user":{"login":"bfosberry","id":1553039,"avatar_url":"https://avatars.githubusercontent.com/u/1553039?v=3","gravatar_id":"","url":"https://api.github.com/users/bfosberry","html_url":"https://github.com/bfosberry","followers_url":"https://api.github.com/users/bfosberry/followers","following_url":"https://api.github.com/users/bfosberry/following{/other_user}","gists_url":"https://api.github.com/users/bfosberry/gists{/gist_id}","starred_url":"https://api.github.com/users/bfosberry/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bfosberry/subscriptions","organizations_url":"https://api.github.com/users/bfosberry/orgs","repos_url":"https://api.github.com/users/bfosberry/repos","events_url":"https://api.github.com/users/bfosberry/events{/privacy}","received_events_url":"https://api.github.com/users/bfosberry/received_events","type":"User","site_admin":false},"created_at":"2016-03-03T23:37:00Z","updated_at":"2016-03-03T23:37:00Z","body":"Hey, thanks for reporting this. That is really weird! I'm looking for clues in the code our side. My first guess is its a parsing bug related to the image name, try adding a default port to \"myregistry.com/myapp\". Not only should it not be possible for it to pull \"latest\" during caching, it also should not fail if it can't pull the cache, only if it can't push.\r\n\r\nThis makes me wonder if this is actually related to caching. Does it still fail with caching turned off? I wonder if jet is reading your services file incorrectly. If it thinks no dockerfile is specified, it'll treat it like a pull instead of a build. \r\n\r\n1) is your dockerfile in ./docker/build/myapp/Dockerfile inside the build context\r\n2) what was changed, if anything, for your last example to work?\r\n3) Do you get the same results turning caching off (cached: false)"}}