Page MenuHomePhabricator

cwebp chokes on YCCK JPGs
Closed, ResolvedPublic

Description

I tried uploading the same file to beta and it's spinning for a long time before failing with a 504.

Trying to run a cwebp command on thumbor2001 I'm getting an instantaneous error:

gilles@thumbor2001:~$ cwebp 113px-Constitution_of_India.jpg -metadata all -q 50 -quiet -o -
Unsupported color conversion request
Error! Could not process file 113px-Constitution_of_India.jpg
Error! Cannot read input picture file '113px-Constitution_of_India.jpg'

I don't see, however, what might be causing the hanging.

Event Timeline

It seems like cwebp doesn't like the YCCK color space that file uses:

Color Transform                 : YCCK

One workaround might be to convert the file to sRGB first before invoking cwebp

Gilles renamed this task from Constitution_of_India.jpg webp variant stuck in poolcounter per-original throttle to cwebp chokes on YCCK JPGs.Jun 27 2019, 11:53 AM

Alternatively, we could just stick to the JPG we've already generated when a webp is requested and the cwebp command fails. It will probably make for simpler code and foolproof for other unforeseen situations where cwebp fails. What's unclear still is why things are hanging in case of cwebp command error.

Change 519379 had a related patch set uploaded (by Gilles; owner: Gilles):
[operations/software/thumbor-plugins@master] Serve JPG when WEBP conversion fails

https://gerrit.wikimedia.org/r/519379

Change 519379 merged by Gilles:
[operations/software/thumbor-plugins@master] Serve JPG when WEBP conversion fails

https://gerrit.wikimedia.org/r/519379

Change 519755 had a related patch set uploaded (by Gilles; owner: Gilles):
[operations/software/thumbor-plugins@master] Version bump

https://gerrit.wikimedia.org/r/519755

Change 519755 merged by Gilles:
[operations/software/thumbor-plugins@master] Version bump

https://gerrit.wikimedia.org/r/519755

Krinkle added a subscriber: Krinkle.

To ask Filippo whether it has been deployed and if not, whether they can do that for us.

This needs a thumbor-plugins Debian package update with the latest code + deployment.

Krinkle added a subscriber: jijiki.

Yeah, forgot about that. Before I realised that, I asked Filippo on Monday and he said it (indeed..) hadn't been deployed yet. Reminder to self: Should have asked @jijiki instead, who does SRE for Thumbor now.

@jijiki what's the status of this? Can we deploy it this week if it hasn't been deployed yet?

Change 531204 had a related patch set uploaded (by Gilles; owner: Gilles):
[operations/debs/python-thumbor-wikimedia@master] Upgrade to 2.6

https://gerrit.wikimedia.org/r/531204

@jijiki do you have some spare time in the next couple of weeks to deploy this?

Change 531204 merged by Effie Mouzeli:
[operations/debs/python-thumbor-wikimedia@master] Upgrade to 2.6

https://gerrit.wikimedia.org/r/531204

@jijiki as far as I can tell, this was never roll-deployed?

gilles@thumbor2001:~$ dpkg -l python-thumbor-wikimedia
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name                               Version                Architecture           Description
+++-==================================-======================-======================-=========================================================================
ii  python-thumbor-wikimedia           2.4-1+deb9u1           all                    Thumbor wikimedia extensions
Gilles lowered the priority of this task from High to Medium.Jan 6 2020, 1:15 PM
Gilles lowered the priority of this task from Medium to Low.

@jijiki can we schedule a day and time to deploy this update?

Gilles changed the task status from Open to Stalled.May 4 2020, 11:46 AM

Blocked on deployment by SRE

ema changed the task status from Stalled to Open.May 12 2020, 10:24 AM

Mentioned in SAL (#wikimedia-operations) [2020-05-12T10:30:07Z] <ema> rolling thumbor upgrade to 2.6-1+deb10u1 T226707

If I understand the issue correctly, it looks fixed to me now. The following is now returned as CT:image/jpeg:

10:45:56 ema@cp1076.eqiad.wmnet:~
$ curl -i https://swift.discovery.wmnet/wikipedia/commons/thumb/4/4d/Constitution_of_India.jpg/120px-Constitution_of_India.jpg.webp 
HTTP/2 200 
date: Tue, 12 May 2020 10:46:05 GMT
content-type: image/jpeg
content-length: 29753
accept-ranges: bytes
last-modified: Tue, 12 May 2020 10:45:22 GMT
etag: 25728b156d2589b461b4503dbf98cc79
x-timestamp: 1589280321.64762
access-control-allow-origin: *
x-trans-id: tx7a013b5bb1994bf5baded-005eba7e6d

YCCK images requested as webp now fall back correctly to jpeg