Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 516302

Summary: URL encode error messages before writing them
Product: [ECD] Orion Reporter: Remy Suen <remy.suen>
Component: NodeAssignee: Project Inbox <orion.server-inbox>
Status: RESOLVED WORKSFORME QA Contact:
Severity: critical    
Priority: P3 CC: Michael_Rennie, Silenio_Quarti, snorthov
Version: 14.0   
Target Milestone: 18.0   
Hardware: PC   
OS: Windows 10   
Whiteboard:
Bug Depends on:    
Bug Blocks: 514343    

Description Remy Suen CLA 2017-05-08 06:54:33 EDT
I was working on bug 516088 when the server crashed after I tried to delete a folder I made. The folder had a Japanese name "あいうえお" and contained a clone of Spoon-Knife.

https://github.com/octocat/Spoon-Knife

$ node server.js -w ..\..\..\git\jp
[2017-05-08 19:31:46.619] [INFO] [server] Using workspace: \programming\eclipse\git\jp
(node:5548) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 2): Error: Forbidden
(node:5548) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 6): Error: Forbidden
_http_server.js:195
    throw new Error('Invalid character in statusMessage.');
    ^

Error: Invalid character in statusMessage.
    at ServerResponse.writeHead (_http_server.js:195:11)
    at ServerResponse.writeHead (orionode\node_modules\on-headers\index.js:55:19)
    at writeError (orionode\lib\api.js:133:7)
    at done (orionode\lib\file.js:270:6)
    at checkWorkspace (orionode\lib\file.js:279:5)
    at CB (orionode\node_modules\rimraf\rimraf.js:68:5)
    at orionode\node_modules\rimraf\rimraf.js:192:18
    at CB (orionode\node_modules\rimraf\rimraf.js:68:5)
    at orionode\node_modules\rimraf\rimraf.js:192:18
    at CB (orionode\node_modules\rimraf\rimraf.js:68:5)
    at orionode\node_modules\rimraf\rimraf.js:192:18
    at CB (orionode\node_modules\rimraf\rimraf.js:68:5)
    at orionode\node_modules\rimraf\rimraf.js:192:18
    at CB (orionode\node_modules\rimraf\rimraf.js:68:5)
    at FSReqWrap.oncomplete (fs.js:123:15)
Comment 1 Remy Suen CLA 2017-05-09 05:38:20 EDT
Here are the steps to reproduce the problem.

1.
$ mkdir tmp
$ cd tmp
$ mkdir あいうえお (or if you can't insert Japanese characters in the terminal then just create the folder with your favourite file explorer)
$ vim あいうえお/README.md (this should hopefully lock the file)

2. Start Orion pointing at your created tmp/ folder.
3. Open Orion in a browser.
4. Try to delete the folder.
5. An unknown error occurred. Orion has now crashed.
Comment 2 Silenio Quarti CLA 2018-02-26 21:10:16 EST
Works for me in latest.