[DigitalPoint] App for Cloudflare®

[DigitalPoint] App for Cloudflare® 1.8.2

No permission to download
Any idea why I’m not seeing the one click buttons to fight spam registration?

Disregard - It wouldnt show on mobile but does show on my laptop
 

Attachments

  • IMG_5917.webp
    IMG_5917.webp
    76.2 KB · Views: 10
Last edited:
Oops, you're right... I was looking at the wrong set of code on my end.

That being said, I haven't been able to replicate it on my end. If it's not happening 100% of the time for you, I'd guess it's some sort of network connectivity issue between your server and Cloudflare (where sometimes an API request works and sometimes it doesn't). If it's happening 100% of the time, double check your API token permissions. More specifically, if there's an issue with the API results and it doesn't return something expected (for example if it doesn't get back JSON and an exception happens while fetching and decoding the JSON, it will default to the results simply being a boolean value of false). Which will later trigger the error you see.

I don't see anything on the Cloudflare status page that would make me think they are having any issues with their API currently.
Is there anything else that I can try? Here is what I have done so far:
  • Re-rolled API secret key in Cloudflare and changed.
  • Went through each setting to make sure properties are set to read/edit correctly.
  • Contacted host, they don't see anything that would be preventing connection, then even changed a DNS thing on their end. Same results.
  • It seems to happen only on the 'Settings' tab, all the rest of the tabs don't error out.
  • It doesn't happen all the time, only sometimes, but when it does it just gives me the error over and over when I click the settings tab.
  • I even re-built addon.
Just thought I would see if there were anything else that I could check?
 
Is there anything else that I can try? Here is what I have done so far:
  • Re-rolled API secret key in Cloudflare and changed.
  • Went through each setting to make sure properties are set to read/edit correctly.
  • Contacted host, they don't see anything that would be preventing connection, then even changed a DNS thing on their end. Same results.
  • It seems to happen only on the 'Settings' tab, all the rest of the tabs don't error out.
  • It doesn't happen all the time, only sometimes, but when it does it just gives me the error over and over when I click the settings tab.
  • I even re-built addon.
Just thought I would see if there were anything else that I could check?
If it ever works, it’s not an API issue or an issue with the addon needing to be rebuilt, it’s a connectivity issue with the server. Maybe it’s a concurrency issue with the server (the Settings page is unique compared to other pages for the following reasons):
  • 13 underlying API request are run in parallel to get all the info needed to build that page.
  • Normally API requests will retry once if they fail for any reason), but there is no automatic retry mechanism here because they are all running in parallel.
My guess is your server is getting connectivity errors once in awhile, but that page having 13 requests and then not doing a retry on those gives you an exponentially higher probability of any single one intermittently failing and causing the page to not work.

For example, say your server was failing 10% of the time on the API requests, normally that would cause an overall 1% failure rate because the 10% of the time it failed, it would try again and fail 10% of that time 10% of 10% = 1%.

Take the same failure rate of 10% and multiply that by 13 (concurrent requests), and throw in no retry mechanism when one does fail, and you are looking at a 75% chance that at least one request will fail and cause the Settings page to not work.

TL;DR: if your server has a “minor” connectivity issue, it will be a lot more noticeable on the Settings page because of how that page works.
 
If it ever works, it’s not an API issue or an issue with the addon needing to be rebuilt, it’s a connectivity issue with the server. Maybe it’s a concurrency issue with the server (the Settings page is unique compared to other pages for the following reasons):
  • 13 underlying API request are run in parallel to get all the info needed to build that page.
  • Normally API requests will retry once if they fail for any reason), but there is no automatic retry mechanism here because they are all running in parallel.
My guess is your server is getting connectivity errors once in awhile, but that page having 13 requests and then not doing a retry on those gives you an exponentially higher probability of any single one intermittently failing and causing the page to not work.

For example, say your server was failing 10% of the time on the API requests, normally that would cause an overall 1% failure rate because the 10% of the time it failed, it would try again and fail 10% of that time 10% of 10% = 1%.

Take the same failure rate of 10% and multiply that by 13 (concurrent requests), and throw in no retry mechanism when one does fail, and you are looking at a 75% chance that at least one request will fail and cause the Settings page to not work.

TL;DR: if your server has a “minor” connectivity issue, it will be a lot more noticeable on the Settings page because of how that page works.
Ok thanks, I will just monitor it and hopefully it will fix itself in the future. 😁
 
Ok thanks, I will just monitor it and hopefully it will fix itself in the future. 😁
If you want to add a little debugging code to help, go into the DigitalPoint\Cloudflare\Traits\XF.php file and replace this:
PHP:
$promise = false;

with this:
PHP:
$promise = false;
\XF::logError($e->getCode() . ': ' . $e->getMessage());

That should at least log the underlying error code to your XenForo server log when a parallel request fails.
 
Any idea why I’m not seeing the one click buttons to fight spam registration?

Disregard - It wouldnt show on mobile but does show on my laptop
It should be no different on mobile. I just checked and it shows for me on mobile (the clutter of buttons were consolidated into a "Rules" dropdown since that screenshot, but it shows for me on both mobile and desktop.
 
Is there a way to run something in the database or maybe a different solution to scan all the missing files between R2 and whatever there are present in the forum itself?

every now and then I get these errors:
Code:
League\Flysystem\FileNotFoundException: File not found at path: attachments/158/158041-7c085684ab38d2fa13cf1421af95b2d4.data src/addons/DigitalPoint/Cloudflare/League/Flysystem/Adapter/R2.php:132

I think it's a mismatch between the following ex-popular add-on and synching data to R2 Cloudflare:

I just search manually these mismatches in the databases and remove them, but they are endless
 
Last edited:
Wouldn’t be too hard, but I’m not sure if something exists to do it. What you are looking for is just something that goes through your attachments and sees if they exist in the abstracted file system. It’s not really a Cloudflare thing, it’s a general attachment thing (would work regardless if someone was using Cloudflare/R2 or not).

Probably not really an appropriate place to start putting in generic attachment management tools that don’t have have anything to do with Cloudflare/R2 in this addon though.
 
Well checking the abstracted filesystem is going to be more universal (would also be less coding than trying to do it specifically for R2). Just check if the file exists in the abstracted filesystem, and the abstracted filesystem handles the backend stuff.. if it’s in R2, it will check that, if it’s in S3, it will check that, if it’s in the local filesystem, that will be checked, etc…

Just makes more sense to just check if the attachment data exists via abstracted filesystem (that’s the whole point of the abstracted filesystem… so you don’t need to worry about where it actually might be).
 
For everyone using the R2 feature, what's your file backup routine?

I see at the moment CloudFlare doesn't support versioning which is a real shame :(
 
Backing up to Amazon S3 bucket (one initial backup and then new files only).
And that can have a deleted files retention policy?

Just had a little read, are you using Amazon DataSync?

I'm think a wasabi backup might be a cheap solution (with versioning as well)if there is an easy way to sync the two.
 
Last edited:
For everyone using the R2 feature, what's your file backup routine?

I see at the moment CloudFlare doesn't support versioning which is a real shame :(
For me, I don’t have a XenForo based site where an accidental deletion of something (as in user error) is worth the time/effort to restore it from backup. I’ve never once had a user message me asking if I can restore a backup of the avatar they accidentally deleted or something (and if I ever did, the answer would be no).

I did daily backups when the stuff was on my servers (even though everything existed on at least 4 different physical servers). However, I’m not doing a backup of the R2 stuff myself. Every site is different of course, but for me, attachments and avatars aren’t worth the time/effort to protect against a user deleting something and then changing their mind later. For non-user error data loss, this is good enough for my purposes:


The core of what makes Object Storage great is reliability — we designed R2 for data durability and resilience at its core. R2 will provide 99.999999999% (eleven 9’s) of annual durability, which describes the likelihood of data loss. If you store 1,000,000 objects on R2, you can expect to lose one once every 100,000 years — the same level of durability as other major providers. R2 will be resistant to regional failures, replicating objects multiple times for high availability.
 
@digitalpoint I switched my site to Xenforo Cloud and now all of my "R2 for /data/" bucket attachments are broken. How do I fix this?

For example... this article has broken images...

There shouldn't be anything preventing you from using Cloudflare R2 in XF Cloud if that's what you are asking (you obviously have to have the Cloudflare addon installed of course).

Have you checked your error log?
 
There shouldn't be anything preventing you from using Cloudflare R2 in XF Cloud if that's what you are asking (you obviously have to have the Cloudflare addon installed of course).

Have you checked your error log?

Ok... I got it figured out... I had to enable the "token auth".
 
Top Bottom