Skip to content

Error not descriptive enough for when a task cannot be found at the path you've provided #1775

Closed

Description

@timrchavez

Bug Report

You will get an error like "unknown artifact source: ci" if you specify a relative path to a task yaml file but forget a path component. Can we maybe get a more descriptive error like "could not find task at path: "?

The following can also be handy:

  • Concourse version: 3.5
  • Deployment type (BOSH/Docker/binary): N/A
  • Infrastructure/IaaS: VMs
  • Browser (if applicable): Chrome
  • Did this used to work? N/A

Activity

  1. Aid19801 commented on Dec 4, 2017

    @Aid19801

    Thanks for flagging, Tim. I'm very new to CI/setup and this error left me clueless. It was only because you mentioned task path's that i decided to try messing with the ./ i had at the beginning of my path. Now it works.

  2. connormckelvey commented on Jan 20, 2018

    @connormckelvey

    Im still lost at what to do here. What do you mean a path component @timrchavez?

  3. ddadlani commented on Sep 26, 2018

    @ddadlani
    Contributor

    For anyone that searches for this error in the future, unknown artifact source refers to the resource containing the task config file. The task config file path should be prefixed with the resource name as the source path so that Concourse can locate the task config file. As of now, we have edited the error message to say unknown artifact source: <source> in task config file path <given_path> to make the error clearer to the user.

    This error only occurs if the source path is invalid. If the source path is not present, or if the task config path is incorrect, other errors are surfaced (see below for more info)

    func (configSource FileConfigSource) FetchConfig(repo *worker.ArtifactRepository) (atc.TaskConfig, error) {
    segs := strings.SplitN(configSource.Path, "/", 2)
    if len(segs) != 2 {
    return atc.TaskConfig{}, UnspecifiedArtifactSourceError{configSource.Path}
    }
    sourceName := worker.ArtifactName(segs[0])
    filePath := segs[1]
    source, found := repo.SourceFor(sourceName)
    if !found {
    return atc.TaskConfig{}, UnknownArtifactSourceError{sourceName, configSource.Path}
    }
    stream, err := source.StreamFile(filePath)
    if err != nil {
    if err == baggageclaim.ErrFileNotFound {
    return atc.TaskConfig{}, fmt.Errorf("task config '%s/%s' not found", sourceName, filePath)
    }
    return atc.TaskConfig{}, err
    }

  4. added this to the v5.0.0 milestone on Jan 10, 2019
  5. added
    release/documented
    and removed
    release/documented
    on Jan 21, 2019
  6. daniellavoie commented on Mar 29, 2019

    @daniellavoie

    I also want to share an experience that might help others in the future who encounter this error.

    I've been scratching my head for two hours trying to understand why I had an unknown artifact source. Turns out my task was declared in an aggregate by mistake and collocated with the resource that it needed. Joys of yml indentation :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    acceptedenhancementrelease/documentedtroubleshooting

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions