Skip to content

bug: failures with digital ocean auth when running automation branch #175

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

Closed
qdzlug opened this issue Aug 4, 2022 · 3 comments · Fixed by #167
Closed

bug: failures with digital ocean auth when running automation branch #175

qdzlug opened this issue Aug 4, 2022 · 3 comments · Fixed by #167
Assignees

Comments

@qdzlug
Copy link
Contributor

qdzlug commented Aug 4, 2022

Describe the bug
When trying to deploy to DO the following errors are thrown:

Project [container-registry] selected: /home/jschmidt/repos/kic-reference-architectures/pulumi/python/infrastructure/digitalocean/container-registry
Updating (jaymara203)

View Live: https://app.pulumi.com/qdzlug/container-registry/jaymara203/updates/4


    pulumi:pulumi:Stack container-registry-jaymara203  Creating new global Digital Ocean container registry
    pulumi:pulumi:Stack container-registry-jaymara203 running Creating new global Digital Ocean container registry
    digitalocean:index:ContainerRegistry shared-global-container-registry  error: could not validate provider configuration: 4 errors occurred:
    digitalocean:index:ContainerRegistry shared-global-container-registry **failed** 1 error
    pulumi:pulumi:Stack container-registry-jaymara203  1 message

Diagnostics:
  digitalocean:index:ContainerRegistry (shared-global-container-registry):
    error: could not validate provider configuration: 4 errors occurred:
        * Invalid or unknown key
        * Invalid or unknown key
        * Invalid or unknown key
        * Invalid or unknown key

  pulumi:pulumi:Stack (container-registry-jaymara203):
    Creating new global Digital Ocean container registry

Resources:
    1 unchanged

Duration: 2s

ERROR:root:Error running Pulumi operation [up] with provider [do] for stack [jaymara203]
Traceback (most recent call last):
  File "/home/jschmidt/repos/kic-reference-architectures/pulumi/python/automation/main.py", line 490, in <module>
    main()
  File "/home/jschmidt/repos/kic-reference-architectures/pulumi/python/automation/main.py", line 219, in main
    raise e
  File "/home/jschmidt/repos/kic-reference-architectures/pulumi/python/automation/main.py", line 215, in main
    pulumi_cmd(provider=provider, env_config=env_config)
  File "/home/jschmidt/repos/kic-reference-architectures/pulumi/python/automation/main.py", line 457, in up
    stack_up_result = stack.up(color=env_config.pulumi_color_settings(),
  File "/home/jschmidt/repos/kic-reference-architectures/pulumi/python/venv/lib/python3.8/site-packages/pulumi/automation/_stack.py", line 290, in up
    up_result = self._run_pulumi_cmd_sync(args, on_output)
  File "/home/jschmidt/repos/kic-reference-architectures/pulumi/python/venv/lib/python3.8/site-packages/pulumi/automation/_stack.py", line 683, in _run_pulumi_cmd_sync
    result = _run_pulumi_cmd(args, self.workspace.work_dir, envs, on_output)
  File "/home/jschmidt/repos/kic-reference-architectures/pulumi/python/venv/lib/python3.8/site-packages/pulumi/automation/_cmd.py", line 78, in _run_pulumi_cmd
    raise create_command_error(result)
pulumi.automation.errors.CommandError:
 code: 255
 stdout: Updating (jaymara203)

View Live: https://app.pulumi.com/qdzlug/container-registry/jaymara203/updates/4


    pulumi:pulumi:Stack container-registry-jaymara203  Creating new global Digital Ocean container registry
    pulumi:pulumi:Stack container-registry-jaymara203 running Creating new global Digital Ocean container registry
    digitalocean:index:ContainerRegistry shared-global-container-registry  error: could not validate provider configuration: 4 errors occurred:
    digitalocean:index:ContainerRegistry shared-global-container-registry **failed** 1 error
    pulumi:pulumi:Stack container-registry-jaymara203  1 message

Diagnostics:
  digitalocean:index:ContainerRegistry (shared-global-container-registry):
    error: could not validate provider configuration: 4 errors occurred:
        * Invalid or unknown key
        * Invalid or unknown key
        * Invalid or unknown key
        * Invalid or unknown key

  pulumi:pulumi:Stack (container-registry-jaymara203):
    Creating new global Digital Ocean container registry

Resources:
    1 unchanged

Duration: 2s

 stderr:

To Reproduce
Steps to reproduce the behavior:

  1. Check out code.
  2. Run runner.sh -p do up
  3. Errors are thrown

Notes:

  1. This happens if you set the DIGITALOCEAN_TOKEN env variable.
  2. It also happens if you put the DIGITALOCEAN_TOKEN into the pulumi configuration file.
  3. ...and it also happens if you do a doctl auth init.

Expected behavior
We should deploy on Digital Ocean

Your environment

Additional context
None.

@qdzlug
Copy link
Contributor Author

qdzlug commented Aug 4, 2022

❯ pulumi config -C ./pulumi/python/infrastructure/digitalocean/container-registry
KEY                         VALUE
digitalocean:instance_size  s-2vcpu-4gb
digitalocean:k8s_version    1.22.8-do.1
digitalocean:node_count     3
digitalocean:region         sfo3
kic-helm:fqdn               jaymara203.docean.mantawang.com
kubernetes:infra_type       DO

Shows errors as in description...

View Live: https://app.pulumi.com/qdzlug/container-registry/jaymara203/updates/1


    pulumi:pulumi:Stack container-registry-jaymara203  Creating new global Digital Ocean container registry
 +  pulumi:pulumi:Stack container-registry-jaymara203 creating Creating new global Digital Ocean container registry
    digitalocean:index:ContainerRegistry shared-global-container-registry  error: could not validate provider configuration: 4 errors occurred:
    digitalocean:index:ContainerRegistry shared-global-container-registry **failed** 1 error
 +  pulumi:pulumi:Stack container-registry-jaymara203 created 1 message

Diagnostics:
  digitalocean:index:ContainerRegistry (shared-global-container-registry):
    error: could not validate provider configuration: 4 errors occurred:
        * Invalid or unknown key
        * Invalid or unknown key
        * Invalid or unknown key
        * Invalid or unknown key

  pulumi:pulumi:Stack (container-registry-jaymara203):
    Creating new global Digital Ocean container registry

Resources:
    + 1 created

Duration: 2s

 stderr:

However, If I remove the 4 keys beginning with digitalocean like...

❯ pulumi config -C ./pulumi/python/infrastructure/digitalocean/container-registry
KEY                    VALUE
kic-helm:fqdn          jaymara203.docean.mantawang.com
kubernetes:infra_type  DO

It now works as expected:

❯ pulumi up -C ./pulumi/python/infrastructure/digitalocean/container-registry
Previewing update (jaymara203)

View Live: https://app.pulumi.com/qdzlug/container-registry/jaymara203/previews/e51abdec-9e5d-463b-9f11-625e1303cb96

     Type                                     Name                              Plan       Info
     pulumi:pulumi:Stack                      container-registry-jaymara203                1 message
 +   └─ digitalocean:index:ContainerRegistry  shared-global-container-registry  create

Diagnostics:
  pulumi:pulumi:Stack (container-registry-jaymara203):
    Creating new global Digital Ocean container registry

Outputs:
  + container_registry     : {
      + created_at            : output<string>
      + endpoint              : output<string>
      + region                : "sfo3"
      + server_url            : output<string>
      + storage_usage_bytes   : output<string>
      + subscription_tier_slug: "starter"
      + urn                   : "urn:pulumi:jaymara203::container-registry::digitalocean:index/containerRegistry:ContainerRegistry::shared-global-container-registry"
    }
  + container_registry_id  : output<string>
  + container_registry_name: "shared-global-container-registry-7955796"


Do you want to perform this update?  [Use arrows to move, enter to select, type to filter]
  yes
> no
  details
Do you want to perform this update? y  [Use arrows to move, enter to select, type to filter]
> yes
Do you want to perform this update? yes
Updating (jaymara203)

View Live: https://app.pulumi.com/qdzlug/container-registry/jaymara203/updates/2

     Type                                     Name                              Status      Info
     pulumi:pulumi:Stack                      container-registry-jaymara203                 1 message
 +   └─ digitalocean:index:ContainerRegistry  shared-global-container-registry  created

Diagnostics:
  pulumi:pulumi:Stack (container-registry-jaymara203):
    Creating new global Digital Ocean container registry

Outputs:
  + container_registry     : {
      + created_at            : "2022-08-04 14:17:38 +0000 UTC"
      + endpoint              : "registry.digitalocean.com/shared-global-container-registry-aaf0ff7"
      + region                : "sfo3"
      + server_url            : "registry.digitalocean.com"
      + storage_usage_bytes   : 0
      + subscription_tier_slug: "starter"
      + urn                   : "urn:pulumi:jaymara203::container-registry::digitalocean:index/containerRegistry:ContainerRegistry::shared-global-container-registry"
    }
  + container_registry_id  : "shared-global-container-registry-aaf0ff7"
  + container_registry_name: "shared-global-container-registry-aaf0ff7"

Resources:
    + 1 created
    1 unchanged

Duration: 5s

But, then it bombs out in the subsequent projects because it's missing information. Question is, why does it care about those (unused) variables?

@qdzlug
Copy link
Contributor Author

qdzlug commented Aug 4, 2022

this is definitely tied to the configuration file - if we remove the offending lines from the configuration or we point to an empty config file everything works as expected.

So, there is definitely something going on with the do provider and how it accesses that configuration file - note that we don't even need to use the file (ie, we can strip the code down to not even touch the file in that we don't pull any values from it) and it still bombs out.

@qdzlug
Copy link
Contributor Author

qdzlug commented Aug 4, 2022

Solved; a recent update to pulumi disallowed the use of a plugin's namespace for variables; so digitalocean.region now throws an error. The fix is to move these to docean.region (or anything that is not in a plugin's namespace).

Will close when #167 merges.

@qdzlug qdzlug self-assigned this Aug 4, 2022
@qdzlug qdzlug linked a pull request Aug 19, 2022 that will close this issue
7 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant