Antreas Pogiatzis
01/30/2025, 8:44 PMFailed due to a(n) NameError caused by accessing a local variable 'sb' without a value associated with it. Further investigation should focus on where 'sb' is defined and how it is being used in the context of the Prefect flow.
I think it's something to do with sandboxes.
The invocations are popping up in the modal dashboard but without any logs:
Has anyone experiences something similar before? Does anyone have any tips to assist?Nate
01/30/2025, 8:49 PMFailed due to a(n) NameError caused by accessing a local variable 'sb' without a value associated with it. Further investigation should focus on where 'sb' is defined and how it is being used in the context of the Prefect flow.is the flow run error summary, which suggests there's unbound variable issue in your code
Nate
01/30/2025, 8:50 PMAntreas Pogiatzis
01/30/2025, 8:57 PM@flow
def hello_world():
print("Hello World")
if __name__ == "__main__":
deployment = hello_world.deploy(
name="subdomain-discovery",
work_pool_name="bb-modal-pool",
image="<http://ghcr.io/apogiatzis/hello-image:latest|ghcr.io/apogiatzis/hello-image:latest>",
)
Antreas Pogiatzis
01/30/2025, 8:59 PMis the flow run error summary, which suggests there's unbound variable issue in your codeThis is the indeed the flow run error summary, but I don't see how that could have been triggered by the flow code. I am suspecting that something going on between prefect <-> modal integration
Jake Kaplan
01/30/2025, 9:01 PMAntreas Pogiatzis
01/30/2025, 9:01 PMAntreas Pogiatzis
01/30/2025, 9:03 PMbb92bb27-08a7-4055-b700-0166d86dfa7a
Antreas Pogiatzis
01/30/2025, 9:10 PMJake Kaplan
01/30/2025, 9:30 PM""
Jake Kaplan
01/30/2025, 9:33 PMimage={"tag": "<http://ghcr.io/apogiatzis/hello-image:latest|ghcr.io/apogiatzis/hello-image:latest>", "secret": "<name of private registry creds in modal>"}}
your secret in modal needs to have the keys:
REGISTRY_USERNAME: ...
REGISTRY_PASSWORD: ...
Antreas Pogiatzis
01/30/2025, 9:46 PM@flow
def hello_world():
print("Hello World")
if __name__ == "__main__":
deployment = hello_world.deploy(
name="subdomain-discovery",
work_pool_name="bb-modal-pool",
image="<http://ghcr.io/apogiatzis/hello-image:latest|ghcr.io/apogiatzis/hello-image:latest>",
)
I've manually updated my job variables from UI to look like the screenshot attached based on this.
If I use the set the image as a dictionary in the python code deployment it raises an exception when building the image.
your secret in modal needs to have the keys:
```REGISTRY_USERNAME: ...
REGISTRY_PASSWORD: ...```
Yes I have this set. So If I understood correctly then my secret name is not being picked from the job variables?
Jake Kaplan
01/30/2025, 9:49 PM{job_variables={"image": ...}}
Jake Kaplan
01/30/2025, 9:49 PMJake Kaplan
01/30/2025, 9:49 PMlatest
?Antreas Pogiatzis
01/30/2025, 9:50 PM""
Could it possibly be referring to the secret in modal (My private registry credentials)?Antreas Pogiatzis
01/30/2025, 9:50 PMcan you set the tag to the full url though, not justI've tried already but I can try again, was just experimenting with different values?latest
Jake Kaplan
01/30/2025, 9:51 PMJake Kaplan
01/30/2025, 9:55 PMmodal.exception.NotFoundError: Could not find secret: 'bb-modal-pool-modal-credentials'
Antreas Pogiatzis
01/30/2025, 9:55 PMcan you set the tag to the full url though, not justJust tried again with the full image url as the?latest
tag
value but I'm still get same result.
you're not passing any other secrets to include in your image right? just the one to access the registry?I'm not passing any secrets explicitly to be honest. I was under the impression that modal will automatically pick up REGISTRY_USERNAME and REGISTRY_PASSWORD
Antreas Pogiatzis
01/30/2025, 9:56 PMOhhh I think I get it now... I was passing in the name of my modal credentials block in prefect but I guess I need to pass the secret name in model for the registry credentials (Copy codemodal.exception.NotFoundError: Could not find secret: 'bb-modal-pool-modal-credentials'
<http://ghcr.io|ghcr.io>
)Jake Kaplan
01/30/2025, 9:56 PMAntreas Pogiatzis
01/30/2025, 9:59 PMJake Kaplan
01/30/2025, 10:00 PM<http://ghcr.io|ghcr.io>
Jake Kaplan
01/30/2025, 10:00 PMJake Kaplan
01/30/2025, 10:01 PMJake Kaplan
01/30/2025, 10:01 PMmodal.exception.NotFoundError: Could not find secret: '<http://ghcr.io|ghcr.io> '.
Antreas Pogiatzis
01/30/2025, 10:01 PMapologies, this is the error that you should be seeing directly once I get this fix outNo worries thanks for looking into it!
Antreas Pogiatzis
01/30/2025, 10:03 PMAntreas Pogiatzis
01/30/2025, 10:04 PMAntreas Pogiatzis
01/30/2025, 10:07 PMAntreas Pogiatzis
01/30/2025, 10:10 PM