question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Missing configuration leads to poor errors

See original GitHub issue

If I neglect to set my project, region, or zone configuration, I get an unhelpful error message:

error: Plan apply failed: project: required field is not set

Given that this will happen almost guaranteed for every new user of Pulumi on GCP, we should try to make this experience better. IIRC, we have some trick that we already use in the AWS package to hook errors like this and prettify them before displaying to the end user.

Issue Analytics

  • State:open
  • Created 4 years ago
  • Comments:12 (11 by maintainers)

github_iconTop GitHub Comments

2reactions
joeduffycommented, Apr 12, 2019

I believe @ellismg and @jen20 looked into this and concluded it isn’t as easy as copying what we do in the AWS package, since you can set these on a per-resource basis.

This would be a very unfortunate conclusion. Here is a common experience with basic GCP programs, annotated with some of my own commentary/questions:

  • Initialize a GCP project/stack.
  • Run pulumi up:
    • Preview looks great! No errors. I hit “yes” to proceed.
    • The first GCP resource attempted to be created fails with an error, Plan apply failed: project: required field is not set
  • As a new user, I have no idea how to proceed. Hopefully my tutorial tells me what to do. Google actually lands me on a bug from nearly one year ago where users were confused by this very thing!
    • Question: Why doesn’t this use my default gcloud project? If I run gcloud info, it prints out the very project I want to use…
    • Eventually, I figure out to run pulumi config set gcp:project my-project
    • Question: Is there any way for the error message to tell me how to fix the problem?
  • I rerun pulumi up:
    • Again, the preview looks great. I hit “yes”.
    • Again a failure, and again minimal or obscure commentary on how to proceed: Plan apply failed: Cannot determine region: set in this resource, or set provider-level 'region' or 'zone'.
  • Again, as a new user, I’m probably stumped. Sadly, for this one Googling doesn’t help.
    • The solution is to set either the region or zone, using pulumi config set gcp:region us-east1.
    • Question: Is there any way for the error message to tell me how to fix the problem?

@ellismg I know you had feedback on the GCP getting started flow. I’m actually wondering whether this was a problem for others on the team, or whether our tutorials make it so you don’t stumble here. (I’m always stumbling, but maybe I’m not paying close enough attention.) Thoughts?

Also /cc @swgillespie as I know improving errors is/was a passion of his, and I’m curious if he’s ever looked into this sort of “error rewriting” we might need to do on the fly in order to improve these messages.

1reaction
jaxxstormcommented, Mar 27, 2020

I actually just ran into this, and until I found this issue it wasn’t at all clear what the issue way.

One thing that was very helpful with the AWS provider is that when a required field is missing, like the aws:region configuration option, you get a much more helpful error:

aws:s3:Bucket (bucket):
    error: 1 error occurred:
        * missing required configuration key "aws:region": The region where AWS operations will take place. Examples are us-east-1, us-west-2, etc.
    Set a value using the command `pulumi config set aws:region <value>`.

Can we at least make the error message clearer, or have the previous comments indicated why that isn’t possible?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Disk configuration warning and error messages - IBM
You see a disk configuration warning or an error report on a display when your system detects errors or warning conditions in your...
Read more >
.NET: Which Exception to Throw When a Required ...
You missed something: "when an application configuration setting is missing or contains an invalid value", that's not the same as bad user input ......
Read more >
Error 0x74: Bad_system_config_info - Microsoft Support
This error means that something is wrong with the registry on your PC and you'll need to return to a previous configuration.
Read more >
Early Detection of Configuration Errors to Reduce Failure ...
tomers' configuration issues of COMP-A. LC errors contribute to ... potential LC errors, and compensate for the missing and.
Read more >
Config Checks and Messages - Wireless Troubleshooting Tools
The AP has configured a controller name as primary, secondary or tertiary, which is not present in the analyzed config file. This may...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found