openstf / stf

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

TPS650: Setup had an error TypeError: Cannot read property 'length' of undefined #804

Closed vagabond1-1983 closed 5 years ago

vagabond1-1983 commented 6 years ago

Hi guys, When I run stf in docker env and try to connect android device in USB mode, I get the error below. Could anyone support this? Thanks a lot.

Device info: MODEL: TPS650 VERSION: 5.1.1 (SDK 22)

error message in output 2018-02-02T07:41:30.564Z FTL/device 12139 [17088013200005] Setup had an error TypeError: Cannot read property 'length' of undefined at devutil.makeIdentity (/app/lib/util/devutil.js:113:28) at solve (/app/lib/units/device/plugins/util/identity.js:15:30) at /app/lib/units/device/plugins/util/identity.js:21:12 at SerialSyrup.ParallelSyrup.invoke (/app/node_modules/stf-syrup/lib/parallel.js:54:24) at /app/node_modules/stf-syrup/lib/serial.js:43:33 at tryCatch1 (/app/node_modules/stf-syrup/node_modules/bluebird/js/main/util.js:63:19) at Promise$_callHandler [as _callHandler] (/app/node_modules/stf-syrup/node_modules/bluebird/js/main/promise.js:708:13) at Promise$_settlePromiseFromHandler [as _settlePromiseFromHandler] (/app/node_modules/stf-syrup/node_modules/bluebird/js/main/promise.js:724:18) at Promise$_settlePromiseAt [as _settlePromiseAt] (/app/node_modules/stf-syrup/node_modules/bluebird/js/main/promise.js:896:14) at Promise$_fulfillPromises [as _fulfillPromises] (/app/node_modules/stf-syrup/node_modules/bluebird/js/main/promise.js:1041:14) at Async$_consumeFunctionBuffer [as _consumeFunctionBuffer] (/app/node_modules/stf-syrup/node_modules/bluebird/js/main/async.js:74:12) at Async$consumeFunctionBuffer (/app/node_modules/stf-syrup/node_modules/bluebird/js/main/async.js:37:14) at _combinedTickCallback (internal/process/next_tick.js:73:7) at process._tickCallback (internal/process/next_tick.js:104:9)

sorccu commented 6 years ago

Run adb shell getprop and paste the full output here.

vagabond1-1983 commented 6 years ago

Thanks @sorccu

[persist.sys.overscan.aux]: [overscan 100,100,100,100] [persist.sys.overscan.main]: [overscan 100,100,100,100]

[ro.build.date]: [Wed Aug 16 12:53:14 HKT 2017] [ro.build.description]: [rk3288-userdebug 5.1.1 LMY49F eng.luorf.20170816.125105 test-keys]

]

sorccu commented 6 years ago

I guess it’s because there’s no SIM card support.

vagabond1-1983 commented 6 years ago

Ok, I see. Thanks for the info.

sorccu commented 6 years ago

Nah we can fix that. But not sure when. Maybe try changing the code yourself?

thinkhy commented 6 years ago

Seems the field 'ro.product.brand' is missing in the output of "adb shell getprop", so the line 113 of devutil.js failed:

 if (model.substr(0, brand.length) === brand) {

@sorccu For this case, can we add a default brand name 'unkown' as below?

 var brand = properties['ro.product.brand']||'unknown'
vagabond1-1983 commented 6 years ago

Thanks @thinkhy @sorccu I will try for your suggestion. Please let me know if you have new patch for the issue.

sorccu commented 6 years ago

@thinkhy I think 'unknown' should be at the presentation layer, not in the actual data that we collect. Anyway since we're not actually storing the brand, I don't think it needs to have a fallback value - perhaps just change:

https://github.com/openstf/stf/blob/2dac3d1bbd1ef1974a1c22a10941c5739711928e/lib/util/devutil.js#L113

Into:

if (brand && model.substr(0, brand.length) === brand) {

That should work. Though this particular device might have other issues as well.

sorccu commented 6 years ago

@vagabond1-1983 maybe now? Try latest master.

vagabond1-1983 commented 6 years ago

That would be great @sorccu . Would you update openstf/stf docker image too? I build stf environment in that way.

thinkhy commented 6 years ago

@sorccu your fix would be better, we don't need to assign a fallback value to brand which will not be presented on web UI.

sorccu commented 5 years ago

I think this was fixed already.

sorccu commented 5 years ago

Nevermind, sorry for the spam. Wrong search term.