You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by "Julian Reschke (Jira)" <ji...@apache.org> on 2022/11/08 15:13:00 UTC

[jira] [Comment Edited] (JCR-4814) FileDataStore: File.renameTo sometimes fails to move temporary file to data record location

    [ https://issues.apache.org/jira/browse/JCR-4814?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17572989#comment-17572989 ] 

Julian Reschke edited comment on JCR-4814 at 11/8/22 3:12 PM:
--------------------------------------------------------------

trunk: (2.21.12) [r1903106|http://svn.apache.org/r1903106] [r1903102|http://svn.apache.org/r1903102]
2.20: (2.20.7) [r1903332|http://svn.apache.org/r1903332]
2.16: [r1905156|http://svn.apache.org/r1905156]



was (Author: reschke):
trunk: (2.21.12) [r1903106|http://svn.apache.org/r1903106] [r1903102|http://svn.apache.org/r1903102]
2.20: [r1903332|http://svn.apache.org/r1903332]


> FileDataStore: File.renameTo sometimes fails to move temporary file to data record location
> -------------------------------------------------------------------------------------------
>
>                 Key: JCR-4814
>                 URL: https://issues.apache.org/jira/browse/JCR-4814
>             Project: Jackrabbit Content Repository
>          Issue Type: Bug
>          Components: jackrabbit-data
>            Reporter: Kunal Shubham
>            Assignee: Julian Reschke
>            Priority: Major
>             Fix For: 2.22, 2.21.12, 2.20.7, 2.16.11
>
>         Attachments: JCR-4814.patch
>
>
> Getting this error intermittently when trying to add a binary to filedatastore, ultimately throwing DataStoreException:
> {code:java}
> Caused by: org.apache.jackrabbit.core.data.DataStoreException: Could not add record
>     at org.apache.jackrabbit.core.data.FileDataStore.addRecord(FileDataStore.java:230) [org.apache.jackrabbit.jackrabbit-data:2.18.3]
>     at org.apache.jackrabbit.oak.plugins.blob.datastore.DataStoreBlobStore.addRecord(DataStoreBlobStore.java:562) [org.apache.jackrabbit.oak-blob-plugins:1.10.6]
>     at org.apache.jackrabbit.oak.plugins.blob.datastore.DataStoreBlobStore.writeStream(DataStoreBlobStore.java:661) [org.apache.jackrabbit.oak-blob-plugins:1.10.6]
>     at org.apache.jackrabbit.oak.plugins.blob.datastore.DataStoreBlobStore.writeBlob(DataStoreBlobStore.java:237) [org.apache.jackrabbit.oak-blob-plugins:1.10.6]
>     ... 13 common frames omitted
> Caused by: java.io.IOException: Can not rename /sb/env/aem/aem-primary/crx-quickstart/datastore/tmp8078245415384830382.tmp to /sb/env/aem/aem-primary/crx-quickstart/datastore/40/62/95/406295aa1c0ba2cc6d64c30ac22c101bd256f38fb5fd8a70d97578974e4c568c (media read only?)  {code}
> Apparently the File.renameTo() method fails at [1]. I checked that using java.nio.file.Files.move() instead fixes the issue. So I propose to add Files.move as a fall back to File.renameTo.
> [1] [https://github.com/apache/jackrabbit/blob/trunk/jackrabbit-data/src/main/java/org/apache/jackrabbit/core/data/FileDataStore.java#L199] 



--
This message was sent by Atlassian Jira
(v8.20.10#820010)