well, do you see an exception in there? :smile:
# python
i
well, do you see an exception in there? 😄
l
not really:
Copy code
debug: registering resource: ty=pulumi:pulumi:Stack, name=azure-py-kubernetes-aks-branch-test, custom=False
    debug: preparing resource for RPC
    debug: Waiting for outstanding RPCs to complete
    debug: beginning rpc register resource
    debug: recorded new RPC, 1 RPCs outstanding
    debug: preparing resource registration: ty=pulumi:pulumi:Stack, name=azure-py-kubernetes-aks-branch-test
    debug: resource {} preparing to wait for dependencies
    debug: resource {} prepared
    debug: resource registration prepared: ty=pulumi:pulumi:Stack, name=azure-py-kubernetes-aks-branch-test
    debug: resource registration successful: ty=pulumi:pulumi:Stack, urn=urn:pulumi:aks-branch-test::azure-py-kubernetes::pulumi:pulumi:Stack::azure-py-kubernetes-aks-branch-test    debug: All RPC completed, signalling completion
    debug: recorded RPC completion, 0 RPCs outstanding
    debug: Canceling all outstanding tasks
    debug: run_in_stack completed
    error: Program failed with an unhandled exception:
    error: NoneType: None
    error: an unhandled error occurred: Program exited with non-zero exit code: 1
before that a bunch of rest calls to azure api, no errors there, i think
i
hmm, I’m not really sure how this happened - somewhere an exception is being thrown but it’s not an actual exception (
NoneType: None
). Do you know where this exception is occurring in your code or do we need to figure it out?
l
no 🙂 thats the problem
i
right, that’s why I asked 😄
just being clear
what version of Python are you using?
l
3.6.8
i
hmm
I honestly have no idea how this can be happening - Python claims to have caught an exception but it also doesn’t think that one is active. Do you mind sending a full repro? Or minimizing the one you have if possible?
If you’d like I can also try and pair debug this, but to do that we’ll need to edit some files that came with your Pulumi installation - not sure if you want to do that.
If you’re able to minimize the repo, that would be even more awesome
l
it appears as soon as I do this everything breaks: helpers.py
Copy code
LOCATION = config.get('location') or 'westeurope'
inflation.py
Copy code
from helpers import gen_name, gen_pod, LOCATION

def run_inflation():
    rg = ResourceGroup(
        'rg',
        name=gen_name('rg'),
        location=LOCATION
    )
i
Is that all that’s in
helpers.py
?
l
no, there's a lot more, but everything works. i add this bit and add that bit in the inflation.py and things go south (
originally inflation.py looks like this:
Copy code
from helpers import gen_name, gen_pod, get_location


def run_inflation():
    rg = ResourceGroup(
        'rg',
        name=gen_name('rg'),
        location=get_location()
    )
oh, ok. i found it
i
oh, what was it?
l
using a function before declaring it. i wonder why vscode didnt catch that
anyway, this kinda brings another question. is there no way to step through with debugger?
i
oh! I bet I know what happened, then
l
or have more meaningful errors? like line number or something?
i
re: a debugger, there is this: https://github.com/pulumi/pulumi/issues/1372
For meaningful errors, we can do better. The problem is that Python is throwing an uncatchable error that unfortunately messes us up. I think we can fix that to provide a more actionable error
l
ok, it might be just my poor python skills, but I get that nonetype:none error all the time
i
yeah - I believe this happens when Python throws an uncatchable error. Can you create an issue?
with a repro, if possible
l
sure, let me try tomorrow