oceanprotocol/provider

`GRAPHQL` and `SMART CONTRACT` fail in multiple places

Closed this issue · 10 comments

Describe the bug
When trying to initialized GRAPHQL and SMART CONTRACT storages, it fails as follow:

GraphQL:
https://v4.provider.mumbai.oceanprotocol.com/api/services/initialize?documentId=did:op:9c935a4ccdec9825132cd68640b9fc6272528c3e1dbd313564596e927e584311&serviceId=ac88d0b03675aa94fc7600d47ed1b7c069619322e95b7d011aa51a70fff591b0&fileIndex=0&consumerAddress=0xC50ce98B13Aa9782cAc4aF6809007B2b035E599e

Response:
{
"error": "Error: Asset URL not found, not available or invalid. Payload was: ImmutableMultiDict([('documentId', 'did:op:9c935a4ccdec9825132cd68640b9fc6272528c3e1dbd313564596e927e584311'), ('serviceId', 'ac88d0b03675aa94fc7600d47ed1b7c069619322e95b7d011aa51a70fff591b0'), ('fileIndex', '0'), ('consumerAddress', '0xC50ce98B13Aa9782cAc4aF6809007B2b035E599e')])"
}

SmartContract:
https://v4.provider.mumbai.oceanprotocol.com/api/services/initialize?documentId=did:op:df506371f7c54b0470c6da322387181777df01809733463a5f269b19551917da&serviceId=703db57ae224dc43365707cf76f4f77440a3ecbc1da04238fbc0f126a2f57c74&fileIndex=0&consumerAddress=0xC50ce98B13Aa9782cAc4aF6809007B2b035E599e

Response:
{
"error": "malformed file object."
}


Another issues that I'm having is on the response of fileinfo

GraphQL:
https://v4.provider.mumbai.oceanprotocol.com/api/services/fileinfo

Payload:
{ "did": "did:op:9c935a4ccdec9825132cd68640b9fc6272528c3e1dbd313564596e927e584311", "serviceId": "ac88d0b03675aa94fc7600d47ed1b7c069619322e95b7d011aa51a70fff591b0", "checksum": false }

Response:
[ { "index": 0, "type": "graphql", "valid": false } ]

On my end (market) it's always valid false without any additional information.

SMART CONTRACT:
https://v4.provider.mumbai.oceanprotocol.com/api/services/fileinfo
Payload:
{
"did": "did:op:df506371f7c54b0470c6da322387181777df01809733463a5f269b19551917da",
"serviceId": "703db57ae224dc43365707cf76f4f77440a3ecbc1da04238fbc0f126a2f57c74",
"checksum": false
}

Contract Mumbai: "0x564955E9d25B49afE5Abd66966Ab4Bc9Ad55Fedb"

File object:
Screenshot 2022-12-22 at 06 21 43
tried also with abi as object

Response:
{
"error": "malformed file object."
}

We check the file's information with checkDidFiles

Looking at some logs:

  1. for https://v4.provider.mumbai.oceanprotocol.com/api/services/initialize?documentId=did:op:9c935a4ccdec9825132cd68640b9fc6272528c3e1dbd313564596e927e584311&serviceId=ac88d0b03675aa94fc7600d47ed1b7c069619322e95b7d011aa51a70fff591b0&fileIndex=0&consumerAddress=0xC50ce98B13Aa9782cAc4aF6809007B2b035E599e
    I have:

