lycheesync icon indicating copy to clipboard operation
lycheesync copied to clipboard

INFO album list in db: {}

Open vanhoopstallion opened this issue 9 years ago • 10 comments

Hello - I'm having some issues. Can you hel?

I want to link to my owncloud photos directtoy and create linked albums in lychee. Below is the error when I run with args - vdl

I'm so close to getting my setup how I want it!

Program Launched with args:

  • dropDB:True
  • replace:False
  • verbose:True
  • srcdir:/var/www/owncloud/data/user/files/Photos/
  • lycheepath:/var/www/html/Lychee
  • conf:/var/www/html/Lychee/plugins/lycheesync/conf.json
  • sort_by_name:True
  • link:True Program Launched with conf:
  • dbHost:localhost
  • db:lychee
  • dbUser:user
  • dbPassword:password
  • thumbQuality:80
  • publicAlbum:0 Other conf elements:
  • user:www-data
  • group:www-data
  • uid:33
  • gid:33
INFO album list in db: {}
Traceback (most recent call last):
  File "main.py", line 132, in <module>
    main(conf_data)
  File "main.py", line 19, in main
    s.sync()
  File "/var/www/html/Lychee/plugins/lycheesync/lycheesyncer.py", line 334, in sync
    album['id'] = self.createAlbum(album)
  File "/var/www/html/Lychee/plugins/lycheesync/lycheesyncer.py", line 76, in createAlbum
    album['id'] = self.dao.createAlbum(album)
  File "/var/www/html/Lychee/plugins/lycheesync/lycheedao.py", line 206, in createAlbum
    "'" + str(self.conf["publicAlbum"]) + "',"
  File "/var/www/html/Lychee/plugins/lycheesync/lycheedao.py", line 42, in _p
    return MySQLdb.escape_string(str(data))
TypeError: must be impossible<bad format char>, not str

vanhoopstallion avatar Nov 05 '15 10:11 vanhoopstallion

Hello,

Thanks for asking help. I think the problem is with your configuration file. The entry publicAlbum seems buggy , look at the output you send me:

thumbQuality:80 publicAlbum:0 Other conf elements: user:www-data

There should have a carriage return after publicAlbum: 0 I suspect a bad invisible character in your conf file. delete the corresponding line and retype it. Or maybe a lack of carriage return somewhere in your conffile...

If these elements don't help you, send me your confile, otherwise let me know if it's ok.

Regards,

Gustave Le 5 nov. 2015 11:23, "vanhoopstallion" [email protected] a écrit :

Hello - I'm having some issues. Can you hel?

I want to link to my owncloud photos directtoy and create linked albums in lychee. Below is the error when I run with args - vdl

I'm so close to getting my setup how I want it!

Program Launched with args:

  • dropDB:True
  • replace:False
  • verbose:True
  • srcdir:/var/www/owncloud/data/user/files/Photos/
  • lycheepath:/var/www/html/Lychee
  • conf:/var/www/html/Lychee/plugins/lycheesync/conf.json
  • sort_by_name:True
  • link:True Program Launched with conf:
  • dbHost:localhost
  • db:lychee
  • dbUser:user
  • dbPassword:password
  • thumbQuality:80
  • publicAlbum:0 Other conf elements:
  • user:www-data
  • group:www-data
  • uid:33
  • gid:33

INFO album list in db: {} Traceback (most recent call last): File "main.py", line 132, in main(conf_data) File "main.py", line 19, in main s.sync() File "/var/www/html/Lychee/plugins/lycheesync/lycheesyncer.py", line 334, in sync album['id'] = self.createAlbum(album) File "/var/www/html/Lychee/plugins/lycheesync/lycheesyncer.py", line 76, in createAlbum album['id'] = self.dao.createAlbum(album) File "/var/www/html/Lychee/plugins/lycheesync/lycheedao.py", line 206, in createAlbum "'" + str(self.conf["publicAlbum"]) + "'," File "/var/www/html/Lychee/plugins/lycheesync/lycheedao.py", line 42, in _p return MySQLdb.escape_string(str(data)) TypeError: must be impossible, not str

— Reply to this email directly or view it on GitHub https://github.com/GustavePate/lycheesync/issues/36.

GustavePate avatar Nov 05 '15 21:11 GustavePate

Hello Gustave,

Thanks for looking at my issue. I've made the changes you suggested, but still no changes

here is my conf file if you could take a look for me? { "db":"lychee", "dbUser":"user", "dbPassword":"password", "dbHost":"localhost", "thumbQuality":80, "publicAlbum": 0 }

