Conversation
…communicating with the index/registry
|
I understand this is useful, but still, even in debug, I'm not found of displaying HTML in the debug output. Try: |
|
I think this is an issue from the index. /cc @kencochrane |
registry/registry.go
Outdated
There was a problem hiding this comment.
This should be a debug message. If the index sends erroneous HTML content (which it does currently for non-existent images), you don't want that in the daemon logs unless you're in debug mode.
|
Just to give some background for this PR, we discussed this feature with Joffrey before. The idea is to make push/pull errors useful for easy debugging. Right now copy/pasting errors are useless and does not bring any info to debug (usually you have to relaunch the deamon in debug, retry and still not have enough data...). I did not test the PR yet... |
|
Basically when you pull a non-existent image, the body of the 404 is a very large html error page. @samalba @kencochrane I see the reason for the feature, but I think it will be really weird to display tons of html output. Maybe only print the body only if content-type is application/json? Otherwise maybe we could add a "debug" feature on the index where logged in users could retrieve their failed queries - it's more work but could be a really awesome way to give support. On Mon, Nov 11, 2013 at 8:15 PM, Sam Alba [email protected]
|
|
I think we should not print html anyway. But we need the raw content for 1- print 1024 chars only for the body (then html will be stripped) 2- read the first chars, if we detect html, we don't print it. We print any 3- both On Tuesday, November 12, 2013, Solomon Hykes wrote:
@sam_alba |
|
@shin- could you re-open this with a check to only print error body when 1) content-type is application/json and 2) DEBUG is enabled? Thanks! In the meantime I'm closing this for bookkeeping. |
|
I'd print this even if debug is disabled. It's a PITA to always reply "please retry in debug". It makes the output not useful for understanding a problem. However I agree for the content-type. |
|
LGTM |
|
@shin- You can use |
There was a problem hiding this comment.
You should not read the entire request into memory if you are only going to write 1024 bytes. You could crash the daemon by sending a large payload. If you only want 1024 bytes, only read 1024 bytes.
There was a problem hiding this comment.
Also be sure to close the response Body to avoid leaks
|
@shin- could you update this to match @crosbymichael requirements ? |
|
Closing this for now to help with bookkeeping, feel free to reopen when changes are made. |
This will help us report server faults more accurately when communicating with the index/registry.
/cc @samalba