Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Confusing error when missing FROM #807

Closed
ohadravid opened this issue Feb 24, 2021 · 1 comment · Fixed by #817
Closed

Confusing error when missing FROM #807

ohadravid opened this issue Feb 24, 2021 · 1 comment · Fixed by #817
Labels
type:enhancement Small feature requests / adjustments

Comments

@ohadravid
Copy link

For this Earthfile:


hello:
    RUN mkdir /foo
    COPY bar /foo

Version: earthly version v0.5.1 linux/amd64

$ earthly +hello
           buildkitd | Found buildkit daemon as docker container (earthly-buildkitd)
No ssh auth socket detected or zero keys loaded; falling back to https for auto auth values
             context | --> local context .
              +hello | --> RUN mkdir /foo
              +hello | WARN: (RUN mkdir /foo) invalid mountinput dest:"/run/secrets/earthly_debugger_settings" mountType:SECRET secretOpt:<ID:"earthly_debugger_settings" mode:292 >
             context | [          ] transferring .: ... 0%
             context | WARN: Canceled
Error: failed to load cache key: invalid mountinput dest:"/run/secrets/earthly_debugger_settings" mountType:SECRET secretOpt:<ID:"earthly_debugger_settings" mode:292 >

The fix is easy: just add the missing FROM, but the error is very unintuitive.

Thanks! 😄

@vladaionescu vladaionescu added the type:enhancement Small feature requests / adjustments label Feb 24, 2021
@vladaionescu
Copy link
Member

It's probably best if we don't allow any command other than FROM, FROM DOCKERFILE or LOCALLY as the first thing being interpreted. Then we can display a meaningful error if the user forgets.

This is also relevant for the IF proposal (#779), where the user may be tempted to start off with an IF (but it doesn't work).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:enhancement Small feature requests / adjustments
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants