Tecent cloudbase can't connect to ropsten.infura.io

I ran my code on Tecent cloudbase, a serverless product, with web3.js; however, the system reported an error as follows:

Error: errCode: -404011 cloud function execution error | errMsg: cloud.callFunction:fail requestID a142ec57-9425-11ea-b49a-525400e7bfe4, cloud function service error code -504002, error message CONNECTION ERROR: Couldn't connect to node https://ropsten.infura.io/{xxxxx}.
Error: CONNECTION ERROR: Couldn't connect to node https://ropsten.infura.io/{xxxxx}.
    at Object.InvalidConnection (:28106/var/user/node_modules/web3/lib/web3/errors.js:31)
    at HttpProvider.send (:28106/var/user/node_modules/web3/lib/web3/httpprovider.js:94)
    at RequestManager.send (:28106/var/user/node_modules/web3/lib/web3/requestmanager.js:58)
    at Eth.send [as getTransactionCount] (:28106/var/user/node_modules/web3/lib/web3/method.js:145)
    at DataBase.getNonce (:28106/var/user/Database.js:25)
    at EventHandler.exports.main [as realHandler] (:28106/var/user/index.js:12)
    at EventHandler.handle (:28106/var/runtime/node8/bootstrap.js:402)
    at invoke (:28106/var/runtime/node8/bootstrap.js:205)
    at Timeout.setTimeout [as _onTimeout] (:28106/var/runtime/node8/bootstrap.js:137)
    at ontimeout (:28106/appservice/timers.js:475); at cloud.callFunction api; 
    at new u (WAService.js:1)
    at d (WAService.js:1)
    at f (WAService.js:1)
    at Function.success (WAService.js:1)
    at WAService.js:1
    at C (WAService.js:1)
    at i.<anonymous> (WAService.js:1)
    at i.emit (WAService.js:1)
    at Rs (WAService.js:1)
    at WAService.js:1

The environment config are:
image

Hi @yenche123 sorry to hear you’re having issues connecting from Tencent cloudbase. Could you include the code that is generating the request so we can help you investigate?

1 Like

Tks!! The code in Tencent cloudbase is required to be asynchronous. I add a callback function as a parameter, and then it run successfully like this~

Thank for your concern again~~!!

1 Like

That’s great news, so everything is working the way you need it?