I'm trying out the (relatively) new azure containe...
# prefect-community
o
I'm trying out the (relatively) new azure container instance blocks and I'm getting the following error when attempting to run a flow on my VM: KeyError: "No class found for dispatch key 'azure-container-instance-job' in registry for type 'Block'." Any ideas as to what the cause might be? I have prefect-azure installed on the VM. It seems to run fine on my local machine and I can't figure out what the difference is.
r
Did you register the block on the VM?
I'll add a line in the article to mention that
o
I attempted to do so but I'm getting various errors, wasn't sure if it might actually be a mistake that it's in the docs
Good to know that I'm meant to do that though, I'll keep trying to figure out why it's not working. Thank you.
This is the current error: Unable to load prefect_azure.container_instance. Please make sure the module is installed in your current environment. Even though my VM installs with: pip3 install prefect==2.6.5 prefect-azure==0.2.2
r
Does running
pip3 list
show prefect-azure installed? I'm wondering if the block registration CLI runs into trouble when pip and python have the
3
postfix. That's one thing I didn't test when registering the Azure block, but I will try it now. What OS are you running on the VM? I'll try to duplicate the setup so I can reproduce the error.
o
Yeah, shows up under list. It's Microsoft's standard Ubuntu 20.04 VM image
Python 3.8 I tried just using pip now but it made no difference, for some reason I have to use pip3 in the VM cloudinit script.
I think your guide instructions were fine by the way, it's "prefect block register --help" that contradicts you a bit by stating: "This makes the blocks available for configuration via the UI". Makes it seem like it's not necessary if the blocks are already available in the UI.
Let me know if having my whole cloudinit would be helpful, appreciate you looking into it. I feels like I'm making a silly mistake somewhere but I can't figure out what.
r
Seeing the cloudinit might help; feel free to DM it if you'd prefer that over posting it here
Now that you mention the help message, I think might be correct. It used to be that we didn't export the container instance block at the top level of
prefect_azure
, so you had to register it. But now it's exported at the module top level, so I think the block will auto-register locally now. But it's still good that you ran the registration command because I suspect whatever is causing that issue is also causing the other problem
o
Yeah, seems to me like it's indicative of something being weird with the module or how it's installed. Would expect a different message otherwise.