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

Installing on shared space with virtualenv #140

Closed
apdame opened this issue Sep 21, 2018 · 6 comments
Closed

Installing on shared space with virtualenv #140

apdame opened this issue Sep 21, 2018 · 6 comments

Comments

@apdame
Copy link

apdame commented Sep 21, 2018

So I'm trying to install bookworm on a shared server space using a virtualenv, but I keep hitting a permissions error when I get to the dbbindings.py file ([Errno 13] Permission denied: ‘/var/www/cgi-bin/dbbindings.py’). This issue appears to have been discussed in #115, but I couldn't tell if the workaround had been implemented.

If it hasn't been, is there a good suggestion for how to manually reset the memory tables? That's basically all I need the install for, but in reading the code I wasn't able to parse the exact reset process.

@bmschmidt
Copy link
Member

Unfortunately, the fix from #115 is not implemented.

But: to reload the memory tables, you need the command line executable; but that is just a wrapper around a script bundled with the basic install.

I just pushed a commit to a new branch called 'commandline' that basically just allows you to access the command line interface without a fully installed module by replace bookworm reload_memory in commands with python bookwormDB/manager.py reload_memory (and so forth). It needs to be run from the base directory of the project, with the commandline git branch checked out.

Does that seem like it should work?

@apdame
Copy link
Author

apdame commented Sep 25, 2018

It should, though I think I might need to pre-define "client." Here's the traceback I get from trying to run the command:

Traceback (most recent call last):
File "manager.py", line 570, in
run_arguments()
File "manager.py", line 567, in run_arguments
getattr(my_bookworm,args.action)(args)
File "manager.py", line 325, in reload_memory
Bookworm = bookwormDB.CreateDatabase.BookwormSQLDatabase(database,variableFile=None)
File "/home/queerdig/virtualenv/BookwormDB/2.7/lib/python2.7/site-packages/bookwormDB/CreateDatabase.py", line 153, in init
self.dbname = config.get("client","database")
File "/opt/alt/python27/lib64/python2.7/ConfigParser.py", line 607, in get
raise NoSectionError(section)
ConfigParser.NoSectionError: No section: 'client'

@bmschmidt
Copy link
Member

OK. Yeah, it's trying to find a mysql configuration file with passwords for the db and not turning one up.

Probably the code should just be trying to log in without credentials--this may be worth changing later.
Maybe it would work with a --database argument to the reload command.

If not, try putting a file at either (or both) ~/.my.cnf OR bookworm.cnf in the directory you're working out of which has passwords in it: that should look something like this, although the values will be different.

[client]
database = federalist
password = password123
user = bschmidt

@apdame
Copy link
Author

apdame commented Oct 20, 2018

Unfortunately, it seems to not be finding either of the config files in the directory, and using the --database flag also raises the same error, unfortunately. I wonder if this approach is a dead end...

@bmschmidt
Copy link
Member

Hmm. This is tough to reproduce, and that time would be probably be better spent on the general issue.

If you just want to get memory tables reloaded on one installation, the barest way to do this is pull the code to update memory tables directly out of the database. When logged into your db in mysql, type:

SELECT memoryCode FROM masterTableTable;

That should yield a bunch of SQL code you can run there, or run SELECT memoryCode FROM masterTableTable INTO OUTFILE '/tmp/code.sql' instead and you'll get a file at /tmp/code.sql that you can run whenever desired.

@apdame
Copy link
Author

apdame commented Oct 22, 2018

Yeah, agreed. I may fiddle with it when I get time, but otherwise I'm going to go ahead and close this issue. Thanks for following up on this (seeming) fools' errand!

@apdame apdame closed this as completed Oct 22, 2018
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

2 participants