haiwen / seafile

High performance file syncing and sharing, with also Markdown WYSIWYG editing, Wiki, file label and other knowledge management features.
http://seafile.com/
Other
12.25k stars 1.54k forks source link

ccnet/mysql: underscore in database hostname raises sql exception #1403

Closed basti1253 closed 8 years ago

basti1253 commented 8 years ago

Somewhat related to #336

I'm about automating the process of setting up seafile into a docker container. Here's the setup: https://github.com/shoifele/seafile

If I change the db hostname from "db" to "seafile_db_1" (both valid if repo is checked out to a directory called seafile) ccnet breaks.

failed to run "ccnet-server -t" SQLException: Failed to start connection pool -- no database specified in URL raised in ConnectionPool_start at src/db/ConnectionPool.c:287

best regards

basti1253 commented 8 years ago

In case you have docker installed it's very easy to reproduce the error:

lins05 commented 8 years ago

Seems underscore is illegal in hostnames, as someone pointed out in http://stackoverflow.com/a/2183140/1467959 . And it's exactly how libzdb, the database library used by ccnet/seafile, parses the hostname.

https://github.com/haiwen/libzdb/blob/a3e0dfaf4fb5bbc717e87a107d15fb67a433bcf2/src/net/URL.re#L109

On Wed, Oct 14, 2015 at 12:03 AM, Sebastian Sauer notifications@github.com wrote:

In case you have docker installed it's very easy to reproduce the error:

— Reply to this email directly or view it on GitHub https://github.com/haiwen/seafile/issues/1403#issuecomment-147760501.

basti1253 commented 8 years ago

mea culpa. thanks for your fast response