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.

Reading certificate output cause python error

See original GitHub issue

Hello,

Attempting to read a acm.Certificate() resource (certificate.domain_validation_options[0]["resourceRecordName"]) output using the following versions:

pulumi == 2.12.1
pulumi-aws == 3.10.0

Will cause the following error at pulumi up:

Diagnostics:
  pulumi:pulumi:Stack (pulumi-sample-certificate-dev):
    error: Program failed with an unhandled exception:
    error: Traceback (most recent call last):
      File "/home/eric/.pulumi/bin/pulumi-language-python-exec", line 85, in <module>
        loop.run_until_complete(coro)
      File "/usr/lib/python3.8/asyncio/base_events.py", line 616, in run_until_complete
        return future.result()
      File "/home/eric/git/pulumi_sample_certificate/venv/lib/python3.8/site-packages/pulumi/runtime/stack.py", line 83, in run_in_stack
        await run_pulumi_func(lambda: Stack(func))
      File "/home/eric/git/pulumi_sample_certificate/venv/lib/python3.8/site-packages/pulumi/runtime/stack.py", line 51, in run_pulumi_func
        await RPC_MANAGER.rpcs.pop()
      File "/home/eric/git/pulumi_sample_certificate/venv/lib/python3.8/site-packages/pulumi/runtime/rpc_manager.py", line 67, in rpc_wrapper
        result = await rpc
      File "/home/eric/git/pulumi_sample_certificate/venv/lib/python3.8/site-packages/pulumi/output.py", line 88, in is_value_known
        return await is_known and not contains_unknowns(await future)
      File "/home/eric/git/pulumi_sample_certificate/venv/lib/python3.8/site-packages/pulumi/output.py", line 88, in is_value_known
        return await is_known and not contains_unknowns(await future)
      File "/home/eric/git/pulumi_sample_certificate/venv/lib/python3.8/site-packages/pulumi/output.py", line 88, in is_value_known
        return await is_known and not contains_unknowns(await future)
      [Previous line repeated 14 more times]
      File "/home/eric/git/pulumi_sample_certificate/venv/lib/python3.8/site-packages/pulumi/runtime/resource.py", line 327, in do_register
        resolver = await prepare_resource(res, ty, custom, props, opts)
      File "/home/eric/git/pulumi_sample_certificate/venv/lib/python3.8/site-packages/pulumi/runtime/resource.py", line 86, in prepare_resource
        serialized_props = await rpc.serialize_properties(props, property_dependencies_resources, res.translate_input_property)
      File "/home/eric/git/pulumi_sample_certificate/venv/lib/python3.8/site-packages/pulumi/runtime/rpc.py", line 71, in serialize_properties
        result = await serialize_property(v, deps, input_transformer)
      File "/home/eric/git/pulumi_sample_certificate/venv/lib/python3.8/site-packages/pulumi/runtime/rpc.py", line 178, in serialize_property
        value = await serialize_property(output.future(), deps, input_transformer)
      File "/home/eric/git/pulumi_sample_certificate/venv/lib/python3.8/site-packages/pulumi/runtime/rpc.py", line 164, in serialize_property
        future_return = await asyncio.ensure_future(awaitable)
      File "/home/eric/git/pulumi_sample_certificate/venv/lib/python3.8/site-packages/pulumi/output.py", line 113, in get_value
        val = await self._future
      File "/home/eric/git/pulumi_sample_certificate/venv/lib/python3.8/site-packages/pulumi/output.py", line 175, in run
        transformed: Input[U] = func(value)
      File "/home/eric/git/pulumi_sample_certificate/venv/lib/python3.8/site-packages/pulumi/output.py", line 233, in <lambda>
        return self.apply(lambda v: UNKNOWN if isinstance(v, Unknown) else cast(Any, v)[key], True)
    KeyError: 'resourceRecordName'
    error: an unhandled error occurred: Program exited with non-zero exit code: 1

Steps to reproduce:

  1. Clone https://github.com/edalongeville/pulumi_sample_certificate
  2. Create a python venv and pip install requirements_broken.txt
  3. Run pulumi up

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:10 (6 by maintainers)

github_iconTop GitHub Comments

3reactions
leezencommented, Oct 29, 2020

