Project

General

Profile

Actions

Defect #2307

closed

Importing a batch created by CzechIdM on Windows fails on Linux

Added by Alena Peterová almost 4 years ago. Updated almost 4 years ago.

Status:
Closed
Priority:
Low
Assignee:
Radek Tomiška
Category:
Export Import
Target version:
Start date:
06/08/2020
Due date:
% Done:

100%

Estimated time:
Affected versions:
Owner:

Description

Tested on version: 10.3.2
Tested on CzechIdM installed in a production-ready version (https://wiki.czechidm.com/tutorial/adm/czechidm_installation), or in Demo, or in IdM running locally in Eclipse.
When trying to run an import batch, we get following exception:

eu.bcvsolutions.idm.core.api.exception.ResultCodeException: Export/import IO exception occurred!
    at eu.bcvsolutions.idm.core.model.service.impl.DefaultImportManager.executeImportForType(DefaultImportManager.java:441)
    at eu.bcvsolutions.idm.core.model.service.impl.DefaultImportManager.lambda$internalExecuteImport$1(DefaultImportManager.java:221)
    at java.util.ArrayList.forEach(ArrayList.java:1257)
    at eu.bcvsolutions.idm.core.model.service.impl.DefaultImportManager.internalExecuteImport(DefaultImportManager.java:220)
    at eu.bcvsolutions.idm.core.model.service.impl.DefaultImportManager$$FastClassBySpringCGLIB$$6e60f64f.invoke(<generated>)
    at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218)
    at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:749)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
    at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:295)
    at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:98)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
    at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:688)
    at eu.bcvsolutions.idm.core.model.service.impl.DefaultImportManager$$EnhancerBySpringCGLIB$$bfaba97a.internalExecuteImport(<generated>)
    at eu.bcvsolutions.idm.core.scheduler.task.impl.ImportTaskExecutor.process(ImportTaskExecutor.java:69)
    at eu.bcvsolutions.idm.core.scheduler.task.impl.ImportTaskExecutor.process(ImportTaskExecutor.java:32)
    at eu.bcvsolutions.idm.core.scheduler.api.service.AbstractLongRunningTaskExecutor.call(AbstractLongRunningTaskExecutor.java:212)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at org.springframework.security.concurrent.DelegatingSecurityContextRunnable.run(DelegatingSecurityContextRunnable.java:84)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at java.lang.Thread.run(Thread.java:748)
Caused by: java.nio.file.NoSuchFileException: /opt/czechidm/data/temp/6710554196477292052/SysSystemDto
    at sun.nio.fs.UnixException.translateToIOException(UnixException.java:86)
    at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102)
    at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:107)
    at sun.nio.fs.UnixFileAttributeViews$Basic.readAttributes(UnixFileAttributeViews.java:55)
    at sun.nio.fs.UnixFileSystemProvider.readAttributes(UnixFileSystemProvider.java:144)
    at sun.nio.fs.LinuxFileSystemProvider.readAttributes(LinuxFileSystemProvider.java:99)
    at java.nio.file.Files.readAttributes(Files.java:1737)
    at java.nio.file.FileTreeWalker.getAttributes(FileTreeWalker.java:219)
    at java.nio.file.FileTreeWalker.visit(FileTreeWalker.java:276)
    at java.nio.file.FileTreeWalker.walk(FileTreeWalker.java:322)
    at java.nio.file.FileTreeIterator.<init>(FileTreeIterator.java:72)
    at java.nio.file.Files.walk(Files.java:3574)
    at java.nio.file.Files.walk(Files.java:3625)
    at eu.bcvsolutions.idm.core.model.service.impl.DefaultImportManager.executeImportForType(DefaultImportManager.java:257)
    ... 20 more

The file /opt/czechidm/data/temp/6710554196477292052/SysSystemDto really doesn't exist.

The same import batch runs correctly on Windows.

Actions #1

Updated by Alena Peterová almost 4 years ago

  • Tracker changed from Task to Defect
  • Subject changed from Importing a system fails on CzechIdM running on Linux to Importing any batch fails on CzechIdM running on Linux

The same holds for roles.

Actions #2

Updated by Vít Švanda almost 4 years ago

  • Status changed from New to In Progress
  • Target version set to 10.4.0

The problem occurs only if the zip is created on Windows and imports on Linux.

Cases Linux -> Linux, Windows -> Windows, Linux -> Windows works well.

After investigation (thanks @kopro ) it looks like problem in zip compress util.

Here is workaround:

You can fix zip file with using unzip/zip command on Linux. After that final import (new-export.zip) works well.

unzip export.zip -d temp-export
cd temp-export
zip -r new-export.zip *
Actions #3

Updated by Alena Peterová almost 4 years ago

  • Subject changed from Importing any batch fails on CzechIdM running on Linux to Importing a batch created by CzechIdM on Windows fails on Linux
  • Priority changed from Normal to Low

Thank you. Since the problem is only for different OS and also can be resolved, the priority is much lower.

Actions #4

Updated by Radek Tomiška almost 4 years ago

  • Assignee changed from Vít Švanda to Radek Tomiška
Actions #5

Updated by Radek Tomiška almost 4 years ago

  • Status changed from In Progress to Needs feedback
  • Assignee changed from Radek Tomiška to Vít Švanda
  • % Done changed from 0 to 90

I removed back slashes usage in zip entry - now is possible to import batch created on Windows <-> Linux.

Commit:
https://github.com/bcvsolutions/CzechIdMng/commit/a5f21f6f5960fc27ce0862d6bbeaa668f8a32a1d

Could you provide me a feedback, please?

Actions #6

Updated by Vít Švanda almost 4 years ago

  • Status changed from Needs feedback to Resolved
  • Assignee changed from Vít Švanda to Radek Tomiška
  • % Done changed from 90 to 100

I did reivew and test all variant. Works nice, thanks for the fix.

Actions #7

Updated by Radek Tomiška almost 4 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF