azure-sdk-for-python icon indicating copy to clipboard operation
azure-sdk-for-python copied to clipboard

Cannot log artifact in azure ml using mlflow

Open MalcolmMielle opened this issue 1 year ago • 15 comments

  • Package Name: azure-ai-ml and aure-mlflow
  • Package Version: 1.28.1 and 1.60.0
  • Operating System: Ubuntu 24
  • Python Version: 3,10

Describe the bug Logging an artifact or image on azure crashing due to unknown tracking_uri argument

To Reproduce Steps to reproduce the behavior:

  1. Start a job
  2. Save an artifact
  3. Crash

Crash is

  File "/home/ubuntu/.venv/lib/python3.10/site-packages/mlflow/tracking/fluent.py", line 1427, in log_artifact
    MlflowClient().log_artifact(run_id, local_path, artifact_path)
  File "/home/ubuntu/.venv/lib/python3.10/site-packages/mlflow/tracking/client.py", line 2465, in log_artifact
    self._tracking_client.log_artifact(run_id, local_path, artifact_path)
  File "/home/ubuntu/.venv/lib/python3.10/site-packages/mlflow/tracking/_tracking_service/client.py", line 644, in log_artifact
    artifact_repo = self._get_artifact_repo(run_id)
  File "/home/ubuntu/.venv/lib/python3.10/site-packages/mlflow/tracking/_tracking_service/client.py", line 627, in _get_artifact_repo
    artifact_repo = get_artifact_repository(artifact_uri)
  File "/home/ubuntu/.venv/lib/python3.10/site-packages/mlflow/store/artifact/artifact_repository_registry.py", line 143, in get_artifact_repository
    return _artifact_repository_registry.get_artifact_repository(artifact_uri, tracking_uri)
  File "/home/ubuntu/.venv/lib/python3.10/site-packages/mlflow/store/artifact/artifact_repository_registry.py", line 81, in get_artifact_repository
    return repository(artifact_uri, tracking_uri=tracking_uri)
TypeError: azureml_artifacts_builder() got an unexpected keyword argument 'tracking_uri'

Expected behavior A clear and concise description of what you expected to happen.

The artifact should be logged correctly

MalcolmMielle avatar Aug 21 '25 10:08 MalcolmMielle

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @Azure/azure-ml-sdk @azureml-github.

github-actions[bot] avatar Aug 21 '25 15:08 github-actions[bot]

@MalcolmMielle - Can you please share your logging code. I just ran sample from example repo, and it logged the artifacts. https://github.com/Azure/azureml-examples/blob/902929725e8d713447c99f80e4530c83075ecd9b/cli/jobs/basics/hello-mlflow.yml#L3

it could be the environment that you are using may not have azureml-mlfow?

achauhan-scc avatar Aug 25 '25 05:08 achauhan-scc

My environment has azureml-mlflow==1.60.0 (I do a pip freeze at the end of building it to make sure). I alos have mlflow-skinny==3.2.0rc0 and I know the problem is with the newer version of mlflow because working with older version of mlflow works.

My code is simply:

mlflow.log_artifact(fig, "log_figure.png")

I'll try to get more information later

MalcolmMielle avatar Aug 25 '25 13:08 MalcolmMielle

@MalcolmMielle @achauhan-scc I had the same issue and after some days of investigation I finally found the root cause. It's related to mlflow or mlflow-skinny versions. azureml-mlflow is incompatible with "mlflow>=3.0.0". Since azureml-mlflow does not restrict its mlflow to <3.0.0 you can cause this error after each new dependecy resolution. A fix should be to prevent azureml-mlflow from allowing mlflow>3.0.0

inarighas avatar Sep 09 '25 10:09 inarighas

@inarighas downgrading mlflow fixed the issue for me.

shanmukh98 avatar Sep 09 '25 11:09 shanmukh98

Do we have MR handling this issue? thanks

tiagofrepereira2012 avatar Sep 09 '25 11:09 tiagofrepereira2012

When will azureml-mlflow be made compatible with mlflow v3?

RandomFlorist avatar Sep 11 '25 11:09 RandomFlorist

Compatibility of azureml-mlflow with mlflow v3 is key for our team, not only for functionality but also for patching security vulnerabilities.

hugobettmach avatar Sep 11 '25 12:09 hugobettmach

I encountered the same issue, but I found a solution. Please edit the relevant section of the following file. This resolved it in my case.

.venv/lib/python3.10/site-packages/mlflow/store/artifact/artifact_repository_registry.py

# L81
return repository(artifact_uri)

(delete tracking_uri.)

liverHawk avatar Oct 10 '25 10:10 liverHawk

I also have this issue.

phinate avatar Oct 14 '25 12:10 phinate

please use azureml-mlflow == 1.60.0.post1 version. this version is restricting the mlflow-skinny to < 3. This version has this restriction since April 2025. https://libraries.io/pypi/azureml-mlflow/1.60.0.post1.

jayesh-tanna avatar Oct 23 '25 12:10 jayesh-tanna

Hi @MalcolmMielle. Thank you for opening this issue and giving us the opportunity to assist. We believe that this has been addressed. If you feel that further discussion is needed, please add a comment with the text "/unresolve" to remove the "issue-addressed" label and continue the conversation.

github-actions[bot] avatar Oct 23 '25 12:10 github-actions[bot]

Hi @MalcolmMielle, since you haven’t asked that we /unresolve the issue, we’ll close this out. If you believe further discussion is needed, please add a comment /unresolve to reopen the issue.

github-actions[bot] avatar Oct 30 '25 16:10 github-actions[bot]

When will the version of azureml-mlflow be updated to work with mlflow >= 3?

BenConstable9 avatar Jan 02 '26 12:01 BenConstable9

Please use azureml-mlflow > 1.60.0.post1 in order to use mlflow > 3. These versions have the compatibility with mlflow > 3

jayesh-tanna avatar Jan 08 '26 12:01 jayesh-tanna