Thanks for the repro. I was able to reproduce with the steps you outlined above. It seems this is somehow related to the recently released preview functionality. We’ll continue to investigate. In the meantime, as mentioned above, downgrading is one path forward. Alternatively, you can also set the environment variable PULUMI_DISABLE_PROVIDER_PREVIEW=1 (or true) with pulumi CLI 2.12.x and should be able to proceed.

1reaction
tusharshahrscommented, Oct 27, 2020

pulumi 2.12.0 gives the same issue as above.

pulumi up works with 2.11.2 see below $cat requirements.txt:

pulumi == 2.11.2
pulumi-aws == 3.10.0

/Users/…shah/Downloads/pulumi_2_11_2/pulumi/pulumi version v2.11.2

/Users/tusharshah/Downloads/pulumi_2_11_2/pulumi/pulumi up
Previewing update (dev)

View Live: https://app.pulumi.com/shaht/pulumi-sample-certificate/dev/previews/7caa6a69-045b-4196-a113-6c13dbf458a6

     Type                     Name                           Plan
 +   pulumi:pulumi:Stack      pulumi-sample-certificate-dev  create
 +   ├─ pulumi:providers:aws  aws-provider-us-east-1         create
 +   ├─ aws:acm:Certificate   certificate                    create
 +   ├─ aws:route53:Zone      my-zone                        create
 +   └─ aws:route53:Record    record-certificate-validation  create

Resources:
    + 5 to create

Do you want to perform this update? details
+ pulumi:pulumi:Stack: (create)
    [urn=urn:pulumi:dev::pulumi-sample-certificate::pulumi:pulumi:Stack::pulumi-sample-certificate-dev]
    + pulumi:providers:aws: (create)
        [urn=urn:pulumi:dev::pulumi-sample-certificate::pulumi:providers:aws::aws-provider-us-east-1]
        region: "us-east-1"
    + aws:acm/certificate:Certificate: (create)
        [urn=urn:pulumi:dev::pulumi-sample-certificate::aws:acm/certificate:Certificate::certificate]
        [provider=urn:pulumi:dev::pulumi-sample-certificate::pulumi:providers:aws::aws-provider-us-east-1::04da6b54-80e4-46f7-96ec-b56ff0331ba9]
        domainName             : "mydomain.com"
        subjectAlternativeNames: [
            [0]: "*.mydomain.com"
        ]
        validationMethod       : "DNS"
    + aws:route53/zone:Zone: (create)
        [urn=urn:pulumi:dev::pulumi-sample-certificate::aws:route53/zone:Zone::my-zone]
        [provider=urn:pulumi:dev::pulumi-sample-certificate::pulumi:providers:aws::default_3_10_0::04da6b54-80e4-46f7-96ec-b56ff0331ba9]
        comment     : "Managed by Pulumi"
        forceDestroy: false
        name        : "mydomain.com"
    + aws:route53/record:Record: (create)
        [urn=urn:pulumi:dev::pulumi-sample-certificate::aws:route53/record:Record::record-certificate-validation]
        [provider=urn:pulumi:dev::pulumi-sample-certificate::pulumi:providers:aws::aws-provider-us-east-1::04da6b54-80e4-46f7-96ec-b56ff0331ba9]
        name      : output<string>
        records   : [
            [0]: output<string>
        ]
        ttl       : 300
        type      : output<string>
        zoneId    : output<string>
Read more comments on GitHub >

github_iconTop Results From Across the Web

python - urllib and "SSL: CERTIFICATE_VERIFY_FAILED" Error
There is nothing wrong with the URL and it can be successfully verified with the common trusted certificates. So you should better not...
Read more >
SSL Error - unable to read server certificate from file
The error that you are currently encountering is caused because you are using a wrong command line for installing the CSR. You will...
Read more >
What is an SSL 'Certificate_Verify_Failed' Error and How Do I ...
SSL certificate_verify_failed errors typically occur as a result of outdated Python default certificates or invalid root certificates.
Read more >
How to fix Python KeyError Exceptions in simple steps?
A detailed guide to Errors and Exceptions in Python. ... Due to some errors or incorrect commands, the output will not be displayed....
Read more >
ssl — TLS/SSL wrapper for socket objects — Python 3.11.1 ...
This section documents the objects and functions in the ssl module; for more general information about TLS, SSL, and certificates, the reader is...
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