Page MenuHomePhabricator

byte/str mismatch TypeError when converting any STL file
Closed, ResolvedPublic

Description

Another bytes/string mismatch:

2022-11-24 14:46:21,626 ???? thumbor:DEBUG [PoolCounter] Got data of 'b'LOCKED\n'' from poolcounter during ACQ4ME
2022-11-24 14:46:21,626 ???? thumbor:DEBUG [ImagesHandler] Setting up PoolCounter cleanup callback
2022-11-24 14:46:21,632 ???? thumbor:DEBUG [SWIFT_STORAGE] get: 'wikipedia-commons-local-thumb.db' 'd/db/Schach_Bauer_20221117_002.stl/230px-Schach_Bauer_20221117_002.stl.jpg'
2022-11-24 14:46:21,745 ???? urllib3.connectionpool:DEBUG https://swift.discovery.wmnet:443 "GET /v1/AUTH_mw/wikipedia-commons-local-thumb.db/d/db/Schach_Bauer_20221117_002.stl/230px-Schach_Bauer_20221117_002.stl.jpg HTTP/1.1" 404 70
2022-11-24 14:46:21,746 ???? swiftclient:INFO REQ: curl -i https://swift.discovery.wmnet/v1/AUTH_mw/wikipedia-commons-local-thumb.db/d/db/Schach_Bauer_20221117_002.stl/230px-Schach_Bauer_20221117_002.stl.jpg -X GET -H "X-Auth-Token: BLAHBLAH..."
2022-11-24 14:46:21,746 ???? swiftclient:INFO RESP STATUS: 404 Not Found

2022-11-24 14:46:21,747 ???? swiftclient:INFO RESP BODY: b'<html><h1>Not Found</h1><p>The resource could not be found.</p></html>'
2022-11-24 14:46:21,763 ???? thumbor:DEBUG [SWIFT_STORAGE] missing
2022-11-24 14:46:21,773 ???? thumbor:DEBUG [SWIFT_LOADER] load: https%3A//swift.discovery.wmnet/v1/AUTH_mw/wikipedia-commons-local-public.db/d/db/Schach_Bauer_20221117_002.stl
2022-11-24 14:46:21,780 ???? thumbor:DEBUG [SWIFT_LOADER] fetching d/db/Schach_Bauer_20221117_002.stl from container wikipedia-commons-local-public.db
2022-11-24 14:46:21,781 ???? urllib3.connectionpool:DEBUG Resetting dropped connection: swift.discovery.wmnet
2022-11-24 14:46:21,848 ???? urllib3.connectionpool:DEBUG https://swift.discovery.wmnet:443 "GET /v1/AUTH_mw/wikipedia-commons-local-public.db/d/db/Schach_Bauer_20221117_002.stl HTTP/1.1" 200 54825284
2022-11-24 14:46:22,593 ???? swiftclient:DEBUG REQ: curl -i https://swift.discovery.wmnet/v1/AUTH_mw/wikipedia-commons-local-public.db/d/db/Schach_Bauer_20221117_002.stl -X GET -H "X-Auth-Token: BLAHBLAH..."
2022-11-24 14:46:22,593 ???? swiftclient:DEBUG RESP STATUS: 200 OK
2022-11-24 14:46:22,600 ???? thumbor:DEBUG [SWIFT_LOADER] writing 54825284 bytes to temp file
2022-11-24 14:46:22,653 ???? thumbor:ERROR TypeError: can only concatenate str (not "bytes") to str

2022-11-24 14:46:22,653 ???? thumbor:ERROR ERROR: Traceback (most recent call last):
  File "/opt/lib/python/site-packages/thumbor/handlers/__init__.py", line 212, in get_image
    result = await self._fetch(self.context.request.image_url)
  File "/opt/lib/python/site-packages/thumbor/handlers/__init__.py", line 806, in _fetch
    self.context, url
  File "/srv/service/wikimedia_thumbor/loader/proxy/__init__.py", line 54, in load
    return await mod.load(context, url)
  File "/srv/service/wikimedia_thumbor/loader/swift/__init__.py", line 133, in load
    body = 'solid' + body[5:]
TypeError: can only concatenate str (not "bytes") to str

2022-11-24 14:46:22,653 ???? thumbor:ERROR [BaseHandler] get_image failed for url `https%3A//swift.discovery.wmnet/v1/AUTH_mw/wikipedia-commons-local-public.db/d/db/Schach_Bauer_20221117_002.stl`. error: `can only concatenate str (not "bytes") to str`
2022-11-24 14:46:22,654 ???? tornado.access:ERROR 500 GET /wikipedia/commons/thumb/d/db/Schach_Bauer_20221117_002.stl/230px-Schach_Bauer_20221117_002.stl.jpg (10.64.16.55) 1374.60ms
2022-11-24 14:46:22,659 ???? thumbor:DEBUG [PoolCounter] Disconnecting

Event Timeline

Change 860632 had a related patch set uploaded (by Hnowlan; author: Hnowlan):

[operations/software/thumbor-plugins@master] Fix TypeError when prepending string to STL files

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

Change 860632 merged by jenkins-bot:

[operations/software/thumbor-plugins@master] Fix TypeError when prepending string to STL files

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

Change 861367 had a related patch set uploaded (by Hnowlan; author: Hnowlan):

[operations/deployment-charts@master] thumbor: new release

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

Change 861367 merged by jenkins-bot:

[operations/deployment-charts@master] thumbor: new release

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

Change 861383 had a related patch set uploaded (by Hnowlan; author: Hnowlan):

[operations/deployment-charts@master] thumbor: Correct paths for 3d2png and tinyrgb

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

Change 861383 merged by jenkins-bot:

[operations/deployment-charts@master] thumbor: Correct paths for 3d2png and tinyrgb

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