Error output

INFO album list in db: {} Traceback (most recent call last): File "main.py", line 132, in main(conf_data) File "main.py", line 19, in main s.sync() File "/var/www/html/lychee/plugins/lycheesync/lycheesyncer.py", line 334, in sync album['id'] = self.createAlbum(album) File "/var/www/html/lychee/plugins/lycheesync/lycheesyncer.py", line 76, in createAlbum album['id'] = self.dao.createAlbum(album) File "/var/www/html/lychee/plugins/lycheesync/lycheedao.py", line 206, in createAlbum "'" + str(self.conf["publicAlbum"]) + "'," File "/var/www/html/lychee/plugins/lycheesync/lycheedao.py", line 42, in _p return MySQLdb.escape_string(str(data)) TypeError: must be impossible, not str

vanhoopstallion avatar Nov 06 '15 08:11 vanhoopstallion

Hi vanhoopstallion,

I was out for a week. Is your problem solved ?

If not, I will need your actual conf file as an attachment to look for an invalid char. By the way what version of python do you use ?

GustavePate avatar Nov 15 '15 18:11 GustavePate

Hello Gustave,

No problem! I'm still stuck, experiencing the same errors. I've attached my conf.json file changed to .txt

  • The login details are changed :-)

conf.txt

Hope you can help!

cheers

vanhoopstallion avatar Nov 17 '15 08:11 vanhoopstallion

Hi vanhoopstallion,

This file looks legit to me. Sorry I really thought it was the problem. What version of python do you use ?

Too find your "bad" string we have to print it out.

In lycheedao.py arround line 42 replace:

    def _p(self, data):
        """
        protect / escape strings
        """
        return MySQLdb.escape_string(str(data))

with

    def _p(self, data):
        """
        protect / escape strings
        """
        print "escape: " + str(data)
        return MySQLdb.escape_string(str(data))

Run your script and we will see what string causes the problem.

GustavePate avatar Nov 20 '15 20:11 GustavePate

hi Gustav,

Thanks for the info. my python version is 2.7.10

I've replaced the code provided in lycheedao.py and run the command again

python main.py -vld /var/www/owncloud/data/user/files/Photos /var/www/html/lychee /var/www/html/lychee/plugins/lycheesync/conf.json

This is the output:

INFO album list in db: {} escape: wedding 2015 Traceback (most recent call last): File "main.py", line 132, in main(conf_data) File "main.py", line 19, in main s.sync() File "/var/www/html/lychee/plugins/lycheesync/lycheesyncer.py", line 334, in sync album['id'] = self.createAlbum(album) File "/var/www/html/lychee/plugins/lycheesync/lycheesyncer.py", line 76, in createAlbum album['id'] = self.dao.createAlbum(album) File "/var/www/html/lychee/plugins/lycheesync/lycheedao.py", line 207, in createAlbum "'" + str(self.conf["publicAlbum"]) + "'," File "/var/www/html/lychee/plugins/lycheesync/lycheedao.py", line 43, in _p return MySQLdb.escape_string(str(data)) TypeError: must be impossible, not str

vanhoopstallion avatar Nov 23 '15 08:11 vanhoopstallion

Looks ok.

It may be a python mysqlclient bug:

https://github.com/PyMySQL/mysqlclient-python/issues/23

I think you installed mysqlclient:

sudo pip install mysqlclient

Instead of MySQLDb

sudo pip install MySQL-python

The two mysql driver are compatible and you may have ended with the wrong one.

Try to know what dependency you installed (what OS are you on?) delete it and then:

sudo pip install MySQL-python

It should work...

If you installed your libs with pip, you could also force an update of your mysql client to see if it solve the issue with:

sudo pip install MySQL-python --upgrade

or

sudo pip install mysqlclient --upgrade

Tell me if it works...

GustavePate avatar Nov 23 '15 21:11 GustavePate

Hi vanhoopstallion !

Is it getting better ?

GustavePate avatar Nov 29 '15 11:11 GustavePate

Hi,

I think I've messed something up! I screwed up my MySQL some way applying the updates. I've reset my system to reinstall owncloud and lychee - will come back once I'm running again!

cheers

vanhoopstallion avatar Dec 02 '15 14:12 vanhoopstallion

Hi vanhoopstallion,

Before closing this issue for "no news in the last 2 month", I wonder if you managed to fixed your problem or if you need help?

GustavePate avatar Feb 11 '16 20:02 GustavePate