TradeTrust / tradetrust-functions

https://tradetrust-functions.netlify.app
1 stars 8 forks source link

Timeout issue in Netlify #55

Open ictaMRU opened 3 months ago

ictaMRU commented 3 months ago

Hello,

Since last Wednesday, we are unable to issue Documents and in the error-log files, the error is "Network Error".

On our cloned tradetrust-functions repository built and hosted on Netlify, in the storage function logs menu, I can see the following: "ERROR Task timed out after 10.02 seconds".

We never encountered this error before. Was there any recent changes that could explain this issue we are now experiencing?

pohhendry commented 3 months ago

Hi ictaMRU,

Will you be able to share details on how you are issuing the Documents? Like is it done through code that you've integrated? or perhaps it is through CLI? The blockchain network you used, the version of schema?

Do share with us your code snippet (though be careful about sharing sensitive information).

ictaMRU commented 3 months ago

Hello Dryhenhop,

Kindly see the answers to your questions below:-

  1. We are using the TradeTrust document-creator-website repository built as a Web App using Node.js to issue our Documents on our Document Store. We are using the tradetrust-functions repository built and hosted on Netlify to embed a QR Code in our issued Documents. We have used the documentation at https://docs.tradetrust.io/docs/reference/tradetrust-website/qr-code/

We have added the Document Storage property in our TradeTrust Document Creator config file as per the documentation at https://docs.tradetrust.io/docs/reference/document-creator/config-file/#document-storage-property

  1. The Blockchain network we are using is Ethereum mainnet;

  2. We are using the OpenAttestation Schema v2.

Please let us know if you need more information.

Thanks in advance.

isaackps commented 3 months ago

Hi @ictaMRU,

From the looks of it, I would require more information. Possible to provide a screen shot of the error or the error-log file, if possible, also provide a screen recording of your issuance process.

If you are using a document storage, you might also want to check the AWS S3 bucket and the tt-function code that you have deployed, possible to share the github link so we can take a look at the code?

Thanks

ictaMRU commented 3 months ago

Hello isaackps,

Thank you for looking into it.

We would be happy to share all the requested details in a private message. Our GitHub repositories are private and we have just invited you. Please check it.

Grateful if you can tell us how we can proceed.

Thanks in advance.

ictaMRU commented 3 months ago

Hello isaackps,

Any updates? Did you get the invite to connect to our repository?

Thanks in advance.

isaackps commented 3 months ago

Hi @ictaMRU,

So sorry for the late reply, I was away for the past few days.

I didn't receive any invite to connect to any repository. Could you send it again?

Thanks!

ictaMRU commented 3 months ago

Hello isaackps,

We have added you as a collaborator to our tradetrust-functions repository as per screenshot below.

image

Can you check your email please? Maybe the invite was sent by GitHub to your email account.

Thanks in advance.

isaackps commented 3 months ago

Hi @ictaMRU,

Thanks for allowing me access to your repo, but I would still require more information, can you check your Netlify settings too? and can i request for more screenshots and maybe a short video of the error if possible.

Also, which network are you working on? and can check the verification function that you are using, which repo are u getting it from?

Thanks.

ictaMRU commented 3 months ago

Hello isaackps,

Thanks for replying back.

We will be more than happy to give you full access to all the different components of TradeTrust repositories we have cloned and slightly customised. How can we share the login credentials in a private manner please?

Thanks in advance.

ictaMRU commented 3 months ago

Hello isaackps,

Please find below an overview of the details you have requested.

When issuing several Documents at one go on our Document Store (Network: Ethereum mainnet) using the cloned TradeTrust and slightly customised document-creator-website repository which is hosted in-house on our Web Server (https://creator.icta.mu), we are getting the following error screen after about 12-15 seconds:

image

Please find attached in a zip file (compressed file.zip), our config file for the document-creator (creator.config), the csv file (05.06.2024_AL.csv) to pre-fill the fields on the Create Document page of the document-creator website and log file (error-log-2024-06-07T06_35_38.674Z.txt).

compressed.zip

You will notice that in the error-log file, it says: "error": { "message": "Network Error", "name": "Error", "config": { "url": "https://celadon-churros-05516c.netlify.app/.netlify/functions/storage/....", ...

We then went to check our TradeTrust functions hosted on Netlify which is built using the repository (tradetrust-api) that was cloned on 17 July 2023. In the storage function logs menu, we can see the following:

image

We therefore suspect that the problem is with the storage function. The storage function is used to generate a unique URL and put a copy of the wrapped document generated at the time of issuing it on our Document Store (side note: we renamed the extension of the wrapped document created in our cloned TradeTrust and slightly customised Document Creator Website from .oa to .lic.icta) into our Amazon AWS S3 account. This is for our users to be able to quickly view the documents on other devices without the need to again share the wrapped documents by just scanning the QR Code contained in each document from our eVerify page (https://everify.icta.mu/verify), which is hosted in-house on our Web Server. The eVerify page is a cloned and slightly customised version of TradeTrust Web UI (tradetrust-website) repository.

The build settings in our functions site configuration in our Netlify account are standard as per screenshot below:

image

The Node.js version in our functions site configuration is: 18.x as per screenshot below.

image

The Operating System on which Netlify buildbot has built our functions site is: Ubuntu Focal 20.04 (default).

image

Please find screenshot below showing the custom Environment variables that have been defined in the functions site configuration.

image

We remembered that several months ago, we had a similar issue but with a different error message when trying to issue too much Documents at a time and we solved the problem by issuing Documents by batch of 3. This time, issuing Documents by batch of 3 did not work and we had to issue the Documents one by one and got just a few failed attempts.

We will be grateful if you can assist us on the following:

If you need any further additional information, we would be very happy to provide same to you. You can email us on webmaster@icta.mu

Thank you in advance.

isaackps commented 3 months ago

Hi @ictaMRU,

Sorry for the late reply as I was busy with other work.

Upon diving into the issue that you are facing, i realise that I am getting yet another error. I am getting document invalid, as shown in the screenshot below.

Screenshot 2024-06-28 at 4 23 16 PM

Im not too sure what went wrong, but I suspect that the verifier or the infura API key(not sure which service you are using) is the problem here where it could not verify the document properly.

We recently have the same issue and by updating our verifier, and infura API key, we were able to resolve the issue. you can take a look at our version of the TradeTrust-functions -> https://github.com/TradeTrust/tradetrust-functions/blob/master/package.json.

I hope this would help you guys in debugging your issue.

ictaMRU commented 3 months ago

Hello isaackps, Thank you for you time to look into this issue we are facing.

We have just tried to issue Documents and we got the following error messages as per the screenshot below. We use the Homestead network instead of Sepolia.

image

Grateful if you can have a look at it and kindly let us know if this error is familiar to you.

Thanks in advance.

isaackps commented 3 months ago

Hi @ictaMRU,

Understand that you are using homestead network instead of sepolia, but sepolia testnet are meant for testing for homestead network, as it is the mainnet of ethereum.

On that note, just a dumb question, you have enough ethers on homestead, ethereum mainnet, to do the transactions right?

And if possible, can you run on local to make sure that the document is being verified properly as a valid OA document?

Also, can make sure that you are using the correct dnsprove repo?

If you are using OA library, can i suggest that you update them to use TradeTrust library? Because our team are maintaining the TradeTrust libraries. If you would like to get help from OA regarding their library, i'm afraid you will have to get in touch with them through their repositories. Hope you understand this.

Thanks.

ictaMRU commented 2 months ago

Hello isaackps,

Thanks for your reply.

We have cloned and slightly customised the following repositories from TradeTrust namely:

and cloned and customised the Open Attestation decentralized-renderer-react-template to render our documents issued (https://rad-cocada-16861d.netlify.app) - last cloned on 23 Feb 2023.

As per our understanding, you are recommending that we should use TradeTrust decentralized-renderer instead.

Also, while looking at the latest online package.json file in the different repositories so as to know which commands we can use to run the repositories locally as per your suggestion, we noticed that the dependencies are different from those in our currently used repositories. For example, in tradetrust-website repository, there is no longer the following:

and the following dependencies names have changed:

We intend to make a latest clone of the repositories which we are using so as to use the new/updated dependencies and then check if we still have the same problem.

We would be grateful if you can guide us on how to run the repositories on local as per your suggestion:

and more specifically, tradetrust-functions with Netlify Functions together with Amazon S3 running locally on our Web Server instead of on the cloud. This would allow us to isolate the problem we are having.

Thanks in advance.