Bookworm-project / BookwormDB

Tools for text tokenization and encoding
MIT License
84 stars 12 forks source link

Section Header Error on Initalization #119

Closed apdame closed 7 years ago

apdame commented 7 years ago

So I keep hitting this issue upon attempting 'bookworm init' (with and without sudo), and I'm not exactly clear on what's up (it also now appears when running the setup test as well). If it helps, I'm running a local Ubuntu 16.04 VM. Trace is below:

Traceback (most recent call last): File "/usr/local/bin/bookworm", line 9, in load_entry_point('bookwormDB==0.4.0', 'console_scripts', 'bookworm')() File "/usr/local/lib/python2.7/dist-packages/bookwormDB/manager.py", line 567, in run_arguments getattr(my_bookworm,args.action)(args) File "/usr/local/lib/python2.7/dist-packages/bookwormDB/manager.py", line 163, in init self.configuration(args.yes) File "/usr/local/lib/python2.7/dist-packages/bookwormDB/manager.py", line 330, in configuration bookwormDB.configuration.create(ask_about_defaults=askk) File "/usr/local/lib/python2.7/dist-packages/bookwormDB/configuration.py", line 39, in create systemConfigFile.read(["/.my.cnf",os.path.expanduser("~/my.cnf"),os.path.expanduser("~/.my.cnf"),"/etc/mysql/my.cnf","/etc/my.cnf","/root/.my.cnf","bookworm.cnf"]) File "/usr/lib/python2.7/ConfigParser.py", line 305, in read self._read(fp, filename) File "/usr/lib/python2.7/ConfigParser.py", line 512, in _read raise MissingSectionHeaderError(fpname, lineno, line) ConfigParser.MissingSectionHeaderError: File contains no section headers. file: /etc/mysql/my.cnf, line: 20 '!includedir /etc/mysql/conf.d/\n'

bmschmidt commented 7 years ago

Thanks for the report. ConfigParser has very strict ideas about what a configuration file should look like, and apparently the new Ubuntu is shipping with something that doesn't match it, in a default place.

I've just pushed a commit that should fix this. https://github.com/Bookworm-project/BookwormDB/commit/8b36af453722689f6d2c8010dcd00d5ee5478b46. Please reopen the issue if it persists.

apdame commented 7 years ago

Did a new clean install of bookworm/mysql and have encountered a new ConfigParser issue. See traceback below:

Traceback (most recent call last): File "/home/adame/.local/bin/bookworm", line 9, in load_entry_point('bookwormDB==0.4.0', 'console_scripts', 'bookworm')() File "/home/adame/.local/lib/python2.7/site-packages/bookwormDB/manager.py", line 567, in run_arguments getattr(my_bookworm,args.action)(args) File "/home/adame/.local/lib/python2.7/site-packages/bookwormDB/manager.py", line 163, in init self.configuration(args.yes) File "/home/adame/.local/lib/python2.7/site-packages/bookwormDB/manager.py", line 330, in configuration bookwormDB.configuration.create(ask_about_defaults=askk) File "/home/adame/.local/lib/python2.7/site-packages/bookwormDB/configuration.py", line 61, in create print systemConfigFile.get("mysql",field) File "/usr/lib/python2.7/ConfigParser.py", line 607, in get raise NoSectionError(section) ConfigParser.NoSectionError: No section: 'mysql'

apdame commented 7 years ago

Update: I'm also getting this identical error when attempting "bookworm init" on OS X Mavericks (again, fresh install); I wondered it if might be a VM issue, but this seems to prove me wrong. So I'm 100% stumped.

apdame commented 7 years ago

Also, edited my.cnf to ensure "client" and "mysql" fields are present to be read and still getting the same error.

apdame commented 7 years ago

Meant to get this closed - solved this error awhile ago with the help of @edsu.

bookworm init was still getting hung up on the "!includedir /etc/mysql/conf.d/" and "!includedir /etc/mysql/mysql.conf.d/" in standard my.cnf, even post-commit. I ended up solving the problem by creating a dummy my.cnf at another location (etc/bookworm/) and pointing the configuration.py to look at that file.