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

Where is the error "task has no instance attached" explained? #1043

Closed
guyharris opened this issue Jul 28, 2022 · 4 comments · Fixed by cirruslabs/cirrus-cli#546
Closed

Where is the error "task has no instance attached" explained? #1043

guyharris opened this issue Jul 28, 2022 · 4 comments · Fixed by cirruslabs/cirrus-cli#546
Assignees
Labels

Comments

@guyharris
Copy link

Expected Behavior

I could find an explanation of what "task has no instance attached" and, ideally, how to get an "instance" attached to a task.

Real Behavior

I couldn't find anything if I did a Google search for the quoted string "task has no instance attached" - searching not just the Cirrus CI sites, but anything else Google indexes.

Related Info

This is a (tick one of the following):

  • [x ] Website issue
    • Link to page: if there were a page discussing this, I'd link to it, but....

This all started when I added the tiny test task

windows_task:
    name: windows-amd64
    only_if: $CIRRUS_BRANCH != 'coverity_scan'
    windows_contaainer:
        image: cirrusci/windowsservercore:2019
    script:
        - set

to libpcap's .cirrus.yml, where the intent was to see what the environment was set to, so that I'd know what had to be tweaked in order to set up a build environment - and to see whether this all worked.

I got the error in question, and could not find a clue anywhere as to how to arrange that an instance be attached to the task. Does something else need to be added to .cirrus.yml? Does something need to be changed in some other configuration?

(I note that I couldn't find anything corresponding to a reference manual for Cirrus CI YML, describing everything that can be done; there's only a user's guide that doesn't have the form of a reference manual.)

@guyharris guyharris added the bug label Jul 28, 2022
@fkorotkov
Copy link
Contributor

You have a typo in your 'windows_container'. The error comes from the parser. It should've report it in parsing results with a line annotation to the task.

@guyharris
Copy link
Author

From a quick check, it appears that if, for example, I add a line

fnord: hello

to the entry for the now-working Windows build, there's no complaint about unknown YAML keys, so the invalid key "windows_contaainer" was just not recognized, with no complaint, and the error stems from no instance or container having been specified.

(Note also that "task has no instance attached" should perhaps be "task has no instance or container attached"; VMs are specified with "XXX_instance" keys, and containers are specified with "XXX_container" keys, so it sounds as if "instance" is a non-container builder.)

@edigaryev
Copy link
Contributor

You have a typo in your 'windows_container'. The error comes from the parser. It should've report it in parsing results with a line annotation to the task.

The error is reported just fine:

Screenshot 2022-07-29 at 11 04 54

Improved the error message per suggestion in #1043 (comment), though.

@guyharris
Copy link
Author

So presumably there's a reason not to check YAML keys for validity? If that had been done, it would have caught the underlying problem, namely the typo in "windows_contaainer".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants