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

Handling of Broken Scan Photos Jobs #42

Open
lsnow99 opened this issue Oct 25, 2018 · 2 comments
Open

Handling of Broken Scan Photos Jobs #42

lsnow99 opened this issue Oct 25, 2018 · 2 comments

Comments

@lsnow99
Copy link

lsnow99 commented Oct 25, 2018

Hey, I'm really enjoying playing with OwnPhotos, but I ran into an issue that I can't figure out how to fix without digging into the database. Essentially, I accidentally added a photo with a non ascii character (∞) and ran scan photos. The scan photos job failed with the below error, but OwnPhotos still thinks that the job is running. I stopped the docker container and deleted the file, and restarted it. The web UI still thinks that scan photos is running, but this is not reflected in the logs.

I was able to fix the issue by removing the most recent entry in the api_longrunningjob table of my postgres database. I used the following command:

DELETE FROM api_longrunningjob WHERE id in (SELECT id from api_longrunningjob ORDER BY id desc LIMIT 1);

00:11:01 UnicodeEncodeError: 'utf-8' codec can't encode character '\udce2' in position 49: surrogates not allowed Traceback (most recent call last): File "/venv/lib/python3.5/site-packages/rq/worker.py", line 793, in perform_job rv = job.perform() File "/venv/lib/python3.5/site-packages/rq/job.py", line 599, in perform self._result = self._execute() File "/venv/lib/python3.5/site-packages/rq/job.py", line 605, in _execute return self.func(*self.args, **self.kwargs) File "/code/api/directory_watcher.py", line 100, in scan_photos if not Photo.objects.filter(image_path=image_path).exists(): File "/venv/lib/python3.5/site-packages/django/db/models/query.py", line 715, in exists return self.query.has_results(using=self.db) File "/venv/lib/python3.5/site-packages/django/db/models/sql/query.py", line 509, in has_results return compiler.has_results() File "/venv/lib/python3.5/site-packages/django/db/models/sql/compiler.py", line 1036, in has_results return bool(self.execute_sql(SINGLE)) File "/venv/lib/python3.5/site-packages/django/db/models/sql/compiler.py", line 1067, in execute_sql cursor.execute(sql, params) File "/venv/lib/python3.5/site-packages/django/db/backends/utils.py", line 100, in execute return super().execute(sql, params) File "/venv/lib/python3.5/site-packages/django/db/backends/utils.py", line 68, in execute return self._execute_with_wrappers(sql, params, many=False, executor=self._execute) File "/venv/lib/python3.5/site-packages/django/db/backends/utils.py", line 77, in _execute_with_wrappers return executor(sql, params, many, context) File "/venv/lib/python3.5/site-packages/django/db/backends/utils.py", line 85, in _execute return self.cursor.execute(sql, params)

Thank you for your work on this project!

@guysoft
Copy link
Collaborator

guysoft commented Dec 16, 2018

Looks like you had non-unicode characters.
This is the line in the code that does this:
https://github.com/hooram/ownphotos/blob/dev/api/directory_watcher.py#L62

Did it happen again?

@guysoft
Copy link
Collaborator

guysoft commented Dec 25, 2018

Closing if no reply - would also appreciate a reproduction so I can fix this.

hooram pushed a commit that referenced this issue Feb 26, 2019
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