2023-01-03 11:07:56 provider-mumbai-58bc97c64b-mm2zt ocean_provider.run[14] INFO incoming request = http, GET, 10.18.11.78, /api/services/initialize?documentId=did:op:bc89075308f152e9801531df851f92f0356e75e96e5af20ad04317ddc992a906&serviceId=053460eef20ac79663028d74ebc78bab003ae0bd9a8f38405989aafe20f62877&fileIndex=0&consumerAddress=0xC50ce98B13Aa9782cAc4aF6809007B2b035E599e
2023-01-03 11:07:56 provider-mumbai-58bc97c64b-mm2zt ocean_provider.routes.consume[14] INFO initialize called. arguments = ImmutableMultiDict([('documentId', 'did:op:bc89075308f152e9801531df851f92f0356e75e96e5af20ad04317ddc992a906'), ('serviceId', '053460eef20ac79663028d74ebc78bab003ae0bd9a8f38405989aafe20f62877'), ('fileIndex', '0'), ('consumerAddress', '0xC50ce98B13Aa9782cAc4aF6809007B2b035E599e')])
2023-01-03 11:07:56 provider-mumbai-58bc97c64b-mm2zt config[14] DEBUG Config: loading config file /ocean-provider/config.ini
2023-01-03 11:07:56 provider-mumbai-58bc97c64b-mm2zt config[14] DEBUG Config: setting environ network = https://polygon-mumbai.infura.io/v3/e823d740755648669f3c9115d26c8fe3
2023-01-03 11:07:56 provider-mumbai-58bc97c64b-mm2zt config[14] DEBUG Config: setting environ aquarius.url = https://v4.aquarius.oceanprotocol.com
2023-01-03 11:07:56 provider-mumbai-58bc97c64b-mm2zt config[14] DEBUG Config: setting environ operator_service.url = https://stagev4.c2d.oceanprotocol.com/
2023-01-03 11:07:56 provider-mumbai-58bc97c64b-mm2zt config[14] DEBUG Config: setting environ allow_non_public_ip = False
2023-01-03 11:07:56 provider-mumbai-58bc97c64b-mm2zt urllib3.connectionpool[14] DEBUG Starting new HTTPS connection (1): v4.aquarius.oceanprotocol.com:443
2023-01-03 11:07:56 provider-mumbai-58bc97c64b-mm2zt urllib3.connectionpool[14] DEBUG https://v4.aquarius.oceanprotocol.com:443 "GET /api/aquarius/assets/ddo/did:op:bc89075308f152e9801531df851f92f0356e75e96e5af20ad04317ddc992a906 HTTP/1.1" 200 3542
2023-01-03 11:07:56 provider-mumbai-58bc97c64b-mm2zt web3.RequestManager[14] DEBUG Making request. Method: eth_call
2023-01-03 11:07:56 provider-mumbai-58bc97c64b-mm2zt web3.providers.HTTPProvider[14] DEBUG Making request HTTP. URI: https://polygon-mumbai.infura.io/v3/e823d740755648669f3c9115d26c8fe3, Method: eth_call
2023-01-03 11:07:56 provider-mumbai-58bc97c64b-mm2zt urllib3.connectionpool[14] DEBUG https://polygon-mumbai.infura.io:443 "POST /v3/e823d740755648669f3c9115d26c8fe3 HTTP/1.1" 200 551
2023-01-03 11:07:56 provider-mumbai-58bc97c64b-mm2zt web3.providers.HTTPProvider[14] DEBUG Getting response HTTP. URI: https://polygon-mumbai.infura.io/v3/e823d740755648669f3c9115d26c8fe3, Method: eth_call, Response: {'jsonrpc': '2.0', 'id': 97, 'result': '0x000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000e000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002c68747470733a2f2f76342e70726f76696465722e6d756d6261692e6f6365616e70726f746f636f6c2e636f6d00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000'}
2023-01-03 11:07:56 provider-mumbai-58bc97c64b-mm2zt ocean_provider.file_types.file_types_factory[14] DEBUG validate_dict passed on {'type': 'graphql', 'index': 0, 'url': 'https://v4.subgraph.mumbai.oceanprotocol.com/subgraphs/name/oceanprotocol/ocean-subgraph', 'method': 'GET', 'userdata': None}

Here, you are missing the query. So something is wrong on publish side
Your object looks like:

{'type': 'graphql', 'index': 0, 'url': 'https://v4.subgraph.mumbai.oceanprotocol.com/subgraphs/name/oceanprotocol/ocean-subgraph', 'method': 'GET', 'userdata': None}
  1. for https://v4.provider.mumbai.oceanprotocol.com/api/services/initialize?documentId=did:op:bc89075308f152e9801531df851f92f0356e75e96e5af20ad04317ddc992a906&serviceId=053460eef20ac79663028d74ebc78bab003ae0bd9a8f38405989aafe20f62877&fileIndex=0&consumerAddress=0xC50ce98B13Aa9782cAc4aF6809007B2b035E599e
    I have
