[BUG] 403 Client Error: Forbidden for url: http://localhost:5000/gateway/chat/invocations #10373
Open
3 of 23 tasks
Labels
area/deployments
MLflow Deployments client APIs, server, and third-party Deployments integrations
bug
Something isn't working
integrations/azure
Azure and Azure ML integrations
Issues Policy acknowledgement
Where did you encounter this bug?
Local machine
Willingness to contribute
No. I cannot contribute a bug fix at this time.
MLflow version
System information
Describe the problem
Hello,
Getting 403 errors when trying to use MLFlow Gateway on on-prem Azure OpenAI deployments.
Trying to run example query code: https://gist.github.com/astan-iq/8da7001dede5b3aa6ecefa309f6e4a37
on a gateway running:
mlflow gateway start --config-path llm_gateway.yaml --port 5000
using the following gateway config: https://gist.github.com/astan-iq/9b264a5f1f06a96c764e2c16517b0987
I get:
requests.exceptions.HTTPError: 403 Client Error: Forbidden for url: http://localhost:5000/gateway/chat/invocations
Hitting the REST API:
I get:
{"detail":"invalid token provided: token contains an invalid number of segments"}
It would appear that the token is the issue, however I am using the same token as per this gist here: https://gist.github.com/astan-iq/f9486eea5e89e7ab0aff9608f474686f (which works fine).
It is likely that the configuration is at fault however any advise on how to debug the issue would be greatly appreciated.
Tracking information
System information: Darwin Darwin Kernel Version 22.4.0: Mon Mar 6 20:59:28 PST 2023; root:xnu-8796.101.5~3/RELEASE_ARM64_T6000
Python version: 3.8.17
MLflow version: 2.8.0
MLflow module location: /Users/USER/miniconda3/envs/dev/lib/python3.8/site-packages/mlflow/init.py
Tracking URI: file:///Users/USER/mlruns
Registry URI: file:///Users/USER/mlruns
MLflow environment variables:
MLFLOW_GATEWAY_URI: http://localhost:5000
MLflow dependencies:
Flask: 2.2.5
Jinja2: 3.0.3
aiohttp: 3.8.5
alembic: 1.11.2
boto3: 1.28.84
click: 8.1.6
cloudpickle: 2.2.1
databricks-cli: 0.17.7
docker: 6.1.3
entrypoints: 0.4
fastapi: 0.104.1
gitpython: 3.1.32
gunicorn: 20.1.0
importlib-metadata: 5.2.0
markdown: 3.4.4
matplotlib: 3.5.3
numpy: 1.23.5
packaging: 21.3
pandas: 1.4.4
prometheus-flask-exporter: 0.22.4
protobuf: 3.19.4
psutil: 5.9.5
pyarrow: 12.0.1
pydantic: 1.10.2
pysftp: 0.2.9
pytz: 2022.7.1
pyyaml: 6.0.1
querystring-parser: 1.2.4
requests: 2.31.0
scikit-learn: 1.0.2
scipy: 1.10.1
sqlalchemy: 1.4.49
sqlparse: 0.4.4
uvicorn: 0.24.0.post1
virtualenv: 20.24.3
watchfiles: 0.21.0
Code to reproduce issue
Client code, expected to work: https://gist.github.com/astan-iq/8da7001dede5b3aa6ecefa309f6e4a37
Gateway config: https://gist.github.com/astan-iq/9b264a5f1f06a96c764e2c16517b0987
What works: https://gist.github.com/astan-iq/f9486eea5e89e7ab0aff9608f474686f
Stack trace
Other info / logs
Gateway outputs
What component(s) does this bug affect?
area/artifacts
: Artifact stores and artifact loggingarea/build
: Build and test infrastructure for MLflowarea/docs
: MLflow documentation pagesarea/examples
: Example codearea/gateway
: AI Gateway service, Gateway client APIs, third-party Gateway integrationsarea/model-registry
: Model Registry service, APIs, and the fluent client calls for Model Registryarea/models
: MLmodel format, model serialization/deserialization, flavorsarea/recipes
: Recipes, Recipe APIs, Recipe configs, Recipe Templatesarea/projects
: MLproject format, project running backendsarea/scoring
: MLflow Model server, model deployment tools, Spark UDFsarea/server-infra
: MLflow Tracking server backendarea/tracking
: Tracking Service, tracking client APIs, autologgingWhat interface(s) does this bug affect?
area/uiux
: Front-end, user experience, plotting, JavaScript, JavaScript dev serverarea/docker
: Docker use across MLflow's components, such as MLflow Projects and MLflow Modelsarea/sqlalchemy
: Use of SQLAlchemy in the Tracking Service or Model Registryarea/windows
: Windows supportWhat language(s) does this bug affect?
language/r
: R APIs and clientslanguage/java
: Java APIs and clientslanguage/new
: Proposals for new client languagesWhat integration(s) does this bug affect?
integrations/azure
: Azure and Azure ML integrationsintegrations/sagemaker
: SageMaker integrationsintegrations/databricks
: Databricks integrationsThe text was updated successfully, but these errors were encountered: