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

exception/abort in Album thumbnail method, if thumbnail not available #401

Closed
fche opened this issue Sep 6, 2020 · 5 comments
Closed

exception/abort in Album thumbnail method, if thumbnail not available #401

fche opened this issue Sep 6, 2020 · 5 comments
Milestone

Comments

@fche
Copy link

fche commented Sep 6, 2020

On a new installation of sigal running over O(10**5) pictures, have encountered a situation where after the hours of processing, sigal aborts with an uncaught exception. I'm afraid I no longer have the exact report (sorry!), but it related to this part of gallery.py (the def thumbnail(self) method):

self._thumbnail = (url_quote(self.name) + '/' +

where the

             self._thumbnail = (url_quote(self.name) + '/' +                           
                   f.thumbnail)                                           

expression was being evaluated. Python complained about a str not being addable to a NoneType. It appears as though f.thumbnail was None. The exception was not caught at any higher point in the call stack so the whole sigal process aborted at this point, every time. Ouch.

Adding these two little lines immediately before the statement

    if not f.thumbnail:                                                       
        continue    

cured the problem here.

@saimn
Copy link
Owner

saimn commented Sep 6, 2020

To really understand the underlying issue it would be useful to have the traceback, debug logs and settings you use.

@fche
Copy link
Author

fche commented Sep 6, 2020

Yup, it's just that rerunning sigal on this dataset takes multiple hours. Will give it a try in a scratch output tree. BTW I didn't know there is a debug log -- the sigal build -d option isn't obviously documented e.g. in sigal --help.

@saimn
Copy link
Owner

saimn commented Sep 7, 2020

Yes, that's the way it works, sigal --help for the top level options, and then each subcommand has its own --help: http://sigal.saimon.org/en/latest/getting_started.html#help-on-the-sigal-build-command

@fche
Copy link
Author

fche commented Sep 8, 2020

With sigal build -d, I am unable to reproduce the problem because even minor problems result in exceptions, so the code stops before the original failure point.
With sigal build -v, I am now unable to reproduce the problem, perhaps because of changes to the source image directories between then and now (and no way to roll back to exactly that state).

I'm sorry I don't have enough information here. But as a philosophical matter, would it be good to have e.g. a systematic exception try/except wrapper around all logic that deals with input, so that the gallery generation will go on even if something is wrong with an item of media or an album?

@saimn saimn added this to the 2.2 milestone Oct 4, 2020
@saimn
Copy link
Owner

saimn commented Oct 4, 2020

I agree about avoiding crashes in normal mode, but catching blindly exceptions can also hide other problems so it would be easier if I could reproduce. Anyway, I added the try/except so it should be good now.

@saimn saimn closed this as completed Oct 4, 2020
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