收藏
回答

wx.uploadFile在某些ios情况上传失败,有error

框架类型 问题类型 API/组件名称 终端类型 微信版本 基础库版本
小程序 Bug wx.uploadFile 微信iOS客户端 8.0.24 2.24.7

"errno":600005,"errMsg":"uploadFile:fail file path invalid"

因为我们在后台打了实时日志,发现请求没有成功,catch捕获了异常,异常信息如上,同样的代码,其余人都可以上传成功,请问下是什么原因,请问报错的原因是什么呢



代码和log如下

// 这是上传图片的方法

  BFXJCTEMPuploadImage: function () {

    let mustCheckVisitData = this.data.visitProcess.getModuleSaveData(visitConfig.visitProcessStep.BFXJC);

    let _processData = this.data.visitProcess.getVisitProcessState(visitConfig.visitProcessStep.BFXJC);

    let imgListPath = _processData['imgList'|| []

    logger.info('imgListPath', imgListPath);

    //已经走到了这里 这里显示的是日志是

    // [10:02:39]  imgListPath [{"key":"wxfile://tmp_65d9ea6f75871aab42a70fc4eb211ea8.jpg","materielCheckCd":"634123100000064128748720220705091657","imageName":"634123100000064128748720220705091657_00.jpg","upLoadFinish":"4"},{"key":"wxfile://tmp_4217c15f8a01eb1615df81f78d220589.jpg","materielCheckCd":"634123100000065128748720220705091657","imageName":"634123100000065128748720220705091657_00.jpg","upLoadFinish":"4"},{"key":"wxfile://tmp_bb1bf37c3cc89f51af5b930837c512a8.jpg","materielCheckCd":"634123100000065128748720220705091657","imageName":"634123100000065128748720220705091657_01.jpg","upLoadFinish":"4"}]

    if (imgListPath && imgListPath.length > 0{

      for (let k = 0; k < imgListPath.length; k++{

        let txnKey = imgListPath[k].txnKey

        let uploadStatus = imgListPath[k].upLoadFinish

        let picRow = imgListPath[k].picRow

        let picCol = imgListPath[k].picCol

        if (visitConfig.visitProcessUploadStatus.uploaded != uploadStatus{

          let _keyId = imgListPath[k].key

          const postImage = request.uploadNew(_keyId, config.api.uploadMslCompImage, {

            fileTypeCd: "VISIT_MSLCOMP_IMAGE",

            txnKey: txnKey,

            mslCompCd: "",

            picRow: picRow,

            picCol: picCol

          });

          //请求中出现报错  

          postImage.then(result => {

            logger.info('必分销图片上传成功。。', result);

            this.updateVisitProcessStepImgState(visitConfig.visitProcessStep.BFXJC, _keyId, visitConfig.visitProcessUploadStatus.uploaded);

          }).catch((mslI) => {

            logger.error('必分销上传图片失败回调', mslI);


            //这里的log是[10:02:39]  必分销上传图片失败回调 {"errno":600005,"errMsg":"uploadFile:fail file path invalid"}

            this.updateVisitProcessStepImgState(visitConfig.visitProcessStep.BFXJC, _keyId, visitConfig.visitProcessUploadStatus.error);

          });

        }

      }

    }

  },


请帮忙尽快修复或给出解决方案,这样现在会导致我们每天都在不定时不定人的情况出现这种error,谢谢

回答关注问题邀请回答
收藏

5 个回答

  • 社区技术运营专员--许涛
    社区技术运营专员--许涛
    2022-07-05

    你好,这个错误提示就是传入的资源路径不对,查一下资源到底在不在?

    2022-07-05
    有用
    回复 8
    • y~
      y~
      2022-07-06
      微信号 13984824123 小程序报错时间点:[16:19:16] 进店签到上传图片失败回调 {"errno":600005,"errMsg":"uploadFile:fail file path invalid"}




      [16:18:22] 进店签到上传图片失败回调 {"errno":600005,"errMsg":"uploadFile:fail file path invalid"}




      [16:17:08] 进店签到上传图片失败回调 {"errno":600005,"errMsg":"uploadFile:fail file path invalid"}




      [16:16:08] 进店签到上传图片失败回调 {"errno":600005,"errMsg":"uploadFile:fail file path invalid"}
      2022-07-06
      回复
    • y~
      y~
      2022-07-06
      日志已经上传
      2022-07-06
      回复
    • y~
      y~
      2022-07-06
      imgListPath [{"key":"wxfile://tmp_bd13c5f0c9d3605bd7c2e419a644b642.jpg","aiResult":{"log_id":"8228286528148231205","results":[{"score":0.804536759853363,"location":{"width":150,"top":595,"left":629,"height":387},"sku_code":"SS0702008","name":"味事达-酱油_特级金标生抽_500ML"},{"score":0.7748560905456543,"location":{"width":324,"top":632,"left":940,"height":365},"sku_code":"SS0101008","name":"味事达-酱油_味极鲜_1dot6L"},{"score":0.7320888042449951,"location":{"width":151,"top":645,"left":173,"height":317},"sku_code":"WS0201007","name":"HENIZ_番茄沙司-袋_120g"},{"score":0.6365811824798584,"location":{"width":120,"top":579,"left":473,"height":416},"sku_code":"OC0201001","name":"味事达-酱料_味极鲜蚝油_510g"},{"score":0.6346226930618286,"location":{"width":127,"top":582,"left":337,"height":398},"sku_code":"OC0201001","name":"味事达-酱料_味极鲜蚝油_510g"},{"score":0.5408678650856018,"location":{"width":153,"top":665,"left":785,"height":311},"sku_code":"SS0101006","name":"味事达-酱油_味极鲜_760ML"}],"error_code":null,"error_msg":null},"txnKey":"MSCKHC63412320220705161330002024","upLoadFinish":"2"}]   




      后台体质可以看到 图片路径是wxfile://tmp_bd13c5f0c9d3605bd7c2e419a644b642.jpg




      而且这种情况目前看来不是所有人 是偶发性的个别手机性的问题,请帮忙抓取用日志 查看具体问题 帮忙分析下
      2022-07-06
      回复
    • jpwu
      jpwu
      2022-07-14
      这个问题解决了吗?我这边也发现类似的问题
      2022-07-14
      1
      回复
    • y~
      y~
      2022-07-15回复jpwu
      没有 根本没人回复
      2022-07-15
      回复
    查看更多(3)
  • 张少良
    张少良
    08-01

    都24年了,这问题还没有解决方案吗???????

    08-01
    有用
    回复
  • lindow
    lindow
    2023-07-18

    还没有解决,我这边也复现了

    2023-07-18
    有用
    回复
  • 荟
    2023-07-07

    同样的问题

    2023-07-07
    有用
    回复
  • 堃
    2022-11-22

    现在解决了吗

    2022-11-22
    有用
    回复
登录 后发表内容