Join the Webstudio community

Updated 5 days ago

CMS Data is seen in preview, but on live site it gives 404

It showed content few weeks ago, but just noticed that it is now 404.

As much as I remember, no extra code was added by me during that time.

Not sure which direction to go from here.
O
A
J
25 comments
we can't tell without further information, if you really didn't change your dev version then there must be an isssue with the response from the backend, you can get the curl from Resource and try execute it yourself and see what happens
Maybe your backend blocks cloudflare's ips or something
mm alright ill try it. What is the best way to do that?
to execut curl? you can copy curl in the resource panel
if it works for you locally though, it still can be that your api server is blocking cloudflare's ips
in that case you need to investigate with your API provider or server provider, whoever is responsible
Gotcha. I tried it in "Run Curl Commands Online" and got 400 bad request:

curl "https://wheat-clam-546093.hostingersite.com/graphql" \
--request post \
--header "Content-Type: application/json" \
--data "{"query":"query Blog($id: ID = \"\") {\n post(id: $id, idType: SLUG) {\n author {\n node {\n lastName\n firstName\n avatar {\n url\n width\n height\n }\n }\n }\n categories {\n nodes {\n name\n }\n }\n content(format: RENDERED)\n date\n featuredImage {\n node {\n altText\n sourceUrl\n mediaDetails {\n height\n width\n }\n }\n }\n title(format: RENDERED)\n }\n}","variables":{"id":"welcome-to-aitoggler"}}"

So i guess i need to check with Hostinger.
yeah thats what threw me off
our backend dev is checking hostinger settings
hostinger - search the chat and the AI helper, I think people already had this issue with them
@Oleg Isonen Update: its not a server issue, it seems to be query issue.
After we changed the query, it started working in "curl command online":
We changed this to that:

Bad request 400:
curl "https://cms.aitoggler.com/graphql" \
--request post \
--header "Content-Type: application/json" \
--data "{"query":"query Blog($id: ID = "") {\n post(id: $id, idType: SLUG) {\n author {\n node {\n lastName\n firstName\n avatar {\n url\n width\n height\n }\n }\n }\n categories {\n nodes {\n name\n }\n }\n content(format: RENDERED)\n date\n featuredImage {\n node {\n altText\n sourceUrl\n mediaDetails {\n height\n width\n }\n }\n }\n title(format: RENDERED)\n }\n}","variables":{"id":"welcome-to-aitoggler"}}"

Fixed:
curl "https://cms.aitoggler.com/graphql" \
-X POST \
-H "Content-Type: application/json" \
-d '{
"query": "query Blog($id: ID!) { post(id: $id, idType: SLUG) { author { node { lastName firstName avatar { url width height } } } categories { nodes { name } } content(format: RENDERED) date featuredImage { node { altText sourceUrl mediaDetails { height width } } } title(format: RENDERED) } }",
"variables": {
"id": "welcome-to-aitoggler"
}
}'
Where do we go from here?
So all clear now?
No, because I only fixed the copied webstudio's "Curl command" code to be working here: https://reqbin.com/curl

but the main live site is still shit. I can't change the command formatting on webstudio or whatever the issue is.

Ask me for any info or access, i'll give it to you. Builder works, live doesnt
You're getting a 403 error access denied. Possibly authentication issue or your host is blocking requests from Cloudflare which I think we've seen on hostinger
Hostinger doesn't seem to show any blockings
we'll try rest api as last resort, im out of ideas
like why would it work a week ago, and now it doesnt
Could you tell me what are the ip addresses? We'll also try to whitelist them
I believe it is this: https://developers.cloudflare.com/fundamentals/reference/http-headers/#cf-connecting-ip-in-worker-subrequests

If it works in the builder and not on the live site, I'm like 80% sure that's the issue
Can't seem to find specific IP addresses there, brother
It's not you. Someone reached out to Hostinger and they said they are blocking it
If you share a link to the builder i can check if there are any other issues, but pretty sure its just them
Gotcha brother, im dming you the link
Add a reply
Sign up and join the conversation on Discord