2023-01-03 11:05:15 provider-mumbai-58bc97c64b-mm2zt ocean_provider.run[17] INFO incoming request = http, GET, 10.18.11.78, /api/services/initialize?documentId=did:op:bc89075308f152e9801531df851f92f0356e75e96e5af20ad04317ddc992a906&serviceId=053460eef20ac79663028d74ebc78bab003ae0bd9a8f38405989aafe20f62877&fileIndex=0&consumerAddress=0xC50ce98B13Aa9782cAc4aF6809007B2b035E599e
2023-01-03 11:05:15 provider-mumbai-58bc97c64b-mm2zt ocean_provider.routes.consume[17] INFO initialize called. arguments = ImmutableMultiDict([('documentId', 'did:op:bc89075308f152e9801531df851f92f0356e75e96e5af20ad04317ddc992a906'), ('serviceId', '053460eef20ac79663028d74ebc78bab003ae0bd9a8f38405989aafe20f62877'), ('fileIndex', '0'), ('consumerAddress', '0xC50ce98B13Aa9782cAc4aF6809007B2b035E599e')])
2023-01-03 11:05:15 provider-mumbai-58bc97c64b-mm2zt config[17] DEBUG Config: loading config file /ocean-provider/config.ini
2023-01-03 11:05:15 provider-mumbai-58bc97c64b-mm2zt config[17] DEBUG Config: setting environ network = https://polygon-mumbai.infura.io/v3/e823d740755648669f3c9115d26c8fe3
2023-01-03 11:05:15 provider-mumbai-58bc97c64b-mm2zt config[17] DEBUG Config: setting environ aquarius.url = https://v4.aquarius.oceanprotocol.com
2023-01-03 11:05:15 provider-mumbai-58bc97c64b-mm2zt config[17] DEBUG Config: setting environ operator_service.url = https://stagev4.c2d.oceanprotocol.com/
2023-01-03 11:05:15 provider-mumbai-58bc97c64b-mm2zt config[17] DEBUG Config: setting environ allow_non_public_ip = False
2023-01-03 11:05:15 provider-mumbai-58bc97c64b-mm2zt urllib3.connectionpool[17] DEBUG Starting new HTTPS connection (1): v4.aquarius.oceanprotocol.com:443
2023-01-03 11:05:15 provider-mumbai-58bc97c64b-mm2zt urllib3.connectionpool[17] DEBUG https://v4.aquarius.oceanprotocol.com:443 "GET /api/aquarius/assets/ddo/did:op:bc89075308f152e9801531df851f92f0356e75e96e5af20ad04317ddc992a906 HTTP/1.1" 200 3542
2023-01-03 11:05:15 provider-mumbai-58bc97c64b-mm2zt web3.RequestManager[17] DEBUG Making request. Method: eth_call
2023-01-03 11:05:15 provider-mumbai-58bc97c64b-mm2zt web3.providers.HTTPProvider[17] DEBUG Making request HTTP. URI: https://polygon-mumbai.infura.io/v3/e823d740755648669f3c9115d26c8fe3, Method: eth_call
2023-01-03 11:05:15 provider-mumbai-58bc97c64b-mm2zt urllib3.connectionpool[17] DEBUG https://polygon-mumbai.infura.io:443 "POST /v3/e823d740755648669f3c9115d26c8fe3 HTTP/1.1" 200 551
2023-01-03 11:05:15 provider-mumbai-58bc97c64b-mm2zt web3.providers.HTTPProvider[17] DEBUG Getting response HTTP. URI: https://polygon-mumbai.infura.io/v3/e823d740755648669f3c9115d26c8fe3, Method: eth_call, Response: {'jsonrpc': '2.0', 'id': 26, 'result': '0x000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000e000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002c68747470733a2f2f76342e70726f76696465722e6d756d6261692e6f6365616e70726f746f636f6c2e636f6d00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000'}
2023-01-03 11:05:15 provider-mumbai-58bc97c64b-mm2zt ocean_provider.file_types.file_types_factory[17] DEBUG validate_dict passed on {'type': 'graphql', 'index': 0, 'url': 'https://v4.subgraph.mumbai.oceanprotocol.com/subgraphs/name/oceanprotocol/ocean-subgraph', 'method': 'GET', 'userdata': None}

