Merge lp://staging/~caio1982/ubuntu-system-image/sis-skip404 into lp://staging/ubuntu-system-image/server

Proposed by Caio Begotti
Status: Work in progress
Proposed branch: lp://staging/~caio1982/ubuntu-system-image/sis-skip404
Merge into: lp://staging/ubuntu-system-image/server
Prerequisite: lp://staging/~caio1982/ubuntu-system-image/sis-logging
Diff against target: 172 lines (+57/-61)
1 file modified
lib/systemimage/generators.py (+57/-61)
To merge this branch: bzr merge lp://staging/~caio1982/ubuntu-system-image/sis-skip404
Reviewer Review Type Date Requested Status
Stéphane Graber (community) Needs Fixing
Review via email: mp+252580@code.staging.launchpad.net

This proposal supersedes a proposal from 2015-03-11.

Description of the change

Image server goes crazy if the configured image is not there at the time of importing. What happens is that it fetches an Apache error page (HTML) and try to import it, which surprisingly works. Then when the image is finally there it tries to generate a delta, and that obviously fails because one of the files (the source one) is not an image.

The only way to recover from this state is to manually intervene and remove the first processed files, json, images etc. This is very problematic for us in PES.

Although this MR is kind of hackish it does the job for running image server on Prodstack. I understand a more robust solution would be needed to handle corner cases (perhaps using Requests instead of urllib, to start with).

To post a comment you must log in.
Revision history for this message
Stéphane Graber (stgraber) :
Revision history for this message
Stéphane Graber (stgraber) :
review: Needs Fixing
262. By Caio Begotti

catch all http errors above 400 instead and make the logging message more generic to reflect it

263. By Caio Begotti

transform all calls to urlopen and urlretrieve in wrapper calls so we catch all timeouts and >= 400 http errors better

264. By Caio Begotti

fix flake errors due to leftovers from previous commit

Revision history for this message
Caio Begotti (caio1982) wrote :

Stephane, can you tell me if this is more or less how you imaged it to be like? If it is I'll get to work on the tests as they are failing now because of these changes. If it's not what you asked for then I think I'll just stick to my hack in a private branch as I believe it would be more benefit to have more time to convert it all to use Requests.

265. By Caio Begotti

add more debug logging to the methods we are wrapping around

Revision history for this message
Stéphane Graber (stgraber) wrote :

This change causes clear behavioral changes on error, please fix.

review: Needs Fixing
Revision history for this message
Stéphane Graber (stgraber) wrote :

> Stephane, can you tell me if this is more or less how you imaged it to be
> like? If it is I'll get to work on the tests as they are failing now because
> of these changes. If it's not what you asked for then I think I'll just stick
> to my hack in a private branch as I believe it would be more benefit to have
> more time to convert it all to use Requests.

This is basically what I imagined except for the part where you no longer return None, which will cause a crash.

Unmerged revisions

265. By Caio Begotti

add more debug logging to the methods we are wrapping around

264. By Caio Begotti

fix flake errors due to leftovers from previous commit

263. By Caio Begotti

transform all calls to urlopen and urlretrieve in wrapper calls so we catch all timeouts and >= 400 http errors better

262. By Caio Begotti

catch all http errors above 400 instead and make the logging message more generic to reflect it

261. By Caio Begotti

make s-i-s a bit smarted by returning none if the actual file was not found, otherwise it will process a dummy html page with a 404 error message inside it... this is more like a hack because using urllib these days seems already wrong and i dont have the time to fully fix how all files are urlopened or urlretrieved in its code

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches

to all changes: