Issue with Cloudflare Domain Installation
-
Hi @joseph,
Yes, the cloudrontestdns record is still visible in the Cloudflare dashboard. The issue occurs after this record is added, and the process fails immediately afterward.
Here are the current details of the record in the domain's DNS settings:
Type: A Name: cloudrontestdns Content: 127.0.0.1 (local IP) Proxy Status: DNS only TTL: 2 minutes
Please let me know if you need any further details or steps to troubleshoot this.
Thank you!
@ivan-petro Can you try this curl command
curl -vX DELETE -H 'Authorization: Bearer yourtoken' https://api.cloudflare.com/client/v4/zones/ZONE_ID/dns_records/9c9e0a4db92748e2dfb0fada09e574fc
You have to fill in
yourtoken
with the Cloudflare token.You have to fill in
ZONE_ID
. Maybe this is visible somewhere in Cloudflare UI.9c9e0a4db92748e2dfb0fada09e574fc is the record id (from the log file you posted). No need to change this.
-
Hi @joseph,
Yes, I tried the manual API call, and the record was successfully deleted. Here is the result:
{ "result": { "id": "9c9e0a4db92748e2dfb0fada09e574fc" }, "success": true, "errors": [], "messages": [] }
Since the manual API call worked without issues, could it be that Cloudron isn't making the correct API request due to my last migration? I'm not entirely sure how it might be connected, but it's worth mentioning.
For reference, my last request was posted here: https://forum.cloudron.io/topic/13166/can-t-start-cloudron-service-after-default-data-directory-migration/7
Currently, all services are functioning properly otherwise.
Please let me know if there are any further steps to resolve this.
-
-
Hi @joseph,
Yes, I tried the manual API call, and the record was successfully deleted. Here is the result:
{ "result": { "id": "9c9e0a4db92748e2dfb0fada09e574fc" }, "success": true, "errors": [], "messages": [] }
Since the manual API call worked without issues, could it be that Cloudron isn't making the correct API request due to my last migration? I'm not entirely sure how it might be connected, but it's worth mentioning.
For reference, my last request was posted here: https://forum.cloudron.io/topic/13166/can-t-start-cloudron-service-after-default-data-directory-migration/7
Currently, all services are functioning properly otherwise.
Please let me know if there are any further steps to resolve this.
@ivan-petro not sure why this fails in code since the equivalent of the curl call is what the code also does. The code works for my cloudflare test domain, so I am trying to think what else is different. When you did the curl call did you happen to check the http response code? It should be 200 (but according to the error it is getting 404)
-
@joseph , may be something wrong with my Cloudlfare account. Can you give me all API requests that Cloudron did when setup new domain with Cloudflare?
I will check it manually. -
@ivan-petro Per your logs, all the operations succeeded. Only the delete didn't work. The code essentially makes the same call as the curl I posted. It's not clear to me why the curl can work but Cloudron cannot. This issue is always reproducible or was it temporary? If it's always reprooducible, can you drop us a mail to support@cloudron.io . We can debug this further .
-
@ivan-petro @sarkriss we found the problem. Cloudflare has recently removed a field from their response! They used to have a zone_id field in the list records API. This field has been removed. This field named
zone_id
is not in the latest docs - https://developers.cloudflare.com/api/resources/dns/subresources/records/methods/list/#(params) default > (param) comment > (schema) . But it was there back when we wrote the code (almost 6-8 years ago): -
The fix is like this:
- Edit
/home/yellowtent/box/src/dns/cloudflare.js
- Locate the line
const zoneId = result[0].zone_id;
- Replace the above line with
const zoneId = zone.id;
systemctl restart box
We will make a new patch release next week with this change.
- Edit
-
The fix is like this:
- Edit
/home/yellowtent/box/src/dns/cloudflare.js
- Locate the line
const zoneId = result[0].zone_id;
- Replace the above line with
const zoneId = zone.id;
systemctl restart box
We will make a new patch release next week with this change.
- Edit
-
Hi @girish,
Thank you for the support! Your solution worked perfectly, and now the domain is successfully added to Cloudron.
I'll be waiting for the patch release. Should I revert the manual change in the /home/yellowtent/box/src/dns/cloudflare.js file before updating Cloudron with the patch, or will it be handled automatically during the update?
Thanks again for your help!
-
-
Hi @girish,
Thank you for the support! Your solution worked perfectly, and now the domain is successfully added to Cloudron.
I'll be waiting for the patch release. Should I revert the manual change in the /home/yellowtent/box/src/dns/cloudflare.js file before updating Cloudron with the patch, or will it be handled automatically during the update?
Thanks again for your help!