Thread
#prefect-community
    j

    Jai Deo

    1 year ago
    I have cloud server, kubernetes AKS agent and a flow in Azure storage with a customised container image in azure container registry. When I run the flow it fails on authorisation 401. I have supplied the password to the image in the imagepullsecrets env variable. The error is : Kubernetes Error: rpc error: code = Unknown desc = failed to pull and unpack image "prefregistry.azurecr.io/mstools:v1": failed to resolve reference "prefregistry.azurecr.io/mstools:v1": failed to authorize: failed to fetch anonymous token: unexpected status: 401 Unauthorized.
    Kevin Kho

    Kevin Kho

    1 year ago
    Hey @Jai Deo,could you show me about you passed the authentication to the flow/agent? Just remove the sensitive stuff.
    j

    Jai Deo

    1 year ago
    Hi Kevin - its only test data:-
    flow.run_config=KubernetesRun( #image="prefregistry/mstools:v1", image="prefregistry.azurecr.io/mstools:v1", #image="prefecthq/prefect:0.15.3-python3.8", env={"AZURE_STORAGE_CONNECTION_STRING": "DefaultEndpointsProtocol=https;AccountName=prefstorage;AccountKey=uXTpTyGL/9AEoWgOp5TrYRO4x85LyR0dqGttab3eKztv4Qt2PO66zrjfZckgax+bs64QFGFsGGIhsTn8noY61Q==;EndpointSuffix=core.windows.net", "EXTRA_PIP_PACKAGES": "pandas scikit-learn matplotlib"}, labels=["ccc"], image_pull_secrets=["nDGL1hX5MqjCAqNcdBlXqe5BR=69sgYB"], cpu_request=1, memory_request="1Gi" )
    Kevin Kho

    Kevin Kho

    1 year ago
    Can I see your storage also? I’ll figure out the right syntax.
    j

    Jai Deo

    1 year ago
    flow.storage=Azure(container="ccc", connection_string="DefaultEndpointsProtocol=https;AccountName=prefstorage;AccountKey=uXTpTyGL/9AEoWgOp5TrYRO4x85LyR0dqGttab3eKztv4Qt2PO66zrjfZckgax+bs64QFGFsGGIhsTn8noY61Q==;EndpointSuffix=core.windows.net")
    Kevin Kho

    Kevin Kho

    1 year ago
    So does the build go through but the flow run fails?
    j

    Jai Deo

    1 year ago
    yes
    Kevin Kho

    Kevin Kho

    1 year ago
    And you see the container in the registry when you check right?
    j

    Jai Deo

    1 year ago
    yes
    Kevin Kho

    Kevin Kho

    1 year ago
    Ok I’ll try to figure this out
    j

    Jai Deo

    1 year ago
    Thanks
    Hi Kevin, I think the error was at my end - I forgot to give necessary access permissions on the image . I t is working now
    Kevin Kho

    Kevin Kho

    1 year ago
    Oh thanks for mentioning! Amazing you got this all working in a day!