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

Stator has issues with incoming images that have broken or missing focalPoint #393

Closed
rcarmo opened this issue Jan 11, 2023 · 4 comments
Closed

Comments

@rcarmo
Copy link
Contributor

rcarmo commented Jan 11, 2023

Here's a log snippet from my test instance, running today's git tip:

orker.1 | Tasks processed this loop:
worker.1 | Running cleaning and scheduling
worker.1 | Attempting transition on users.inboxmessage#987 from state received
worker.1 | Traceback (most recent call last):
worker.1 |   File "/home/piku/.piku/envs/takahe/lib/python3.10/site-packages/asgiref/sync.py", line 486, in thread_handler
worker.1 |     raise exc_info[1]
worker.1 |   File "/home/piku/.piku/apps/takahe/stator/models.py", line 233, in atransition_attempt
worker.1 |     next_state = await current_state.handler(self)  # type: ignore
worker.1 |   File "/home/piku/.piku/apps/takahe/users/models/inbox_message.py", line 30, in handle_received
worker.1 |     await sync_to_async(Post.handle_create_ap)(instance.message)
worker.1 |   File "/home/piku/.piku/envs/takahe/lib/python3.10/site-packages/asgiref/sync.py", line 448, in __call__
worker.1 |     ret = await asyncio.wait_for(future, timeout=None)
worker.1 |   File "/usr/lib/python3.10/asyncio/tasks.py", line 408, in wait_for
worker.1 |     return await fut
worker.1 |   File "/home/piku/.piku/envs/takahe/lib/python3.10/site-packages/asgiref/current_thread_executor.py", line 22, in run
worker.1 |     result = self.fn(*self.args, **self.kwargs)
worker.1 |   File "/home/piku/.piku/envs/takahe/lib/python3.10/site-packages/asgiref/sync.py", line 490, in thread_handler
worker.1 |     return func(*args, **kwargs)
worker.1 |   File "/home/piku/.piku/apps/takahe/activities/models/post.py", line 916, in handle_create_ap
worker.1 |     cls.by_ap(data["object"], create=True, update=True)
worker.1 |   File "/home/piku/.piku/apps/takahe/activities/models/post.py", line 815, in by_ap
worker.1 |     focal_x, focal_y = attachment["focalPoint"]
worker.1 | ValueError: not enough values to unpack (expected 2, got 1)
worker.1 | Traceback (most recent call last):
worker.1 |   File "/home/piku/.piku/apps/takahe/stator/models.py", line 233, in atransition_attempt
worker.1 |     next_state = await current_state.handler(self)  # type: ignore
worker.1 |   File "/home/piku/.piku/apps/takahe/users/models/inbox_message.py", line 30, in handle_received
worker.1 |     await sync_to_async(Post.handle_create_ap)(instance.message)
worker.1 |   File "/home/piku/.piku/envs/takahe/lib/python3.10/site-packages/asgiref/sync.py", line 448, in __call__
worker.1 |     ret = await asyncio.wait_for(future, timeout=None)
worker.1 |   File "/usr/lib/python3.10/asyncio/tasks.py", line 408, in wait_for
worker.1 |     return await fut
worker.1 |   File "/home/piku/.piku/envs/takahe/lib/python3.10/site-packages/asgiref/current_thread_executor.py", line 22, in run
worker.1 |     result = self.fn(*self.args, **self.kwargs)
worker.1 |   File "/home/piku/.piku/envs/takahe/lib/python3.10/site-packages/asgiref/sync.py", line 490, in thread_handler
worker.1 |     return func(*args, **kwargs)
worker.1 |   File "/home/piku/.piku/apps/takahe/activities/models/post.py", line 916, in handle_create_ap
worker.1 |     cls.by_ap(data["object"], create=True, update=True)
worker.1 |   File "/home/piku/.piku/apps/takahe/activities/models/post.py", line 815, in by_ap
worker.1 |     focal_x, focal_y = attachment["focalPoint"]
worker.1 | ValueError: not enough values to unpack (expected 2, got 1)
@rcarmo rcarmo changed the title Stator has issues with incoming images that have broken or missing folcalPoint Stator has issues with incoming images that have broken or missing focalPoint Jan 11, 2023
@rcarmo
Copy link
Contributor Author

rcarmo commented Jan 11, 2023

I went into Django admin and looked at the message, and it had "focalPoint": [0.0] in the JSON data... Looks like a bad default from the poster that somehow got relayed throughout the Fediverse...

@rcarmo
Copy link
Contributor Author

rcarmo commented Jan 11, 2023

I've now found three of these as one of my follows boosts posts from other folks. He is on a Mastodon instance, so I am guessing this may be rather frequent.

@andrewgodwin
Copy link
Member

Yeah, we should be more tolerant of this if it turns up. I'll get a fix in place.

@rcarmo
Copy link
Contributor Author

rcarmo commented Jan 11, 2023

Thanks! Just pulled your fix, will let you know if anything similar arises.

ephes pushed a commit to ephes/takahe that referenced this issue Jan 27, 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

2 participants