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

HAX failed to init if no MONGO_PASSWORD is set #167

Open
l-althueser opened this issue Nov 15, 2017 · 0 comments
Open

HAX failed to init if no MONGO_PASSWORD is set #167

l-althueser opened this issue Nov 15, 2017 · 0 comments

Comments

@l-althueser
Copy link
Member

The actual HAX version can not be used with use_runs_db = False since the runs_db is used in load_corrections().

Something like this is missing in this function:

if not hax.config.get('use_runs_db', True):
        hax.log.info("Not looking for corrections in db since you put use_runs_db = False")
        return

Full error:

ValueError                                Traceback (most recent call last)
<ipython-input-7-5fbfd0efb0f6> in <module>()
      1 import hax
      2 print("HAX version: " + str(hax.__version__))
----> 3 hax.init(pax_version_policy = 'loose',use_runs_db = False,main_data_paths=main_data_paths,mini_tree_paths=mini_tree_paths)

/home/l-althueser/pax_head/hax-1.9.0/hax/__init__.py in init(filename, **kwargs)
     66 
     67     # Call some inits of the submodules
---> 68     runs.load_corrections()
     69     runs.update_datasets()
     70     minitrees.update_treemakers()

/home/l-althueser/pax_head/hax-1.9.0/hax/runs.py in load_corrections()
    460 
    461     for correction in hax.config['corrections']:
--> 462         db = get_rundb_database()
    463         if correction not in db.collection_names():
    464             log.warning("Config asked for %s correction but didn't find in DB" % correction)

/home/l-althueser/pax_head/hax-1.9.0/hax/runs.py in get_rundb_database()
     43     if rundb_client is None:
     44         # Connect to the runs database
---> 45         rundb_client = pymongo.MongoClient(hax.config['runs_url'].format(password=get_rundb_password()))
     46     return(rundb_client[hax.config['runs_database']])
     47 

/home/l-althueser/pax_head/hax-1.9.0/hax/runs.py in get_rundb_password()
     34         return os.environ['MONGO_PASSWORD']
     35     else:
---> 36         raise ValueError('Please set the MONGO_PASSWORD environment variable or the hax.mongo_password option '
     37                          'to access the runs database.')
     38 

ValueError: Please set the MONGO_PASSWORD environment variable or the hax.mongo_password option to access the runs database.

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