很老的版本了。。最近按照文档做了迁移先升级到0.4.4然后导出json,也复制了upload文件夹。安装最新版本导入json显示成功,后台报错“Caused by: java.nio.file.NoSuchFileException: /tmp/undertow3568791523374871132upload”。
应该是找不到路径已经确认upload在~/.halo文件夹下。请问这种情况下可能是什么原因?怎么解决~~感谢感谢😃😀@

    错误是这个。

    2019-09-18 09:19:31.097 ERROR 20221 --- [         task-1] .a.i.SimpleAsyncUncaughtExceptionHandler : Unexpected exception occurred invoking async method: public void run.halo.app.service.impl.RecoveryServiceImpl.migrateFromV0_4_3(org.springframework.web.multipart.MultipartFile)
    
    run.halo.app.exception.ServiceException: 备份文件 halo_data.json 读取失败
    	at run.halo.app.service.impl.RecoveryServiceImpl.migrateFromV0_4_3(RecoveryServiceImpl.java:140) ~[classes!/:1.1.0]
    	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_191]
    	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_191]
    	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_191]
    	at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_191]
    	at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:343) ~[spring-aop-5.1.9.RELEASE.jar!/:5.1.9.RELEASE]
    	at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:198) ~[spring-aop-5.1.9.RELEASE.jar!/:5.1.9.RELEASE]
    	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163) ~[spring-aop-5.1.9.RELEASE.jar!/:5.1.9.RELEASE]
    	at org.springframework.aop.interceptor.AsyncExecutionInterceptor.lambda$invoke$0(AsyncExecutionInterceptor.java:115) ~[spring-aop-5.1.9.RELEASE.jar!/:5.1.9.RELEASE]
    	at java.util.concurrent.FutureTask.run(FutureTask.java:266) ~[na:1.8.0_191]
    	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) ~[na:1.8.0_191]
    	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) ~[na:1.8.0_191]
    	at java.lang.Thread.run(Thread.java:748) ~[na:1.8.0_191]
    Caused by: java.nio.file.NoSuchFileException: /tmp/undertow161303156308945841upload
    	at sun.nio.fs.UnixException.translateToIOException(UnixException.java:86) ~[na:1.8.0_191]
    	at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102) ~[na:1.8.0_191]
    	at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:107) ~[na:1.8.0_191]
    	at sun.nio.fs.UnixFileSystemProvider.newByteChannel(UnixFileSystemProvider.java:214) ~[na:1.8.0_191]
    	at java.nio.file.Files.newByteChannel(Files.java:361) ~[na:1.8.0_191]
    	at java.nio.file.Files.newByteChannel(Files.java:407) ~[na:1.8.0_191]
    	at java.nio.file.spi.FileSystemProvider.newInputStream(FileSystemProvider.java:384) ~[na:1.8.0_191]
    	at java.nio.file.Files.newInputStream(Files.java:152) ~[na:1.8.0_191]
    	at io.undertow.server.handlers.form.FormData$FileItem.getInputStream(FormData.java:240) ~[undertow-core-2.0.23.Final.jar!/:2.0.23.Final]
    	at io.undertow.servlet.spec.PartImpl.getInputStream(PartImpl.java:63) ~[undertow-servlet-2.0.23.Final.jar!/:2.0.23.Final]
    	at org.springframework.web.multipart.support.StandardMultipartHttpServletRequest$StandardMultipartFile.getInputStream(StandardMultipartHttpServletRequest.java:250) ~[spring-web-5.1.9.RELEASE.jar!/:5.1.9.RELEASE]
    	at run.halo.app.service.impl.RecoveryServiceImpl.migrateFromV0_4_3(RecoveryServiceImpl.java:107) ~[classes!/:1.1.0]
    	... 12 common frames omitted

      Sunird 应该是文件上传失败了。你可以考虑用 1.0.3 版本进行迁移试试呢?

      1 个月 后

      johnniang 本地跑起来迁移数据没问题,我用腾讯云服务器就报上边这样的异常,会不会是nginx的问题或者服务器权限问题?nginx已配置了上传文件最大 2M,文件1.4M

        duia 具体错误信息可以给出么?或者上传文件的时候看看 http code 是多少,如果是 417,也应该是 nginx 的 client_max_body 需要扩大。

        • duia 回复了此帖

          johnniang nginx 的 client_max_body 已经配置过了,没报错了,是后台日志报错了,就是楼主三层展示的错误,异常信息一样。本地没问题,本地迁移完把h2的数据文件上传到了服务器。现在是这样解决的。

            duia 好的,我们排查一下这个问题。初步判断是因为异步造成的。