https://pulumi.com logo
#python
Title
# python
i

incalculable-sundown-82514

02/06/2019, 7:20 PM
well, do you see an exception in there? 😄
l

little-river-49422

02/06/2019, 7:21 PM
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

incalculable-sundown-82514

02/06/2019, 7:24 PM
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

little-river-49422

02/06/2019, 7:24 PM
no 🙂 thats the problem
i

incalculable-sundown-82514

02/06/2019, 7:24 PM
right, that’s why I asked 😄
just being clear
what version of Python are you using?
l

little-river-49422

02/06/2019, 7:26 PM
3.6.8
i

incalculable-sundown-82514

02/06/2019, 7:29 PM
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

little-river-49422

02/06/2019, 7:33 PM
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

incalculable-sundown-82514

02/06/2019, 7:33 PM
Is that all that’s in
helpers.py
?
l

little-river-49422

02/06/2019, 7:34 PM
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

incalculable-sundown-82514

02/06/2019, 7:36 PM
oh, what was it?
l

little-river-49422

02/06/2019, 7:36 PM
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

incalculable-sundown-82514

02/06/2019, 7:37 PM
oh! I bet I know what happened, then
l

little-river-49422

02/06/2019, 7:37 PM
or have more meaningful errors? like line number or something?
i

incalculable-sundown-82514

02/06/2019, 7:37 PM
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

little-river-49422

02/06/2019, 7:40 PM
ok, it might be just my poor python skills, but I get that nonetype:none error all the time
i

incalculable-sundown-82514

02/06/2019, 7:42 PM
yeah - I believe this happens when Python throws an uncatchable error. Can you create an issue?
with a repro, if possible
l

little-river-49422

02/06/2019, 7:56 PM
sure, let me try tomorrow