Skip to content

Fix docker load progressbar, fixes #21957#21959

Merged
tiborvass merged 1 commit intomoby:masterfrom
coolljt0725:fix_21957
Apr 13, 2016
Merged

Fix docker load progressbar, fixes #21957#21959
tiborvass merged 1 commit intomoby:masterfrom
coolljt0725:fix_21957

Conversation

@coolljt0725
Copy link
Copy Markdown
Contributor

- What I did
fixes #21957

- How I did it

- How to verify it

- A picture of a cute animal (not mandatory but encouraged)

Signed-off-by: Lei Jitang [email protected]

@coolljt0725
Copy link
Copy Markdown
Contributor Author

@bboreham can you check if this can fix your issue? I tryed on local

docker load -i busybox.tar
28779c628bf0: Loading layer [==================================================>] 1.311 MB/1.311 MB
0292957ea1dd: Loading layer [==================================================>] 1.024 kB/1.024 kB
The image busybox:latest already exists, renaming the old one with ID sha256:47bcc53f74dc94b1920f0b34f6036096526296767650f223433fe65c35f149eb to empty string

Comment thread image/tarexport/load.go Outdated
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

format := progressOutput != nil ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bboreham yeah, this is better

@bboreham
Copy link
Copy Markdown
Contributor

I don't want to seem ungrateful, but are you sure that the correct course of action is to edit the one place where this one message is generated? Surely it needs a more general mechanism by which messages may be output in the appropriate context and fed through to the other end.

I'm not set up to build Docker right now so it will take me a while to be able to test it.

@coolljt0725
Copy link
Copy Markdown
Contributor Author

@bboreham You concern is reasonable, I have already checked, this is the only place where it will write message to outStream

@coolljt0725 coolljt0725 force-pushed the fix_21957 branch 2 times, most recently from b47eb0e to 4cc43fd Compare April 12, 2016 13:30
@coolljt0725
Copy link
Copy Markdown
Contributor Author

@bboreham I update the fix to address your concern -:)
I think this's better

@tiborvass
Copy link
Copy Markdown
Contributor

@coolljt0725 i wonder if we could add a test somehow (unit test?)

@coolljt0725
Copy link
Copy Markdown
Contributor Author

@tiborvass I'll try

@bboreham
Copy link
Copy Markdown
Contributor

I made an easier repro - #21957 (comment)

Building docker from your branch coolljt0725:fix_21957 works fine with matched client and daemon: strace shows it sending valid JSON:

HTTP/1.1 200 OK\r\nContent-Type: application/json\r\nServer: Docker/1.11.0-dev (linux)\r\nDate: Tue, 12 Apr 2016 14:11:55 GMT\r\nContent-Length: 171\r\n\r\n{\"stream\":\"The image busybox:xxx already exists, renaming the old one with ID ...

but when called from a 1.10.3 client I get:

$ /usr/bin/docker-1.10.3 load -i xxx
invalid character 'T' looking for beginning of value

strace shows:

HTTP/1.1 200 OK\r\nContent-Type: application/json\r\nServer: Docker/1.11.0-dev (linux)\r\nDate: Tue, 12 Apr 2016 14:17:05 GMT\r\nContent-Length: 155\r\n\r\nThe image busybox:xxx already exists, renaming the old one with ID sha256:d34ea343a882c1f8ad2692872d0a3db95cccd0d3fbdfeee015113871b4f171b9 to empty string\n

@GordonTheTurtle GordonTheTurtle added the dco/no Automatically set by a bot when one of the commits lacks proper signature label Apr 12, 2016
@GordonTheTurtle GordonTheTurtle removed the dco/no Automatically set by a bot when one of the commits lacks proper signature label Apr 12, 2016
@coolljt0725 coolljt0725 force-pushed the fix_21957 branch 2 times, most recently from 6a9abaa to bbd0816 Compare April 12, 2016 14:52
@coolljt0725
Copy link
Copy Markdown
Contributor Author

@bboreham really thank you for your testing :-)
the fix is updated, it should fix unmatch client and server
@tiborvass I added a intergration-cli

@bboreham
Copy link
Copy Markdown
Contributor

I tested 4cc43fdbcafbaab3c3ef98293fa3d70393805078 - doesn't look too different from the current.

@coolljt0725
Copy link
Copy Markdown
Contributor Author

@bboreham the commit you tested is old, I just updated the fix

@bboreham
Copy link
Copy Markdown
Contributor

OK, I tested bbd0816d674792501072b795fb8e8afde04192c4, and it cures the error message.

Daemon is still sending an empty payload on re-load as noted at #21957 (comment)

@tiborvass
Copy link
Copy Markdown
Contributor

LGTM

@coolljt0725
Copy link
Copy Markdown
Contributor Author

@tiborvass I made a update, make the the content-type as application/json only if user want the load progressbar, so this will not break old API calls. sorry, you have to review it again :)

@tiborvass
Copy link
Copy Markdown
Contributor

Re LGTM

@tonistiigi
Copy link
Copy Markdown
Member

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[1.11-rc5] docker daemon can send application/json type with invalid text payload

6 participants