pythonmlopsmlrun

MLRunPreconditionFailedError: 412 Client Error, "API is waiting for migrations to be triggered"


I got this error:

MLRunPreconditionFailedError: 412 Client Error: Precondition Failed for url: http://localhost:8080/api/v1/projects: Failed creating project tutorial-<name> details: 
MLRunPreconditionFailedError('API is waiting for migrations to be triggered. Send POST request to [/api/operations/migrations](https://file+.vscode-resource.vscode-cdn.net/api/operations/migrations) to trigger it')

when I called this source code:

import mlrun
...
mlrun.set_env_from_file(envFile)
project = mlrun.get_or_create_project("test", "./", user_project=True)

I used MLRun CE 1.3.0 in Desktop Docker. Did you solve the issue?


Solution

  • It is necessity to wait for data/schema migrations (it is the known issue see). You can force this migration based on MLRun SDK call, see:

    import mlrun
    ...
    mlrun.get_run_db().trigger_migrations()
    

    BTW: This issue can happened, when you migrate from old MLRun version to the new one.