美文网首页STF
记录一次debug过程

记录一次debug过程

作者: 戈壁堂 | 来源:发表于2020-07-20 17:24 被阅读0次

最终证明这是一个个性化的错误。

上传本地apk进行安装时,进行到50%之后就报错——导致系统推出。

2020-7-20 15:38:02 INF/storage:temp 17950 [*] Uploaded "67a219fbe4ce8e2ab4c1fc5ce60195d3" to "/home/stf/tempSaveDir/upload_a0cfd8e997b752e14aecb2202cb0c1c4"
2020-7-20 15:38:02 INF/websocket 17944 [*] installMsg manifest  undefined
/home/stf/RemoteDeviceNew/node_modules/protobufjs/dist/ProtoBuf.js:2641
                    throw Error("Illegal value for "+this.toString(true)+" of type "+this.type.name+": "+val+" ("+msg+")");
                    ^

Error: Illegal value for Message.Field .InstallMessage.manifest of type string: undefined (not a string)
    at Field.<anonymous> (/home/stf/RemoteDeviceNew/node_modules/protobufjs/dist/ProtoBuf.js:2641:27)
    at Field.ProtoBuf.Reflect.FieldPrototype.verifyValue (/home/stf/RemoteDeviceNew/node_modules/protobufjs/dist/ProtoBuf.js:2721:29)
    at MessagePrototype.set (/home/stf/RemoteDeviceNew/node_modules/protobufjs/dist/ProtoBuf.js:1799:63)
    at new Message (/home/stf/RemoteDeviceNew/node_modules/protobufjs/dist/ProtoBuf.js:1728:42)
    at Socket.<anonymous> (/home/stf/RemoteDeviceNew/lib/units/websocket/index.js:830:15)
    at emitThree (events.js:136:13)
    at Socket.emit (events.js:217:7)
    at /home/stf/RemoteDeviceNew/node_modules/socket.io/lib/socket.js:528:12
    at _combinedTickCallback (internal/process/next_tick.js:132:7)
    at process._tickCallback (internal/process/next_tick.js:181:9)
2020-7-20 15:38:02 FTL/cli:local 17862 [*] Child process had an error ExitError: Exit code "1"
    at ChildProcess.<anonymous> (/home/stf/RemoteDeviceNew/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)

重新加载为数不多的前端知识,先搜索对应的关键字,在对应的位置增加log信息。

lib/units/websocket/index.js830行报错,同时提示.InstallMessage.manifest of type string: undefined。可以推测出没有获取到apk的manifest信息。

// lib/units/websocket/index.js
.on('device.install', function(channel, responseChannel, data) {
          joinChannel(responseChannel)
          push.send([
            channel
          , wireutil.transaction(
              responseChannel
            , new wire.InstallMessage(
                data.href
              , data.launch === true
              , JSON.stringify(data.manifest)
              )
            )
          ])
        })

// wire.proto 
message InstallMessage {
  required string href = 1;
  required bool launch = 2;
  optional string manifest = 3;
}

拿到原始的apk分析后,是正常的文件,可以正常安装。

前端处理上传文件并进行安装的服务为res/app/components/stf/install/install-service.js。进度到50%时,实际上已经将文件上传成功了,然后开始进行安装的动作。通过文件后缀来区分apk和ipa的区别(这块是定制的内容)。看起来是像是通过http强求获取manifest文件内容的?这块先忽略。

看本地上传文件的处理lib/units/storage/temp.js 注意到log内容包含Uploaded "67a219fbe4ce8e2ab4c1fc5ce60195d3" to "/home/stf/tempSaveDir/upload_a0cfd8e997b752e14aecb2202cb0c1c4" 似乎文件名做了处理。

跟踪了一下这个temp.js文件的git历史记录,看起来是同步代码时增加了一部分处理文件的操作——

form.on('fileBegin', function(name, file) {
      var md5 = crypto.createHash('md5')
      file.name = md5.update(file.name).digest('hex')
    })

将这段代码删除后,恢复正常。

相关文章

  • 记录一次debug过程

    最终证明这是一个个性化的错误。 上传本地apk进行安装时,进行到50%之后就报错——导致系统推出。 重新加载为数不...

  • 一次线上Debug过程记录

    背景 我所在项目组是做Wifi数据传输业务的工作,简单来说,公司的wifi设备铺设到各个城市的店铺中,这些设备产生...

  • 记一次Debug过程

    前言 在写实现等高自定义Cell自测项目时,自己导致的数个Bug。因为项目较为简单,所以在实现时特意使用了一些之前...

  • windows+eclipse操作Hbase连接过程中debug

    windows+eclipse操作Hbase连接过程中debug记录(一) 4.java.lang.ClassNo...

  • stf from openstf to DeviceFarmer

    记录一次debug过程看起来是同步代码遇到的问题,顺手查一下STF的最新代码,发现这个仓库已经存档了。 opens...

  • 有趣的一次调试

    果果小姚 [TesterGC](javascript:void(0);) 1周前 记录下今天的debug 测试过程...

  • Debug记录

    排版要求:注意图都是1500*x 未完待续 【1-已解决】Input type (torch.FloatTenso...

  • AllenNLP遇到的一些问题

    在学习过程中Debug的一些问题记录 OSError: Unable to open file 在使用ElmoEm...

  • 【Debug】Pytorch Debug 全记录

    Expected more than 1 value Value error: Expected more tha...

  • 笔记

    IDEA中Debug调试学习笔记 Debug简述 Debug用来追踪代码的运行流程,通常在程序运行过程中出...

网友评论

    本文标题:记录一次debug过程

    本文链接:https://www.haomeiwen.com/subject/dblykktx.html