Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to upload QR code - M_UNKNOWN (HTTP 500) #110

Closed
jakobkilian opened this issue Jul 19, 2023 · 8 comments
Closed

Failed to upload QR code - M_UNKNOWN (HTTP 500) #110

jakobkilian opened this issue Jul 19, 2023 · 8 comments

Comments

@jakobkilian
Copy link

jakobkilian commented Jul 19, 2023

Describe the bug

After updating synapse and mautrix_whatsapp_ynh I lost connection to whatsapp. I reinstalled mautrix_whatsapp_ynh and can now sucessfully speak to the Whatsapp Bridge in Elements (version leads to mautrix-whatsappv0.8.6 (Jun 16 2023, 11:48:57))
When entering login however the response is Failed to upload QR code: failed to POST /_matrix/media/v3/upload: M_UNKNOWN (HTTP 500): Internal server error
I restarted the system and tried to find more logs or hints about the error without success so far.

Context

  • Hardware: VPS at hetzner.com
  • YunoHost version: 11.1.22
  • I have access to my server: SSH, Webadmin, ...
  • Using, or trying to install package version: v0.8.6 (before it was Version 0.7.1~ynh1)

Expected behavior

QR Code to connect Whatsapp gets uplaoded

@rosbeef
Copy link

rosbeef commented Jul 23, 2023

I have the same problem with shared medias,
photos sent on whatsapp by third party are not bridged to element
i have an error in synapse

Jul 23 20:13:41 python[20611]: 2023-07-23 20:13:41,853 - synapse.http.server - 133 - ERROR - POST-110297- Failed handle request via 'UploadResource': <XForwardedForRequest at 0xaaf70820 method='POST' uri='/_matrix/media/r0/upload?filename=IMG-20230723-WA0000.jpg' clientproto='HTTP/1.0' site='8008'>
Jul 23 20:13:41 python[20611]: Traceback (most recent call last):
Jul 23 20:13:41 python[20611]:   File "/opt/yunohost/matrix-synapse/lib/python3.9/site-packages/synapse/http/server.py", line 319, in _async_render_wrapper
Jul 23 20:13:41 python[20611]:     callback_return = await self._async_render(request)
Jul 23 20:13:41 python[20611]:   File "/opt/yunohost/matrix-synapse/lib/python3.9/site-packages/synapse/http/server.py", line 349, in _async_render
Jul 23 20:13:41 python[20611]:     callback_return = await raw_callback_return
Jul 23 20:13:41 python[20611]:   File "/opt/yunohost/matrix-synapse/lib/python3.9/site-packages/synapse/rest/media/upload_resource.py", line 95, in _async_render_POST
Jul 23 20:13:41 python[20611]:     content_uri = await self.media_repo.create_content(
Jul 23 20:13:41 python[20611]:   File "/opt/yunohost/matrix-synapse/lib/python3.9/site-packages/synapse/media/media_repository.py", line 215, in create_content
Jul 23 20:13:41 python[20611]:     await self._generate_thumbnails(None, media_id, media_id, media_type)
Jul 23 20:13:41 python[20611]:   File "/opt/yunohost/matrix-synapse/lib/python3.9/site-packages/synapse/media/media_repository.py", line 797, in _generate_thumbnails
Jul 23 20:13:41 python[20611]:     t_byte_source = await defer_to_thread(
Jul 23 20:13:41 python[20611]:   File "/opt/yunohost/matrix-synapse/lib/python3.9/site-packages/twisted/python/threadpool.py", line 244, in inContext
Jul 23 20:13:41 python[20611]:     result = inContext.theWork()  # type: ignore[attr-defined]
Jul 23 20:13:41 python[20611]:   File "/opt/yunohost/matrix-synapse/lib/python3.9/site-packages/twisted/python/threadpool.py", line 260, in <lambda>
Jul 23 20:13:41 python[20611]:     inContext.theWork = lambda: context.call(  # type: ignore[attr-defined]
Jul 23 20:13:41 python[20611]:   File "/opt/yunohost/matrix-synapse/lib/python3.9/site-packages/twisted/python/context.py", line 117, in callWithContext
Jul 23 20:13:41 python[20611]:     return self.currentContext().callWithContext(ctx, func, *args, **kw)
Jul 23 20:13:41 python[20611]:   File "/opt/yunohost/matrix-synapse/lib/python3.9/site-packages/twisted/python/context.py", line 82, in callWithContext
Jul 23 20:13:41 python[20611]:     return func(*args, **kw)
Jul 23 20:13:41 python[20611]:   File "/opt/yunohost/matrix-synapse/lib/python3.9/site-packages/synapse/logging/context.py", line 969, in g
Jul 23 20:13:41 python[20611]:     return f(*args, **kwargs)
Jul 23 20:13:41 python[20611]:   File "/opt/yunohost/matrix-synapse/lib/python3.9/site-packages/synapse/media/thumbnailer.py", line 172, in crop
Jul 23 20:13:41 python[20611]:     with self._resize(scaled_width, scaled_height) as scaled_image:
Jul 23 20:13:41 python[20611]:   File "/opt/yunohost/matrix-synapse/lib/python3.9/site-packages/synapse/media/thumbnailer.py", line 134, in _resize
Jul 23 20:13:41 python[20611]:     return self.image.resize((width, height), Image.ANTIALIAS)
Jul 23 20:13:41 python[20611]: AttributeError: module 'PIL.Image' has no attribute 'ANTIALIAS'

and in mautrix_whatsapp logs:

{"level":"error","module":"Portal/[email protected]@s.whatsapp.net","time":"2023-07-23T20:05:14.142368404Z","message":"Failed to bridge media for 259DBABA2A095FC35BF7DD40BC49924C: failed to upload media: failed to POST /_matrix/media/v3/upload: M_UNKNOWN (HTTP 500): Internal server error"}
{"level":"error","module":"Portal/[email protected]@s.whatsapp.net","time":"2023-07-23T20:05:14.969037604Z","message":"Failed to bridge media for E565041A58F8CE4F7907AABAA64CC812: failed to upload media: failed to POST /_matrix/media/v3/upload: M_UNKNOWN (HTTP 500): Internal server error"}

@thardev
Copy link
Collaborator

thardev commented Jul 24, 2023

Hi @rosbeef @jakobkilian

I'll have a look on this, maybe something changed API wise and I did not check it properly.
I'll keep you updated 🙂

@thardev
Copy link
Collaborator

thardev commented Jul 25, 2023

I took a look on this and regarding the error you posted @rosbeef it could be related to an upstream bug from Synapse.
See: YunoHost-Apps/synapse_ynh#396

Could you tell me which version of Synapse are you using? @jakobkilian @rosbeef

@rosbeef
Copy link

rosbeef commented Jul 25, 2023

Synapse 1.87.0~ynh1

@jakobkilian
Copy link
Author

sorry, I have already taken everything down (for other reasons), but I also used 1.87.0~ynh1

@thardev
Copy link
Collaborator

thardev commented Jul 26, 2023

Ok, so I'll suggest to wait until it is fixed from upstream and it may be solved here as well. From what I saw in the bug report that I linked it should be solved in the next release (1.88.0)

@rosbeef
Copy link

rosbeef commented Jul 30, 2023

please test it's working today

@thardev
Copy link
Collaborator

thardev commented Aug 7, 2023

Hi @rosbeef

I already updated to latest version (1.88.0) and seems to be working fine, I'll close this, feel free to reopen if you experience any issues but also keep in mind that this is a Synapse upstream issue so I cannot do anything about it 🙂

@thardev thardev closed this as completed Aug 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants