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

[BUG] AttributeError: type object 'FileOptions' has no attribute 'RegisterExtension' #11811

Open
2 of 23 tasks
ccorley-bbai opened this issue Apr 24, 2024 · 4 comments · May be fixed by #12048
Open
2 of 23 tasks

[BUG] AttributeError: type object 'FileOptions' has no attribute 'RegisterExtension' #11811

ccorley-bbai opened this issue Apr 24, 2024 · 4 comments · May be fixed by #12048
Labels
area/build Build and test infrastructure for MLflow bug Something isn't working has-closing-pr This issue has a closing PR

Comments

@ccorley-bbai
Copy link

Issues Policy acknowledgement

  • I have read and agree to submit bug reports in accordance with the issues policy

Where did you encounter this bug?

Local machine

Willingness to contribute

No. I cannot contribute a bug fix at this time.

MLflow version

using mlflow-skinny:
mlflow, version 2.12.1

System information

  • MacOS Ventura 13.6.6
  • Python 3.10.11
  • Docker Desktop 4.29.0
  • Container base image: python:3.10.11-alpine3.18

Describe the problem

When upgrading mlflow-skinny from 2.11.1 to 2.12.1, we encountered the following problem in our python:3.10.11-alpine3.18 container, causing the container to not start:

File "/home/app/venv/lib/python3.10/site-packages/mlflow/__init__.py", line 34, in <module>
app  |     from mlflow import (
app  |   File "/home/app/venv/lib/python3.10/site-packages/mlflow/artifacts/__init__.py", line 9, in <module>
app  |     from mlflow.exceptions import MlflowException
app  |   File "/home/app/venv/lib/python3.10/site-packages/mlflow/exceptions.py", line 4, in <module>
app  |     from mlflow.protos.databricks_pb2 import (
app  |   File "/home/app/venv/lib/python3.10/site-packages/mlflow/protos/databricks_pb2.py", line 17, in <module>
app  |     from .scalapb import scalapb_pb2 as scalapb_dot_scalapb__pb2
app  |   File "/home/app/venv/lib/python3.10/site-packages/mlflow/protos/scalapb/scalapb_pb2.py", line 53, in <module>
app  |     google_dot_protobuf_dot_descriptor__pb2.FileOptions.RegisterExtension(options)
app  | AttributeError: type object 'FileOptions' has no attribute 'RegisterExtension'

Using mlflow-skinny 2.12.1 requires protobuf <6,>=3.12.0, however in protobuf 5.x, the deprecated RegisterExtension was removed. Adding protobuf==4.25.3 (the last version before 5.x) to our requirements.txt fixed the problem.

Tracking information

No response

Code to reproduce issue

  1. Create an app.py file:
import mlflow

def main():
    print("Hello World!")

if __name__ == "__main__":
    main()
  1. Create a requirements.txt file:
mlflow-skinny==2.12.1
  1. Create a Dockerfile:
FROM python:3.10.11-alpine3.18

# configure user and group
RUN addgroup -S myuser && \
    adduser -S myuser -G myuser -h /home/myuser

# configure app
WORKDIR /home/myuser/app
COPY --chown=myuser:myuser app.py .
COPY --chown=myuser:myuser requirements.txt .

USER myuser

RUN python -m venv ~/venv && \
    source ~/venv/bin/activate && \
    python -m pip install -r requirements.txt

ENTRYPOINT ["/home/myuser/venv/bin/python", "app.py"]
  1. Build the image:
docker build .
  1. Start a container using the docker image id:
docker run <image_id>

You should see:

Traceback (most recent call last):
  File "/home/myuser/app/app.py", line 1, in <module>
    import mlflow
  File "/home/myuser/venv/lib/python3.10/site-packages/mlflow/__init__.py", line 34, in <module>
    from mlflow import (
  File "/home/myuser/venv/lib/python3.10/site-packages/mlflow/artifacts/__init__.py", line 9, in <module>
    from mlflow.exceptions import MlflowException
  File "/home/myuser/venv/lib/python3.10/site-packages/mlflow/exceptions.py", line 4, in <module>
    from mlflow.protos.databricks_pb2 import (
  File "/home/myuser/venv/lib/python3.10/site-packages/mlflow/protos/databricks_pb2.py", line 17, in <module>
    from .scalapb import scalapb_pb2 as scalapb_dot_scalapb__pb2
  File "/home/myuser/venv/lib/python3.10/site-packages/mlflow/protos/scalapb/scalapb_pb2.py", line 53, in <module>
    google_dot_protobuf_dot_descriptor__pb2.FileOptions.RegisterExtension(options)
AttributeError: type object 'FileOptions' has no attribute 'RegisterExtension'

Stack trace

Traceback (most recent call last):
  File "/home/myuser/app/app.py", line 1, in <module>
    import mlflow
  File "/home/myuser/venv/lib/python3.10/site-packages/mlflow/__init__.py", line 34, in <module>
    from mlflow import (
  File "/home/myuser/venv/lib/python3.10/site-packages/mlflow/artifacts/__init__.py", line 9, in <module>
    from mlflow.exceptions import MlflowException
  File "/home/myuser/venv/lib/python3.10/site-packages/mlflow/exceptions.py", line 4, in <module>
    from mlflow.protos.databricks_pb2 import (
  File "/home/myuser/venv/lib/python3.10/site-packages/mlflow/protos/databricks_pb2.py", line 17, in <module>
    from .scalapb import scalapb_pb2 as scalapb_dot_scalapb__pb2
  File "/home/myuser/venv/lib/python3.10/site-packages/mlflow/protos/scalapb/scalapb_pb2.py", line 53, in <module>
    google_dot_protobuf_dot_descriptor__pb2.FileOptions.RegisterExtension(options)
AttributeError: type object 'FileOptions' has no attribute 'RegisterExtension'

Other info / logs

No response

What component(s) does this bug affect?

  • area/artifacts: Artifact stores and artifact logging
  • area/build: Build and test infrastructure for MLflow
  • area/deployments: MLflow Deployments client APIs, server, and third-party Deployments integrations
  • area/docs: MLflow documentation pages
  • area/examples: Example code
  • area/model-registry: Model Registry service, APIs, and the fluent client calls for Model Registry
  • area/models: MLmodel format, model serialization/deserialization, flavors
  • area/recipes: Recipes, Recipe APIs, Recipe configs, Recipe Templates
  • area/projects: MLproject format, project running backends
  • area/scoring: MLflow Model server, model deployment tools, Spark UDFs
  • area/server-infra: MLflow Tracking server backend
  • area/tracking: Tracking Service, tracking client APIs, autologging

What interface(s) does this bug affect?

  • area/uiux: Front-end, user experience, plotting, JavaScript, JavaScript dev server
  • area/docker: Docker use across MLflow's components, such as MLflow Projects and MLflow Models
  • area/sqlalchemy: Use of SQLAlchemy in the Tracking Service or Model Registry
  • area/windows: Windows support

What language(s) does this bug affect?

  • language/r: R APIs and clients
  • language/java: Java APIs and clients
  • language/new: Proposals for new client languages

What integration(s) does this bug affect?

  • integrations/azure: Azure and Azure ML integrations
  • integrations/sagemaker: SageMaker integrations
  • integrations/databricks: Databricks integrations
@ccorley-bbai ccorley-bbai added the bug Something isn't working label Apr 24, 2024
@github-actions github-actions bot added the area/build Build and test infrastructure for MLflow label Apr 24, 2024
@daniellok-db
Copy link
Collaborator

Thanks for reporting! I've filed #11816 to fix.

@harupy
Copy link
Member

harupy commented Apr 25, 2024

protocolbuffers/protobuf#11863 (comment) says:

RegisterExtension() has been removed from message_factory.py. The issue should been fixed

We can use one of the protoc versions released after Aug 16, 2023 to re-compile our protos.

Copy link

github-actions bot commented May 2, 2024

@mlflow/mlflow-team Please assign a maintainer and start triaging this issue.

@harupy
Copy link
Member

harupy commented May 8, 2024

Fixed by #11816

@harupy harupy closed this as completed May 8, 2024
@harupy harupy reopened this May 19, 2024
@harupy harupy linked a pull request May 19, 2024 that will close this issue
39 tasks
@github-actions github-actions bot added the has-closing-pr This issue has a closing PR label May 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/build Build and test infrastructure for MLflow bug Something isn't working has-closing-pr This issue has a closing PR
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants