Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

REST API not working #41

Open
LLITiF opened this issue Oct 17, 2024 · 0 comments
Open

REST API not working #41

LLITiF opened this issue Oct 17, 2024 · 0 comments

Comments

@LLITiF
Copy link

LLITiF commented Oct 17, 2024

Hello. I was running Mlflow in k8s as container builded with Dockerfile: #33 (comment)
And UI authentification works perfect.

But when I'm trying to use it as REST API - it always fails with strange problem. AUTH URL works, but after login it just redirect to main page with authentication button.

Code used to connect:
import mlflow

MLFLOW_TRACKING_USERNAME= "username"
MLFLOW_TRACKING_PASSWORD= "password"
MLFLOW_TRACKING_URI="http://mlflow.path"

mlflow.set_tracking_uri(uri=MLFLOW_TRACKING_URI)
mlflow.set_experiment("test_test_test")

with mlflow.start_run():
    mlflow.log_param("loss_fn", "rmse")
    mlflow.log_metric("loss_fn", 10)

And part of error:

mlflow.exceptions.MlflowException: API request to endpoint was successful but the response body was not in a valid JSON format. Response body: '<!DOCTYPE html>
<html lang="en-US">

<head>
    <title>Login</title>
    <link rel="stylesheet" href="/oidc/static/style.css">
    <link rel="shortcut icon" href="/oidc/static/favicon.ico">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css">
</head>

I was also tried to skip mlflow auth plugin and run it just with requests into url: mlflow.path/api/2.0/mlflow/users/get and got the same

Tested versions:
MLFlow 2.16.2 + 2.0.0 OIDC
MLFlow 2.17.0 + 2.0.2 OIDC

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant