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

Fix attachment not being re-downloaded even if file is not stored #12125

Merged
merged 1 commit into from
Oct 9, 2019

Conversation

Gargron
Copy link
Member

@Gargron Gargron commented Oct 9, 2019

Change the behaviour of remotable concern. Previously, it would skip downloading an attachment if the stored remote URL is identical to the new one. Now it would not be skipped if the attachment is not
actually currently stored by Paperclip.

Clean up some code style issues

Change the behaviour of remotable concern. Previously, it would skip
downloading an attachment if the stored remote URL is identical to
the new one. Now it would not be skipped if the attachment is not
actually currently stored by Paperclip.
@Gargron Gargron merged commit 354fdd3 into master Oct 9, 2019
@Gargron Gargron deleted the fix-remotable-url branch October 9, 2019 05:11
@saper
Copy link
Contributor

saper commented Dec 18, 2019

Could this https://discourse.joinmastodon.org/t/media-federation-issue-from-other-instance/2409/8?u=saper be related? Files in /tmp getting removed before they can be processed by Paperclip?

Dec 18 20:53:34 canors_ubuntu bundle[7872]: [paperclip] Link failed with
       No such file or directory @ rb_file_s_link -  
       (/tmp/8d777f385d3dfec8815d20f7496026dc20191218-7872-1inp97p, 
        /tmp/0e5a4502ebd6ef8093a97f30d75321b120191218-7872-jx4qkf); 
        copying link /tmp/8d777f385d3dfec8815d20f7496026dc20191218-7872-1inp97p to    
        /tmp/0e5a4502ebd6ef8093a97f30d75321b120191218-7872-jx4qkf

and

Dec 18 20:53:34 canors_ubuntu bundle[7872]: 
2019-12-18T11:53:34.311Z 7872 TID-gou8367tc 
WARN: Errno::ENOENT: No such file or directory @ rb_sysopen - 
/tmp/8d777f385d3dfec8815d20f7496026dc20191218-7872-1inp97p

(newlines added for readability, full log: https://gist.github.com/Canorus/e5601bfe69a50c7a377e898d93ac223c)

@Gargron
Copy link
Member Author

Gargron commented Dec 18, 2019

I find it highly unlikely for this to be the cause. Paperclip is only invoked in the first place by the line send("#{attachment_name}=", StringIO.new(response.body_with_limit(limit))), since this PR would return earlier, no Paperclip methods would be executed.

@saper
Copy link
Contributor

saper commented Dec 18, 2019

I don't know the exact symptoms of the issue fixed here.

i was wondering whether this could cause or maybe fix the problem reported by the OP. I see we have changed the way we remove temp files... -

Thanks

rtucker pushed a commit to vulpineclub/mastodon that referenced this pull request Jan 7, 2021
…g re-downloaded even if file is not stored

Change the behaviour of remotable concern. Previously, it would skip
downloading an attachment if the stored remote URL is identical to
the new one. Now it would not be skipped if the attachment is not
actually currently stored by Paperclip.
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

Successfully merging this pull request may close these issues.

3 participants