Skip to content
This repository has been archived by the owner on Oct 22, 2023. It is now read-only.

Improve the error message when defining empty containers/tasks #4

Closed
pameck opened this issue Apr 18, 2018 · 2 comments
Closed

Improve the error message when defining empty containers/tasks #4

pameck opened this issue Apr 18, 2018 · 2 comments

Comments

@pameck
Copy link
Contributor

pameck commented Apr 18, 2018

When defining a container with an empty property (nodejs), I get the following error message :

my-project/batect.yml: Could not load configuration file: null
Caused by: java.lang.NullPointerException

Here is my batect.yaml:

project_name: my-project

containers:
  nodejs:

tasks:
  start:
    run:
      container: nodejs
      command: ./go.sh

It also happens for empty tasks (start):

project_name: my-project

containers:
  nodejs:
    build_directory: nodejs

tasks:
  start:
@charleskorn
Copy link
Collaborator

Thanks for the bug report Pam!

The error is 'correct' in that the config file isn't valid (I'm not sure it would even count as valid YAML), but you're right that error message is not helpful at all... it doesn't even give you a message or line number to point you in the right direction.

I know you're looking at improving some of the other error messages at the moment, are you going to look at this issue or would you like me to?

@pameck
Copy link
Contributor Author

pameck commented Apr 18, 2018

Leave this one to me please! Focus on the hard stuff while I get a better understanding of how all this stuff works! :)

@charleskorn charleskorn changed the title Improve the error message when defining empty containers/tasks: Improve the error message when defining empty containers/tasks Jun 28, 2018
charleskorn added a commit that referenced this issue Dec 23, 2020
…ith an image that uses a non-default syntax.

The output previously looked something like (note output for #3 and #4):

#1 [internal] load remote build context
#1 DONE

#2 copy /context /
#2 DONE

#3 resolve image config for docker.io/docker/dockerfile:1.1-experimental
#3 ...

#4 docker-image://docker.io/docker/dockerfile:1.1-experimental@sha256:de85b2f3a3e8a2f7fe48e8e84a65f6fdd5cd5183afa6412fff9caa6871649c44
#4 ...

#5 [internal] load metadata for docker.io/library/ruby:2.7.2
#5 DONE

#6 [ 1/12] FROM docker.io/library/ruby:2.7.2
#6 DONE

#7 [ 2/12] RUN mkdir -p /tools
#7 CACHED

#8 [ 3/12] COPY health-check.sh /tools
#8 CACHED

#9 [ 4/12] RUN mkdir -p /app
#9 CACHED

#10 [ 5/12] COPY app/Gemfile app/Gemfile.lock /app/
#10 CACHED

#11 [ 6/12] WORKDIR /app
#11 CACHED

#12 [ 7/12] RUN bundle config set deployment true
#12 CACHED

#13 [ 8/12] RUN bundle config set without development
#13 CACHED

#14 [ 9/12] RUN bundle install
#14 CACHED

#15 [10/12] COPY app/config.ru /app
#15 CACHED

#16 [11/12] COPY app/bin /app/bin
#16 CACHED

#17 [12/12] COPY app/lib /app/lib
#17 ...

#3 resolve image config for docker.io/docker/dockerfile:1.1-experimental
#3 DONE

#4 docker-image://docker.io/docker/dockerfile:1.1-experimental@sha256:de85b2f3a3e8a2f7fe48e8e84a65f6fdd5cd5183afa6412fff9caa6871649c44
#4 CACHED

#17 [12/12] COPY app/lib /app/lib
#17 CACHED

#18 exporting to image
#18 exporting layers: done
#18 writing image sha256:ace2572ab366a9153b23ccc0667cc6163a32a3cbb96bfef237a25c68005699a6: done
#18 naming to docker.io/library/batect-sample-ruby-international-transfers-service: done
#18 DONE
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Development

No branches or pull requests

2 participants