Getting a really odd issue. using pulumi v3.109.0...
# python
s
Getting a really odd issue. using pulumi v3.109.0 with python 3.12.2 I'm trying to deploy a static yaml manifest using the code:
Copy code
mysql_manifest_url = 'src/yaml/mysql.yaml'
    k8s_yaml = k8s.yaml.ConfigFile("mysql", file=mysql_manifest_url,opts=pulumi.ResourceOptions(
            provider = k8s_provider,
            retain_on_delete=False,
            delete_before_replace=True,
            custom_timeouts=pulumi.CustomTimeouts(
                create="10m",
                update="10m",
                delete="10m"
            )
        ))
and i get the error:
Copy code
error: Program failed with an unhandled exception:
    Traceback (most recent call last):
      File "/opt/homebrew/bin/pulumi-language-python-exec", line 191, in <module>
        loop.run_until_complete(coro)
      File "/opt/homebrew/Cellar/python@3.12/3.12.2_1/Frameworks/Python.framework/Versions/3.12/lib/python3.12/asyncio/base_events.py", line 685, in run_until_complete
        return future.result()
               ^^^^^^^^^^^^^^^
      File "/Users/marcboorshtein/Documents/bookv3/venv/lib/python3.12/site-packages/pulumi/runtime/stack.py", line 132, in run_in_stack
        await run_pulumi_func(run)
      File "/Users/marcboorshtein/Documents/bookv3/venv/lib/python3.12/site-packages/pulumi/runtime/stack.py", line 53, in run_pulumi_func
        await wait_for_rpcs()
      File "/Users/marcboorshtein/Documents/bookv3/venv/lib/python3.12/site-packages/pulumi/runtime/stack.py", line 109, in wait_for_rpcs
        await task
    TypeError: 'module' object is not callable
The problem appears to be a
Certificate
entry:
Copy code
---
apiVersion: cert-manager.io/v1
kind: Certificate
metadata:
  name: mysql
  namespace: mysql
spec:
  secretName: mysql-tls
  duration: 2160h
  renewBefore: 360h
  subject:
    organizations:
      - k8s-enterprise-guide
  commonName: mysql.mysql.svc
  isCA: false
  privateKey:
    algorithm: RSA
    encoding: PKCS1
    size: 2048
  usages:
    - server auth
    - client auth
  dnsNames:
    - mysql.mysql.svc
  issuerRef:
    name: enterprise-ca
    kind: ClusterIssuer
    group: cert-manager.io
Is this a bug in pulumi? only thing that i can think of is that its crashing on the secret
mysql-tls
not existing?
h
usually that means you called a module, eg
os.path()
. Nothing in the provided snippet stands out as an obvious typo, so either theres a mistake in your imports, or your bug is elsewhere
s
i can confirm its here. Uncommenting the
Config
line avoids the error, as does removing the
Certificate
object from the manifest
h
well, that backtrace ends with
await task
, which for a TypeError like that means it must have been forwarded from whatever
task
was. If there's more stack trace, that might give indication if there's a bug in one of my pulumi libraries. But in my experience, weird errors coming from the middle of pulumi is actually a bug in my code that's just exposed someplace else. You might also see this behavior if any of those variables are `Output`s that only get used here (and therefore don't get resolved if you comment it out)
s
it's the entire stack trace
nothing is output
h
huh, dunno then
to be able to positively identify it as a pulumi bug, i would need to dive deep with the debugging tools. And for me, it never has been. Maybe a tool like mypy can help you find the bug? It'll almost certainly yell about a bunch of stuff, but it should be able to metaphorically say "This? This right here? It looks like you're calling a module" (Unless you're doing it indirectly by passing it through an argument)