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

Comment without a parent might break creating an export #8321

Open
tclaus opened this issue Nov 10, 2021 · 4 comments
Open

Comment without a parent might break creating an export #8321

tclaus opened this issue Nov 10, 2021 · 4 comments

Comments

@tclaus
Copy link
Member

tclaus commented Nov 10, 2021

It might happen, that a comment without a parent break creating a export file.

This was the stack trace then

[2021-11-09T07:47:02] ERROR PID-9364 TID-70251293490820 User: Unexpected error while exporting data for 'podmin: NoMethodError: undefined method `guid' for nil:NilClass
/mnt/disks/storage/diaspora/lib/diaspora/federation/entities.rb:50:in `comment'
/mnt/disks/storage/diaspora/lib/diaspora/federation/entities.rb:7:in `public_send'
/mnt/disks/storage/diaspora/lib/diaspora/federation/entities.rb:7:in `build'
/mnt/disks/storage/diaspora/app/serializers/federation_entity_serializer.rb:16:in `entity'
/mnt/disks/storage/diaspora/app/serializers/federation_entity_serializer.rb:12:in `modify_serializable_object'
/mnt/disks/storage/diaspora/app/serializers/export/own_relayables_serializer.rb:10:in `modify_serializable_object'
/mnt/disks/storage/diaspora/app/serializers/serializer_post_processing.rb:11:in `serializable_object'
/mnt/disks/storage/diaspora/vendor/bundle/ruby/2.6.0/gems/active_model_serializers-0.9.7/lib/active_model/serializable.rb:24:in `block in serializable_object_with_notification'
/mnt/disks/storage/diaspora/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.6/lib/active_support/notifications.rb:170:in `instrument'
/mnt/disks/storage/diaspora/vendor/bundle/ruby/2.6.0/gems/active_model_serializers-0.9.7/lib/active_model/serializable.rb:56:in `instrument'
/mnt/disks/storage/diaspora/vendor/bundle/ruby/2.6.0/gems/active_model_serializers-0.9.7/lib/active_model/serializable.rb:24:in `serializable_object_with_notification'
/mnt/disks/storage/diaspora/app/serializers/flat_map_array_serializer.rb:7:in `block (2 levels) in serializable_object'
/mnt/disks/storage/diaspora/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.6/lib/active_record/relation/batches.rb:70:in `block (2 levels) in find_each'
/mnt/disks/storage/diaspora/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.6/lib/active_record/relation/batches.rb:70:in `each'
/mnt/disks/storage/diaspora/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.6/lib/active_record/relation/batches.rb:70:in `block in find_each'
@tclaus
Copy link
Member Author

tclaus commented Nov 10, 2021

Just for the records, I found out that with
select id, guid, commentable_id from comments where commentable_id not in (select id from posts where id=comments.commentable_id);
and
select id, guid, target_type from likes where target_type = 'Post' and target_id not in (select id from posts where posts.id = likes.target_id);

I am able to get these entities without parent.

@SuperTux88
Copy link
Member

You shouldn't have a lot of them, if you have a lot, then something else is going completely wrong.

@SuperTux88
Copy link
Member

I just did these queries on my pod (existing since more than 10 years), without the author_id (so for ALL users), and I have 6 comments and 1 like without their parent ... so this happens once every year or so ... if you have more than this one, it's already a bit strange.

Also, if one of the comments or likes without parent is recent enough, so you still have logs of the creation event, this would be interesting.

@tclaus
Copy link
Member Author

tclaus commented Nov 10, 2021

To be honest, the reason is for sure that I have fiddled a bit in the beginning of the pod with its data. But even one of them stops generating the export.

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