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

Protobuf "File already exists in database" error in osx #1830

Closed
CaselIT opened this issue Jan 7, 2020 · 8 comments
Closed

Protobuf "File already exists in database" error in osx #1830

CaselIT opened this issue Jan 7, 2020 · 8 comments
Assignees
Labels
Milestone

Comments

@CaselIT
Copy link

CaselIT commented Jan 7, 2020

Hi,

I'm getting this error using osx catalina with ortools==7.4.7247 under python 3.7 while creating a model

[libprotobuf ERROR /Users/lperron/Work/or-tools/dependencies/sources/protobuf-3.10.0/src/google/protobuf/descriptor_database.cc:120] File already exists in database: proto3
[libprotobuf FATAL /Users/lperron/Work/or-tools/dependencies/sources/protobuf-3.10.0/src/google/protobuf/descriptor.cc:1359] CHECK failed: GeneratedDatabase()->Add(encoded_file_descriptor, size):
libc++abi.dylib: terminating with uncaught exception of type google::protobuf::FatalException: CHECK failed: GeneratedDatabase()->Add(encoded_file_descriptor, size):

The protobuf version is protobuf==3.11.2. Downgrading protobuf to version 3.10 has the same problem.
I've tried downgrading or-tools to versions 7.3.x, 7.2.x and 7.1.x and all have similar problems with protobuf (not exactly the same error, but it fails in the same point in my program). Version 7.0.x works correctly.

The program I'm running uses also tensorflow (version 1.13.1) and loads some models before using ortools. The same program works correctly under linux (ubuntu 18.04) and windows 10

Thank you

@CervEdin
Copy link

CervEdin commented Jan 7, 2020

@CaselIT
Copy link
Author

CaselIT commented Jan 7, 2020

It seems indeed similar, but I'm not using pyarrow (it is not installed in the env)

@CervEdin
Copy link

CervEdin commented Jan 7, 2020

maybe you're experiencing the same problem but with TF?

@CervEdin
Copy link

CervEdin commented Jan 7, 2020

fyi, here's another issue with protobuf/tf
#681

@CaselIT
Copy link
Author

CaselIT commented Jan 7, 2020

Thanks, I'll try checking if the solution in that issue works and/or fiddling with the import order.

Thanks

@CaselIT
Copy link
Author

CaselIT commented Jan 7, 2020

So to reproduce just run

import tensorflow
import ortools.linear_solver.pywraplp

inverting the imports seems to "fix" the issue

this is with tensorflow==1.13.1. I have not tried other versions

@Mizux
Copy link
Collaborator

Mizux commented Jan 7, 2020

kind of duplicate of #1829
Long story python can only load one Protobuf native shared library so tensorflow and or-tools must be "in sync" please follow #1829 once done you may recompile or-tools from source and use this python package which will be based on the last Protobuf release...

@Mizux Mizux closed this as completed Jan 7, 2020
@Mizux Mizux added Bug Duplicate Lang: Python Python wrapper issue labels Jan 7, 2020
@Mizux Mizux added this to the v7.5 milestone Jan 7, 2020
@Mizux Mizux self-assigned this Jan 7, 2020
@CaselIT
Copy link
Author

CaselIT commented Jan 7, 2020

Strange that only osx has the problem.
I think the version of tensorflow that I use has protobuf requirement >=3.6.1 for so I guess it may make sense that or-tools that requires version >=3.10 crashes if the older version is loaded. (But it's strange that is does not load the installed version that is the 3.11.2.)

I'll use the import order workaround for now, and try again when 7.5 is out.

Thanks

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

No branches or pull requests

3 participants