REST Endpoints on TigerGraph Cloud Free Tier | Timeout error

Hi,
im testing tigergraph cloud with the free tier service version 3.6.0 on aws right now.

Graphstudio is running fine but i wanted to experiment with the rest endpoints following the following instruction:

but im running into a timeout error. I’ve also tested the /echo and /endpoints?builtin=true endpoints, getting also a timeout error.
Does anyone know if the rest endpoints work on free tier and the 3.6.0 version?

Best Regards
Phan

In the logs ive found the following error

1    Log file created at: 2022/06/21 17:34:27
2    Running on machine: ip-10-41-34-214
3    Log line format: [IWEF]mmdd hh:mm:ss.uuuuuu threadid file:line] msg
4    E0621 17:34:27.643867 10311 sys_utility.cpp:36] |Load Failed|/home/tigergraph/tigergraph/app/3.6.0/bin///TokenBank.so_RESTPP_1_1_w0.dir/1655832867643|/home/tigergraph/tigergraph/app/3.6.0/bin///TokenBank.so_RESTPP_1_1_w0.dir/1655832867643: cannot open shared object file: No such file or directory
5    E0621 17:36:16.733557 10344 gconfig_general.cpp:337] Graph thegraph failed to get end points. List endpoints files failed. rc:kNotFound
6    E0621 17:36:16.748160 10344 gconfig_general.cpp:337] Graph thegraph failed to get end points. List endpoints files failed. rc:kNotFound
7    E0621 17:36:16.793205 10344 sys_utility.cpp:36] |Load Failed|/home/tigergraph/tigergraph/app/3.6.0/bin///TokenBank.so_RESTPP_1_1_w1.dir/1655832976793|/home/tigergraph/tigergraph/app/3.6.0/bin///TokenBank.so_RESTPP_1_1_w1.dir/1655832976793: cannot open shared object file: No such file or directory
8    E0621 18:17:59.753623 10344 gconfig_general.cpp:337] Graph thegraph failed to get end points. List endpoints files failed. rc:kNotFound
9    E0621 18:17:59.762498 10344 gconfig_general.cpp:337] Graph thegraph failed to get end points. List endpoints files failed. rc:kNotFound
10   E0621 18:17:59.804224 10344 sys_utility.cpp:36] |Load Failed|/home/tigergraph/tigergraph/app/3.6.0/bin///TokenBank.so_RESTPP_1_1_w0.dir/1655835479804|/home/tigergraph/tigergraph/app/3.6.0/bin///TokenBank.so_RESTPP_1_1_w0.dir/1655835479804: cannot open shared object file: No such file or directory

Hi Phan,
Can you share the solution ID for the solution you’re having the problem?

Direct Message sent. Thank you very much

Hey, Phan!

For using the REST endpoints of a TG Cloud 3.6.0 box, you will need to use port 443 and the restpp endpoint. For example, querying the /echo and /endpoints endpoints would look like this:

curl -X GET 'https://tg_subdomain.i.tgcloud.io:443/restpp/echo' -H "Authorization: Bearer REPLACE_TOKEN_HERE"
curl -X GET 'https://tg_subdomain.i.tgcloud.io:443/restpp/endpoints' -H "Authorization: Bearer REPLACE_TOKEN_HERE"

Let me know if this helps!

2 Likes

Hi Shreya,

thanks for the comment, they work. Im wondering tough how the endpoint looks like to request a new bearer token. In the docs the following command is given but doesnt work

curl -X POST https://example.i.tgcloud.io:9000/requesttoken -d '{"secret": "n35lsqofc1if62fld2rmnb9hocqbh8ia", "lifetime": "100000"}'

I’ve tried the following urls:
https://example.i.tgcloud.io:443/requesttoken
https://example.i.tgcloud.io:443/restpp/requesttoken
https://example.i.tgcloud.io/restpp/requesttoken

Getting a “502 Bad Gateway” error, the solution is shown as ready.

Could you also provide me the correct endpoint to request the bearer token, please.

Best Regards
Phan

Sure! I used the endpoint with the username/password pair.

curl --user tg_username:tg_password \            
     -X POST https://tg_host.i.tgcloud.io:443/restpp/requesttoken \
     -d '{"graph": "GraphName"}'

Here’s an example using a secret:

curl -X POST https://tg_host.i.tgcloud.io:443/restpp/requesttoken -d '{"secret": "secret_string", "lifetime": "100000"}'

The middle URL should have worked (at least, it’s working for my solution); could you try using the above commands, and if it still doesn’t work, I’ll ask the team to help diagnose what’s happening.

2 Likes

Another example @Phan :point_down:

curl --location --request POST 'https://example.i.tgcloud.io:443/restpp/requesttoken' \
--header 'Content-Type: application/json' \
--data-raw '{
    "secret": "insertsecretstringhere", 
    "graph": "insertgraphnamehere", 
    "lifetime": "26000000" 
}'
3 Likes

Thanks a lot. It works. For some reason the same requests with postman fail but curl works.

@Phan What error are you getting with Postman? Is it giving you a 505 Bad Gateway? If yes you might have to delete your cookies. I’m currently putting together a new postman collection with every possible endpoint for TigerGraph Cloud (post June 20th port changes). I’ll attach the collection here after I finish it.

1 Like

Hi Jon,

im getting a 505 Bad Gateway error. Ive tried deleting the cookies but i get still the same error.

Great that you’re working on a postman collection. Sounds very useful.

@Phan If you’re free today we can jump in a call on Discord TigerGraph. Just let me know when works for you. I also ran into 505 Bad Gateway as well. I ended up disabling a setting in Postman.

I cleared the cookies by clicking the x on my instance URL.

Then modified the settings by turning on Disable Cookie Jar

@Phan Just finished the collection with 43 REST calls documented

https://www.postman.com/tigergraph-dev/workspace/tigergraph-devs-s-public-workspace/collection/5802704-77f657e8-aeb7-4c5d-9dc1-40ace812f2e9?action=share&creator=10822498

2 Likes