This looks like a subgraph query, and not as on-chain data

{'type': 'graphql', 'index': 0, 'url': 'https://v4.subgraph.mumbai.oceanprotocol.com/subgraphs/name/oceanprotocol/ocean-subgraph', 'method': 'GET', 'userdata': None}

This looks like a subgraph query, and not as on-chain data

Probably I got consused here. I've corrected the description, can you check again. Now I'm sure it's an SM file.

Here, you are missing the query. So something is wrong on publish side

I'll double check because on publish it all goes through (without query I can't validate the field in order to be able to publish), but the problem is on the asset details page, because we don't seem to have that info on the assets details or it's not required when viewing the file. Let me double check.

So, when we're in asset details page we call this function that doesn't required any parameters besides asset id, service id, and provider url. This must be the issue. Maybe I can decrypt the file to get that info to then pass it to the function, but it feels hacky.

2023-01-03 12:01:28 provider-mumbai-58bc97c64b-fng6d ocean_provider.run[13] INFO incoming request = http, GET, 10.18.11.78, /api/services/initialize?documentId=did:op:df506371f7c54b0470c6da322387181777df01809733463a5f269b19551917da&serviceId=703db57ae224dc43365707cf76f4f77440a3ecbc1da04238fbc0f126a2f57c74&fileIndex=0&consumerAddress=0xC50ce98B13Aa9782cAc4aF6809007B2b035E599e

2023-01-03 12:01:28 provider-mumbai-58bc97c64b-fng6d ocean_provider.file_types.file_types_factory[13] DEBUG malformed file object {'chainId': 80001, 'type': 'smartcontract', 'address': '0x564955E9d25B49afE5Abd66966Ab4Bc9Ad55Fedb', 'abi': '{\n\t\t\t"inputs": [],\n\t\t\t"name": "swapOceanFee",\n\t\t\t"outputs": [{"internalType": "uint256", "name": "", "type": "uint256"}],\n\t\t\t"stateMutability": "view",\n\t\t\t"type": "function"\n\t\t}', 'userdata': None}

I do wonder if those \n and \t could play a role here

I do wonder if those \n and \t could play a role here

I can parse it 👍🏽 not sure it's that because I already tried, but let me double check.

I do wonder if those \n and \t could play a role here

This partially solved it for SM, there's some transformation in between the calls that messed up the final object. But I'm debugging an issue when downloading the file, it failing with no clear error.

just tested both under different conditions.

graphQL storage (see asset) works as expected: Publish, Asset Details, Consume, Edit
smart contract storage (see asset) is not working completely: Publish and Assset Details works, but Consume and Edit are failing with errors:

  • endpoint: https://v4.provider.mumbai.oceanprotocol.com/api/services/download?fileIndex=0&documentId=did:op:33df3b27aa5bc95a3ce1ae0ed5b92a8253989f7c35b987a6c6c2fe85e3a58bce&transferTxId=0xa682ebd824f8e7bd85b34384702103d5c4d90e98d382db4f31317daae97c79bc&serviceId=768d25ea916c5fb186493d016b3c415a415c298a9f12a50319e230c30a68eb07&consumerAddress=0xC50ce98B13Aa9782cAc4aF6809007B2b035E599e&nonce=1672832851274&signature=0x35c3314ca889817afb18060e8fef42fe58db4fa286a065982b41a44fe01d697a0a81855642c39e723cbac814fe2b118dd9a9ab87ab613e88fea805611e42e1ef1b

This seems related to ocean lib, not provider. I see that it's failing here in the market, which is a method from oceanjs here. @bogdanfazakas can you take a quick look at it please? I haven't open an issue yet, but I can do it if needed.

This seems related to ocean lib, not provider. I see that it's failing here in the market, which is a method from oceanjs here. @bogdanfazakas can you take a quick look at it please? I haven't open an issue yet, but I can do it if needed.

sure will take a look

opened an issue on ocean.js and closed this one, as it's not related to provider.