pack: What does this error message mean
I am working on a custom build-pack but hitting this error when trying to run the built app:
❯ docker run --rm hello-k8s
Error: failed to launch: modify env: add layer env: readdirent: not a directory
Its not clear to me what the issue is 🤔
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 16 (7 by maintainers)
We can definitely differentiate between a file and a directory. Just pointing out (in case it wasn’t obvious) that it’s not possible for the buildpack to create an
envfile and anenvdirectory in the same layer at the same time. We should always fail the build when anenvfile is created in a layer by mistake (and not generate an image at all).If you’re interested in contributing, it would be great if the lifecycle did more validation on layers created by buildpacks.
Just to be totally clear, filesystems do not generally allow a file and a directory with the same name to co-exist in the same directory. I’m assuming you’re asking whether a file called
envcould exist instead of a directory calledenvin cases where the directory would otherwise be empty.You are correct: the spec does not explicitly say that creating
<layers>/<layer>/envas a file will result in a build failure. But it does strongly suggest that<layers>/<layer>/envis reserved for a directory. We could certainly document that all files and directories mentioned are reserved for their intended purposes.I agree 😄