openstf / stf

Control and manage Android devices from your browser.
https://openstf.io
Other
13.34k stars 2.77k forks source link

Server crashed when package includes non-English character #1186

Open KevinChann opened 4 years ago

KevinChann commented 4 years ago

What is the issue or idea you have? When I use the App Upload function on web and upload a package named QQ邮箱.apk, server just crash and stop process in terminal. Then I rename the SAME apk into qqmail.apk and 仕事をする.apk. qqmail.apk is ok. 仕事をする.apk makes the server crashed too.

My env:

macOS 10.14.5
stf 3.4.1

Here is the crashed log:

2020-02-21T02:26:02.379Z INF/device:plugins:screen:stream 46357 [S2D0219122003818] minicap says: "INFO: (jni/minicap/minicap.cpp:464) New client connection"
2020-02-21T02:26:03.059Z IMP/device:plugins:connect 46357 [S2D0219122003818] Remote Connect Started for device "S2D0219122003818" at "172.22.26.26:7401"
2020-02-21T02:26:14.092Z INF/device:plugins:shell 46357 [S2D0219122003818] Running shell command "ls /sdcard"
2020-02-21T02:26:43.844Z INF/device:plugins:screen:stream 46357 [S2D0219122003818] Requesting frame producer to stop
2020-02-21T02:26:43.844Z INF/device:plugins:screen:stream 46357 [S2D0219122003818] Disconnecting from minicap service
2020-02-21T02:26:43.846Z INF/device:plugins:screen:stream 46357 [S2D0219122003818] Stopping minicap service
2020-02-21T02:26:43.846Z INF/device:plugins:screen:stream 46357 [S2D0219122003818] Sending SIGTERM to minicap
2020-02-21T02:26:43.864Z INF/device:plugins:screen:stream 46357 [S2D0219122003818] minicap says: "INFO: (jni/minicap/minicap.cpp:200) Received SIGTERM, stopping"
2020-02-21T02:26:43.882Z INF/device:plugins:screen:stream 46357 [S2D0219122003818] minicap says: "INFO: (jni/minicap/minicap.cpp:536) Closing client connection"
2020-02-21T02:26:43.882Z INF/device:plugins:screen:stream 46357 [S2D0219122003818] minicap says: "INFO: (external/MY_minicap/src/minicap_29.cpp:291) Destroying virtual display"
2020-02-21T02:26:43.909Z INF/device:plugins:screen:stream 46358 [c6d6c290] Keeping 821x821 as current frame producer projection
2020-02-21T02:26:43.909Z INF/device:plugins:screen:stream 46358 [c6d6c290] Requesting frame producer to start
2020-02-21T02:26:43.909Z INF/device:plugins:screen:stream 46358 [c6d6c290] Launching screen service
2020-02-21T02:26:44.016Z INF/device:plugins:screen:stream 46358 [c6d6c290] minicap says: "PID: 8977"
2020-02-21T02:26:44.016Z INF/device:plugins:screen:stream 46358 [c6d6c290] minicap says: "INFO: Using projection 1080x2280@389x821/0"
2020-02-21T02:26:44.016Z INF/device:plugins:screen:stream 46358 [c6d6c290] minicap says: "INFO: (external/MY_minicap/src/minicap_27.cpp:241) Creating SurfaceComposerClient"
2020-02-21T02:26:44.017Z INF/device:plugins:screen:stream 46358 [c6d6c290] minicap says: "INFO: (external/MY_minicap/src/minicap_27.cpp:244) Performing SurfaceComposerClient init check"
2020-02-21T02:26:44.017Z INF/device:plugins:screen:stream 46358 [c6d6c290] minicap says: "INFO: (external/MY_minicap/src/minicap_27.cpp:255) Creating virtual display"
2020-02-21T02:26:44.018Z INF/device:plugins:screen:stream 46358 [c6d6c290] minicap says: "INFO: (external/MY_minicap/src/minicap_27.cpp:261) Creating buffer queue"
2020-02-21T02:26:44.019Z INF/device:plugins:screen:stream 46358 [c6d6c290] minicap says: "INFO: (external/MY_minicap/src/minicap_27.cpp:264) Setting buffer options"
2020-02-21T02:26:44.019Z INF/device:plugins:screen:stream 46358 [c6d6c290] minicap says: "INFO: (external/MY_minicap/src/minicap_27.cpp:268) Creating CPU consumer"
2020-02-21T02:26:44.019Z INF/device:plugins:screen:stream 46358 [c6d6c290] minicap says: "INFO: (external/MY_minicap/src/minicap_27.cpp:272) Creating frame waiter"
2020-02-21T02:26:44.019Z INF/device:plugins:screen:stream 46358 [c6d6c290] minicap says: "INFO: (external/MY_minicap/src/minicap_27.cpp:276) Publishing virtual display"
2020-02-21T02:26:44.020Z INF/device:plugins:screen:stream 46358 [c6d6c290] Connecting to minicap service
2020-02-21T02:26:44.042Z INF/device:plugins:screen:stream 46358 [c6d6c290] minicap says: "INFO: (jni/minicap/JpgEncoder.cpp:64) Allocating 7470084 bytes for JPG encoder"
2020-02-21T02:26:44.131Z INF/device:plugins:screen:stream 46358 [c6d6c290] Reading minicap banner
2020-02-21T02:26:44.132Z INF/device:plugins:screen:stream 46358 [c6d6c290] minicap says: "INFO: (jni/minicap/minicap.cpp:464) New client connection"
2020-02-21T02:27:30.241Z INF/storage:temp 46353 [*] Uploaded "QQ邮箱.apk" to "/var/folders/jf/z9mvhz095zl__zfpd_z__ngw0000gn/T/upload_e8656e89e4f64c2b9c35254aba1c1329"
internal/streams/legacy.js:59
      throw er; // Unhandled stream error in pipe.
      ^

TypeError: Request path contains unescaped characters
    at new ClientRequest (_http_client.js:137:13)
    at Object.request (http.js:38:10)
    at Request.start (/Users/kevinchan/CKL/stf/stf/node_modules/request/request.js:751:32)
    at Request.end (/Users/kevinchan/CKL/stf/stf/node_modules/request/request.js:1505:10)
    at end (/Users/kevinchan/CKL/stf/stf/node_modules/request/request.js:564:14)
    at Immediate._onImmediate (/Users/kevinchan/CKL/stf/stf/node_modules/request/request.js:578:7)
    at runCallback (timers.js:810:20)
    at tryOnImmediate (timers.js:768:5)
    at processImmediate [as _immediateCallback] (timers.js:745:5)
2020-02-21T02:27:30.393Z ERR/poorxy 46356 [*] Proxy had an error Error: socket hang up
    at createHangUpError (_http_client.js:342:15)
    at Socket.socketOnEnd (_http_client.js:437:23)
    at emitNone (events.js:111:20)
    at Socket.emit (events.js:208:7)
    at endReadableNT (_stream_readable.js:1064:12)
    at _combinedTickCallback (internal/process/next_tick.js:139:11)
    at process._tickCallback (internal/process/next_tick.js:181:9)
2020-02-21T02:27:30.394Z FTL/cli:local 46339 [*] Child process had an error ExitError: Exit code "1"
    at ChildProcess.<anonymous> (/Users/kevinchan/CKL/stf/stf/lib/util/procutil.js:49:23)
    at emitTwo (events.js:126:13)
    at ChildProcess.emit (events.js:214:7)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12)
2020-02-21T02:27:30.394Z INF/cli:local 46339 [*] Shutting down all child processes
2020-02-21T02:27:30.397Z INF/util:lifecycle 46342 [app001] Winding down for graceful exit
2020-02-21T02:27:30.397Z INF/util:lifecycle 46343 [dev001] Winding down for graceful exit
2020-02-21T02:27:30.397Z INF/util:lifecycle 46344 [proc001] Winding down for graceful exit
2020-02-21T02:27:30.397Z INF/util:lifecycle 46345 [proc002] Winding down for graceful exit
2020-02-21T02:27:30.397Z INF/util:lifecycle 46346 [reaper001] Winding down for graceful exit
2020-02-21T02:27:30.397Z INF/util:lifecycle 46347 [*] Winding down for graceful exit
2020-02-21T02:27:30.398Z INF/util:lifecycle 46348 [*] Winding down for graceful exit
2020-02-21T02:27:30.399Z INF/util:lifecycle 46349 [*] Winding down for graceful exit
2020-02-21T02:27:30.399Z INF/auth-mock 46348 [*] Waiting for client connections to end
2020-02-21T02:27:30.399Z INF/util:lifecycle 46350 [*] Winding down for graceful exit
2020-02-21T02:27:30.399Z INF/provider 46347 [*] Cleaning up device worker "S2D0219122003818"
2020-02-21T02:27:30.400Z INF/provider 46347 [*] Cleaning up device worker "c6d6c290"
2020-02-21T02:27:30.400Z INF/provider 46347 [*] Gracefully killing device worker "S2D0219122003818"
2020-02-21T02:27:30.401Z WRN/db 46345 [proc002] Connection closed
2020-02-21T02:27:30.401Z INF/util:lifecycle 46352 [*] Winding down for graceful exit
2020-02-21T02:27:30.401Z WRN/db 46344 [proc001] Connection closed
2020-02-21T02:27:30.401Z WRN/db 46346 [reaper001] Connection closed
2020-02-21T02:27:30.400Z INF/util:lifecycle 46351 [*] Winding down for graceful exit
2020-02-21T02:27:30.406Z INF/provider 46347 [*] Gracefully killing device worker "c6d6c290"
2020-02-21T02:27:30.407Z WRN/db 46348 [*] Connection closed
2020-02-21T02:27:30.407Z WRN/db 46349 [*] Connection closed
2020-02-21T02:27:30.408Z WRN/db 46350 [*] Connection closed
2020-02-21T02:27:30.409Z INF/util:lifecycle 46357 [S2D0219122003818] Winding down for graceful exit
2020-02-21T02:27:30.409Z INF/util:lifecycle 46358 [c6d6c290] Winding down for graceful exit
2020-02-21T02:27:30.410Z INF/device:plugins:screen:stream 46357 [S2D0219122003818] Requesting frame producer to stop
2020-02-21T02:27:30.410Z INF/device:plugins:screen:stream 46358 [c6d6c290] Requesting frame producer to stop
2020-02-21T02:27:30.410Z WRN/db 46352 [*] Connection closed
2020-02-21T02:27:30.410Z INF/device:plugins:screen:stream 46358 [c6d6c290] Disconnecting from minicap service
2020-02-21T02:27:30.411Z IMP/device:plugins:group 46357 [S2D0219122003818] No longer owned by "11@dasd.asda"
2020-02-21T02:27:30.411Z INF/device:plugins:group 46357 [S2D0219122003818] Unsubscribing from group channel "rLmPhuGkQImAM8+svnM1wg=="
2020-02-21T02:27:30.411Z INF/device:plugins:screen:stream 46358 [c6d6c290] Requesting frame producer to stop
2020-02-21T02:27:30.413Z IMP/device:plugins:group 46358 [c6d6c290] No longer owned by "11@dasd.asda"
2020-02-21T02:27:30.414Z INF/device:plugins:group 46358 [c6d6c290] Unsubscribing from group channel "rLmPhuGkQImAM8+svnM1wg=="
2020-02-21T02:27:30.417Z WRN/db 46351 [*] Connection closed
2020-02-21T02:27:30.429Z INF/provider 46347 [*] Device worker "S2D0219122003818" has retired
2020-02-21T02:27:30.429Z INF/provider 46347 [*] Device worker "c6d6c290" has retired

Does it only happen on a specific device? Please run adb devices -l and paste the corresponding row. It happens on all the devices I have. here's info of adb devieces -l

List of devices attached
S2D0219122003818       device usb:338952192X product:LYA-AL00L model:LYA_AL00 device:HWLYA transport_id:6
c6d6c290               device usb:338755584X product:PD1728 model:vivo_X21A device:PD1728 transport_id:5

Please run stf doctor and paste the output here.

2020-02-21T03:11:46.910Z INF/cli:doctor 47263 [*] OS Arch: x64
2020-02-21T03:11:46.911Z INF/cli:doctor 47263 [*] OS Platform: darwin
2020-02-21T03:11:46.912Z INF/cli:doctor 47263 [*] OS Platform: 18.6.0
2020-02-21T03:11:46.912Z INF/cli:doctor 47263 [*] Using Node 8.14.0
2020-02-21T03:11:46.922Z INF/cli:doctor 47263 [*] Using ZeroMQ 4.3.2
2020-02-21T03:11:46.930Z INF/cli:doctor 47263 [*] Using ADB 1.0.41
2020-02-21T03:11:46.931Z INF/cli:doctor 47263 [*] Using GraphicsMagick 1.3.34
2020-02-21T03:11:46.938Z INF/cli:doctor 47263 [*] Using ProtoBuf 3.11.4
2020-02-21T03:11:46.943Z INF/cli:doctor 47263 [*] Using RethinkDB 2.4.0
KevinChann commented 4 years ago

Dup to #318 and #1126, but I see no solution.

koral-- commented 4 years ago

OK, let's use this ticket for tracking because it has more readable logs.