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

Install step pipenv run python bootstrap_mycroft_db.py results in file not found error #201

Open
cmdrogogov opened this issue Dec 10, 2019 · 8 comments

Comments

@cmdrogogov
Copy link

Hardware;
Unimportant, running a VM within ESXI 6.7 for reference.

Current git clone of the repository as set out in the instructions

OS - Fedora x64 v 31, most recent updates as of 30m prior to writing.

At this step in the instructions;

Run the bootstrap script
cd /opt/selene/selene-backend/db/scripts
pipenv run python bootstrap_mycroft_db.py

The expected output is for the install to continue, however this pops up instead;

Destroying any objects we will be creating later.

Creating the mycroft database

Creating the extensions

Creating user-defined data types

Create the schemas and grant access

Creating the account schema tables

Creating the skill schema tables

Creating the geography schema tables

Creating the device schema tables

Creating the metrics schema tables

Granting access to schemas and tables

Copying template to new database.

Building account.agreement table

Traceback (most recent call last):

  File "bootstrap_mycroft_db.py", line 272, in <module>

    with open(doc_path) as doc:

FileNotFoundError: [Errno 2] No such file or directory: /opt/selene/documentation/_pages/embed-privacy-policy.md

I suspect this is because some files are missing but

  1. it's looking in the wrong directory, the git repo is cloned into /selene-backend
  2. no documentation files are downloaded (that I am able to locate)
@thorstenMueller
Copy link

I encounter the same issue and have no idea where these documentation files should come from. The script might use the environment var MYCROFT_DOC_DIR, but it's also not defined.

@Multigestern
Copy link

Same here.
Anyone found a solution, or workaround yet?

@krisgesling
Copy link
Contributor

I was chatting with Thorsten about this today. They found that commenting out lines 266 and 267 where these pages are defined was sufficient to avoid the error and move forward.

Alternatively you could create the two expected files or point them to your own custom policies:

  • /opt/selene/documentation/_pages/embed-privacy-policy.md
  • /opt/selene/documentation/_pages/embed-terms-of-use.md

@Multigestern
Copy link

Thank you.
Actually i was about to post exactly this workaround.
But i also had to comment the lines 273 to 279. The while loop isn't working unless you have "---\n" in your mds.

@chrisveilleux
Copy link
Member

Thanks for posting the workaround, @krisgesling. I will make a change that makes these files optional, but that will have to be prioritized.

@andresh0816
Copy link

andresh0816 commented Mar 9, 2020

Hi @chrisveilleux, you can simply add those files for what, the user can add the terms and policy.

@andresh0816
Copy link

It's normal than this take many minutes?

andres@Napoleon:/opt/api/backend/db/scripts$ sudo pipenv run python bootstrap_mycroft_db.py
[sudo] contraseña para andres:         
Destroying any objects we will be creating later.
Creating the mycroft database
Creating the extensions
Creating user-defined data types
Create the schemas and grant access
Creating the account schema tables
Creating the skill schema tables
Creating the geography schema tables
Creating the device schema tables
Creating the metrics schema tables
Granting access to schemas and tables
Copying template to new database.
Building account.agreement table

"Building account.agreement table" take many minutes. It's normal?

@ttpcodes
Copy link

If the script is stuck at Building account.agreement table, it's likely that the script is getting hung up on parsing either embed-privacy-policy.md or embed-terms-of-use.md. Those files need to contain the line ---\n (where \n is a newline character) twice in order to break out of the while loop responsible for parsing these files.

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

7 participants