Skip to content

Notes with attachments cannot be created after changing storage directory #10

@rwi

Description

@rwi

Steps to reproduce:

  • change storage directory in administration at 'Contents > File Storage'
  • start creating a create a new note
  • upload an attachment -> upload fails with error message 'The file upload failed'

The logs contain the following exception

2016-07-11 15:51:43,078 ERROR http-apr-53080-exec-1 com.communote.server.core.storing.ResourceStoringManagementImpl - Content Storing failed: Error wri
ting to file content.jpg /opt/communote/data-dir/filerepository2/global/default_filesystem_connector/1468245103076_755539063/content.jpg (No such file or directory)
com.communote.server.persistence.crc.ContentRepositoryException: Error writing to file content.jpg /opt/communote/data-dir/filerepository2/global/default_filesystem_connector/1468245103076_755539063/content.jpg (No such file or directory)
        at com.communote.server.core.crc.FilesystemConnector.storeContent(FilesystemConnector.java:407)
        at com.communote.server.core.crc.RepositoryConnectorDelegateImpl.handleStoreContent(RepositoryConnectorDelegateImpl.java:277)
        at com.communote.server.core.crc.RepositoryConnectorDelegateBase.storeContent(RepositoryConnectorDelegateBase.java:343)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:317)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
        at org.springframework.orm.hibernate3.HibernateInterceptor.invoke(HibernateInterceptor.java:111)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
        at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:96)
        at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:260)
        at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:94)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
        at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
        at com.sun.proxy.$Proxy150.storeContent(Unknown Source)
        at com.communote.server.core.storing.ResourceStoringManagementImpl.storeInRepository(ResourceStoringManagementImpl.java:565)
        at com.communote.server.core.storing.ResourceStoringManagementImpl.handleStoreAttachment(ResourceStoringManagementImpl.java:396)
        at com.communote.server.core.storing.ResourceStoringManagementBase.storeAttachment(ResourceStoringManagementBase.java:213)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

        and a lot more

        at java.lang.Thread.run(Thread.java:745)
Caused by: java.io.FileNotFoundException: /opt/communote/data-dir/filerepository2/global/default_filesystem_connector/1468245103076_755539063/content.jpg (No such file or directory)
        at java.io.FileOutputStream.open0(Native Method)
        at java.io.FileOutputStream.open(FileOutputStream.java:270)
        at java.io.FileOutputStream.<init>(FileOutputStream.java:213)
        at java.io.FileOutputStream.<init>(FileOutputStream.java:162)
        at com.communote.server.core.vo.content.AttachmentTO.write(AttachmentTO.java:335)
        at com.communote.server.core.crc.FilesystemConnector.storeContent(FilesystemConnector.java:403)
        ... 132 more

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions