{"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":11,"created_at":"2016-03-03T19:00:51Z","updated_at":"2016-03-11T19:22:44Z","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/195507435","html_url":"https://github.com/codeship/jet-tutorial/issues/8#issuecomment-195507435","issue_url":"https://api.github.com/repos/codeship/jet-tutorial/issues/8","id":195507435,"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},"created_at":"2016-03-11T19:22:44Z","updated_at":"2016-03-11T19:22:44Z","body":"Also I managed to work around it by copying the \"build\" part from \"builder\" to \"tester\". Jet did the right thing and didn't build the image again. I'm sorry I didn't include the \"tester\" service in my original example. I stupidly assumed it's irrelevant as long as there's no step using it... -_-\""}}