Bug 1324700

Summary: org.uberfire.java.nio.file.NoSuchFileException when uploading a Spreadsheet under a multibyte name project
Product: [Retired] JBoss BRMS Platform 6 Reporter: Toshiya Kobayashi <tkobayas>
Component: Business CentralAssignee: manstis
Status: CLOSED EOL QA Contact: Jiri Locker <jlocker>
Severity: high Docs Contact:
Priority: unspecified    
Version: 6.2.0   
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 1328661 (view as bug list) Environment:
Last Closed: 2020-03-27 19:07:00 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Bug Depends On:    
Bug Blocks: 1328661    
Attachments:
Description Flags
small-no-deps.xls none

Description Toshiya Kobayashi 2016-04-07 03:14:14 UTC
Created attachment 1144532 [details]
small-no-deps.xls

Description of problem:

When you upload a Spreadsheet under a multibyte name project, a browser will get a blank view or a "Loading..." popup which doesn't finish. So you will need to reload the browser. org.uberfire.java.nio.file.NoSuchFileException is logged on server side.

===================
12:05:16,293 INFO  [org.drools.workbench.screens.dtablexls.backend.server.DecisionTableXLSServiceImpl] (http-/127.0.0.1:8080-7) USER:brmsAdmin CREATING asset [test1.xls]
12:05:16,325 INFO  [org.guvnor.common.services.builder.ResourceChangeIncrementalBuilder] (Thread-100) Incremental build request received for: default://master@repository1/%E3%81%82%E3%81%82%E3%81%82/src/main/resources/test1.xls (added).
12:05:16,391 INFO  [org.guvnor.common.services.builder.ResourceChangeIncrementalBuilder] (EJB default - 3) Incremental build request being processed: default://master@repository1/%E3%81%82%E3%81%82%E3%81%82/src/main/resources/test1.xls (added).
12:05:16,426 INFO  [org.guvnor.common.services.builder.ResourceChangeIncrementalBuilder] (Thread-100) Incremental build request received for: default://master@repository1/%E3%81%82%E3%81%82%E3%81%82/src/main/resources/test1.xls (updated).
12:05:16,528 INFO  [org.guvnor.common.services.builder.ResourceChangeIncrementalBuilder] (EJB default - 8) Incremental build request being processed: default://master@repository1/%E3%81%82%E3%81%82%E3%81%82/src/main/resources/test1.xls (updated).
12:05:16,603 INFO  [org.drools.compiler.kie.builder.impl.KieRepositoryImpl] (EJB default - 8) KieModule was added: MemoryKieModule[releaseId=example:test:1.0]
12:05:16,823 ERROR [org.guvnor.common.services.backend.exceptions.ExceptionUtilities] (http-/127.0.0.1:8080-6) Exception thrown: null: org.uberfire.java.nio.file.NoSuchFileException
	at org.uberfire.java.nio.fs.jgit.JGitFileSystemProvider.getFileAttributeView(JGitFileSystemProvider.java:1627) [uberfire-nio2-jgit-0.7.4.Final-redhat-4.jar:0.7.4.Final-redhat-4]
	at org.uberfire.java.nio.file.Files.getFileAttributeView(Files.java:557) [uberfire-nio2-api-0.7.4.Final-redhat-4.jar:0.7.4.Final-redhat-4]
	at org.uberfire.io.impl.IOServiceDotFileImpl.getFileAttributeView(IOServiceDotFileImpl.java:182) [uberfire-io-0.7.4.Final-redhat-4.jar:0.7.4.Final-redhat-4]
	at org.guvnor.common.services.backend.metadata.MetadataServiceImpl.getMetadata(MetadataServiceImpl.java:84) [guvnor-services-backend-6.3.0.Final-redhat-5.jar:6.3.0.Final-redhat-5]
	at org.guvnor.common.services.backend.metadata.MetadataServiceImpl.getMetadata(MetadataServiceImpl.java:77) [guvnor-services-backend-6.3.0.Final-redhat-5.jar:6.3.0.Final-redhat-5]
	at org.guvnor.common.services.backend.metadata.MetadataServiceImpl$Proxy$_$$_WeldClientProxy.getMetadata(MetadataServiceImpl$Proxy$_$$_WeldClientProxy.java) [guvnor-services-backend-6.3.0.Final-redhat-5.jar:6.3.0.Final-redhat-5]
	at org.kie.workbench.common.services.backend.service.KieService.loadOverview(KieService.java:108) [kie-wb-common-services-backend-6.3.0.Final-redhat-5.jar:6.3.0.Final-redhat-5]
	at org.kie.workbench.common.services.backend.service.KieService.loadContent(KieService.java:92) [kie-wb-common-services-backend-6.3.0.Final-redhat-5.jar:6.3.0.Final-redhat-5]
	at org.drools.workbench.screens.dtablexls.backend.server.DecisionTableXLSServiceImpl.loadContent(DecisionTableXLSServiceImpl.java:108) [drools-wb-dtable-xls-editor-backend-6.3.0.Final-redhat-5.jar:6.3.0.Final-redhat-5]
	at org.drools.workbench.screens.dtablexls.backend.server.DecisionTableXLSServiceImpl$Proxy$_$$_WeldClientProxy.loadContent(DecisionTableXLSServiceImpl$Proxy$_$$_WeldClientProxy.java) [drools-wb-dtable-xls-editor-backend-6.3.0.Final-redhat-5.jar:6.3.0.Final-redhat-5]
...

12:05:16,827 WARN  [org.kie.workbench.common.services.backend.service.KieService] (http-/127.0.0.1:8080-6) No metadata found for file: test1.xls, full path [default://master@repository1/%25E3%2581%2582%25E3%2581%2582%25E3%2581%2582/src/main/resources/test1.xls]
12:05:16,829 INFO  [org.kie.workbench.common.services.backend.service.KieService] (http-/127.0.0.1:8080-6) File: test1.xls, full path [default://master@repository1/%25E3%2581%2582%25E3%2581%2582%25E3%2581%2582/src/main/resources/test1.xls] was not within a Project. Project Name cannot be set.
======


Steps to Reproduce:
1. Login to business-central
2. [Authoring]->[Project Authoring]
3. [New Item]->[Project] Create a multibyte name project (e.g. "あああ")
4. [New Item]->[Decision Table (Spreadsheet)]
5. Upload a Spreadsheet with any name (e.g. "test1"). Any spreadsheet can reproduce the issue but I attached "small-no-deps.xls" for your convenience.
6. "Uploaded successfully" popup is raised. Click "OK"

## NOTE: The above is "multibyte name project" + "ascii name Spreadsheet" use case. For verification test, please test "multibyte name project" + "multibyte name Spreadsheet" use case in addition.

Actual results:

- The browser gets a blank view or a "Loading..." popup which doesn't finish.
- NoSuchFileException is thrown

Expected results:

- The browser displays DecisionTable view.
- No Exception

Additional info:

After the issue, you can access the uploaded Spreadsheet as usual. The issue only occurs when you upload a Spreadsheet.

Comment 1 Toshiya Kobayashi 2016-04-07 03:20:16 UTC
Analysis:

As you can see in the log,

====
12:05:16,829 INFO  [org.kie.workbench.common.services.backend.service.KieService] (http-/127.0.0.1:8080-6) File: test1.xls, full path [default://master@repository1/%25E3%2581%2582%25E3%2581%2582%25E3%2581%2582/src/main/resources/test1.xls] was not within a Project. Project Name cannot be set.
====

The project name is "%25E3%2581%2582%25E3%2581%2582%25E3%2581%2582". "%25" is a URLEncoded form of '%'. It means that the project name is URLEncoded twice. The correct value should be "%E3%81%82%E3%81%82%E3%81%82".