[DigitalPoint] App for Cloudflare®

[DigitalPoint] App for Cloudflare® 1.8.2

No permission to download
I have no clue what's going on here so I came here for some help, hopefully. I get the following server error on the theme I'm using every time a page loads, it does not come up using the default theme. Any clues?

Code:
#0 [internal function]: XF\Template\Templater->handleTemplateError(512, '[E_USER_WARNING...', '/home/', 1176)
#1 src/XF/Template/Templater.php(1176): trigger_error('Cannot call met...', 512)
#2 internal_data/code_cache/templates/l1/s33/public/PAGE_CONTAINER.php(1755): XF\Template\Templater->method(NULL, 'getMode', Array)
#3 src/XF/Template/Templater.php(1651): XF\Template\Templater->{closure}(Object(DigitalPoint\Cloudflare\XF\Template\Templater), Array, NULL)
#4 src/XF/Pub/App.php(564): XF\Template\Templater->renderTemplate('PAGE_CONTAINER', Array)
#5 src/XF/App.php(2151): XF\Pub\App->renderPageHtml('





    

    




...', Array, Object(XF\Mvc\Reply\View), Object(XF\Mvc\Renderer\Html))
#6 src/XF/Mvc/Dispatcher.php(404): XF\App->renderPage('





    

    




...', Object(XF\Mvc\Reply\View), Object(XF\Mvc\Renderer\Html))
#7 src/XF/Mvc/Dispatcher.php(60): XF\Mvc\Dispatcher->render(Object(XF\Mvc\Reply\View), 'html')
#8 src/XF/App.php(2353): XF\Mvc\Dispatcher->run()
#9 src/XF.php(524): XF\App->run()
#10 index.php(20): XF::runApp('XF\\Pub\\App')
#11 {main}
 
Looks like the style you are using is built for XenForo 2.2.12 and maybe not compatible with an older version of XF that you are presumably using? Specifically the error you are seeing is related to the advanced cookie consent system and the error looks like it can't find the method it's trying to use (which is for that).


Shouldn't anything to do with my addon though. You could disabled the Cloudflare addon, and I bet you see the same problem.
 
Yes, that is my point. You can use rules in lots of ways to block malicious users. hackers, spammers, trolls, etc. However, it would be useful to see which xf members are getting hassled or blocked by these. That visibility would allow us to fine tune the rules instead of being blind to it.

Well the problem is if they are blocked, the request never gets to the application (XenForo), so we don't know who they are (as a user). If they are blocked, it's usually based on IP, so if that user's HTTP requests that use that IP never get logged by XenForo (since the request never made it to XenForo), there's not a way to know which user made the request. You would be limited to using the IP address of the Cloudflare event log, which isn't going to correlate to an IP that existing users used normally because XenForo never saw the request (you aren't able to pull things like cookies from request in the event log).

Cloudflare should eventually have something that can give you insights Network Error Logging (NEL) which they call Cloudflare Edge Reachability insights https://developers.cloudflare.com/network-error-logging/. Still beta/invite for some and for me enabling it doesn't work as I can't see any analytics when I did. So I use report-uri's NEL for now https://report-uri.com/products/network_error_logging which can log when visitors hit 403 and other errors. Usual suspects for me is when requests hit Xenforo member private URLs which log in NEL logs as 403s. But you won't know the exact username, but you'll get their IP address etc :)
 
Last edited:
I'm not sure what i've done wrong but for some reason only the "Settings" page doesnt load and always returns "10000: Authentication error" even though all necessary permissions are set.
all other sub menus work fine.

b2v1.png

any hint what could be the issue?
 
Not at a computer, so I can’t compare what you should have with what you have, but that Zone.Zone: Edit permission shouldn’t be there. Check the list of the permissions you should have with the ones you have. I bet you have that one instead of the intended one.

Zone.Bot Management maybe?
 
Not at a computer, so I can’t compare what you should have with what you have, but that Zone.Zone: Edit permission shouldn’t be there. Check the list of the permissions you should have with the ones you have. I bet you have that one instead of the intended one.

Zone.Bot Management maybe?
oh yeah my bad seems like it selected the wrong one.. appreciate your reply :)
 
Question: Since enabling the guest cache (I believe this to be the cause but cannot fully confirm), users are getting in Edge and Firefox (but not Chrome):

The active user has changed. Reload the page for the latest version.

On the forum index.

I am able to reproduce the issue fairly easily by exiting the browser and reloading the browser.

F5 or Ctrl-F5 seems to resolve the issue until I close the browser and re-open the main page again.

Is there a workaround or fix for this?

Update: Disabling the guest page cache seems to oddly enough resolve the issue. It looks like the forum does not recognize they're logged in until they refresh when it is turned on.

Unfortunately had to turn guest caching off also, as members using Chrome couldn't log in correctly. Would be great if there was a workaround for this...
 
Unfortunately had to turn guest caching off also, as members using Chrome couldn't log in correctly. Would be great if there was a workaround for this...
If you are talking about the thing where a cached page would be returned on a browser restart even if the user was logged in, I did end up figuring out a workaround that's part of the next version.
 
What would cause this all of a sudden?

Code:
ErrorException: Cloudflare: String could not be parsed as XML / null src/XF/Error.php:77
Generated by: mhkemh Jan 23, 2023 at 7:58 PM
Stack trace
#0 src/XF.php(219): XF\Error->logError('Cloudflare: Str...', false)
#1 src/addons/DigitalPoint/Cloudflare/Api.php(941): XF::logError('Cloudflare: Str...')
#2 src/addons/DigitalPoint/Cloudflare/Api.php(775): DigitalPoint\Cloudflare\Api->makeRequest('head', 'attachments/214...', Array, true, 'internal-data')
#3 src/addons/DigitalPoint/Cloudflare/League/Flysystem/Adapter/R2.php(155): DigitalPoint\Cloudflare\Api->headR2Object('internal-data', 'attachments/214...')
#4 src/addons/DigitalPoint/Cloudflare/League/Flysystem/Adapter/R2.php(80): DigitalPoint\Cloudflare\League\Flysystem\Adapter\R2->getMetadata('attachments/214...')
#5 src/vendor/league/flysystem/src/Filesystem.php(57): DigitalPoint\Cloudflare\League\Flysystem\Adapter\R2->has('attachments/214...')
#6 [internal function]: League\Flysystem\Filesystem->has('attachments/214...', Array)
#7 src/vendor/league/flysystem-eventable-filesystem/src/EventableFilesystem.php(431): call_user_func_array('League\\Flysyste...', Array)
#8 src/vendor/league/flysystem-eventable-filesystem/src/EventableFilesystem.php(395): League\Flysystem\EventableFilesystem\EventableFilesystem->callFilesystemMethod('has', Array)
#9 src/vendor/league/flysystem-eventable-filesystem/src/EventableFilesystem.php(128): League\Flysystem\EventableFilesystem\EventableFilesystem->delegateMethodCall('has', Array)
#10 src/vendor/league/flysystem/src/MountManager.php(313): League\Flysystem\EventableFilesystem\EventableFilesystem->has('attachments/214...')
#11 src/XF/Entity/AttachmentData.php(228): League\Flysystem\MountManager->has('attachments/214...')
#12 src/XF/ControllerPlugin/Attachment.php(9): XF\Entity\AttachmentData->isDataAvailable()
#13 src/XF/Pub/Controller/Attachment.php(45): XF\ControllerPlugin\Attachment->displayAttachment(Object(XFMG\XF\Entity\Attachment))
#14 src/XF/Mvc/Dispatcher.php(352): XF\Pub\Controller\Attachment->actionIndex(Object(XF\Mvc\ParameterBag))
#15 src/XF/Mvc/Dispatcher.php(259): XF\Mvc\Dispatcher->dispatchClass('XF:Attachment', 'Index', Object(XF\Mvc\RouteMatch), Object(XF\Pub\Controller\Attachment), NULL)
#16 src/XF/Mvc/Dispatcher.php(115): XF\Mvc\Dispatcher->dispatchFromMatch(Object(XF\Mvc\RouteMatch), Object(XF\Pub\Controller\Attachment), NULL)
#17 src/XF/Mvc/Dispatcher.php(57): XF\Mvc\Dispatcher->dispatchLoop(Object(XF\Mvc\RouteMatch))
#18 src/XF/App.php(2483): XF\Mvc\Dispatcher->run()
#19 src/XF.php(524): XF\App->run()
#20 index.php(20): XF::runApp('XF\\Pub\\App')
#21 {main}
 
From the error, it sounds like R2 returned an invalid response (it should always be XML, never a string). Did it sort itself out or is it ongoing (new errors)?

If it was transient and worked itself out (not getting new errors), it could have been one of many things... most of which have to do with network connectivity. If an Internet network route goes down momentarily, you might see something like that where the HTTP client is returning a message that it can't connect to the IP address or something. It would be more worrisome if it's still happening... but if it was once or twice and then stopped, that's probably just network connectivity of the Internet that is never 100% stable to every IP at all times (routes go down, traffic gets rerouted, etc.) The beauty of the Internet is that there's no single route to things, it's made to fail-over and reroute as necessary (which happens every second of every day).
 
From the error, it sounds like R2 returned an invalid response (it should always be XML, never a string). Did it sort itself out or is it ongoing (new errors)?

If it was transient and worked itself out (not getting new errors), it could have been one of many things... most of which have to do with network connectivity. If an Internet network route goes down momentarily, you might see something like that where the HTTP client is returning a message that it can't connect to the IP address or something. It would be more worrisome if it's still happening... but if it was once or twice and then stopped, that's probably just network connectivity of the Internet that is never 100% stable to every IP at all times (routes go down, traffic gets rerouted, etc.) The beauty of the Internet is that there's no single route to things, it's made to fail-over and reroute as necessary (which happens every second of every day).
It happened a few dozen times but hasn't happened in the last 15mins and I have 614 users online.

I did notice that "attachments/214" appears in the errors I deleted earlier and the ones I got about 15mins ago.
 
My guess is that it simply was a network issue somewhere between your server and Cloudflare. Network traffic gets routed through a bunch of different networks/routers to get somewhere. So it could have been something like one of those routers was being rebooted or something without a failover route available. Unfortunately stuff like that is just the norm for the Internet (similar to sometimes you'll see a random DNS resolution problem when something on the backend tries to look up an IP and can't for whatever reason). The thought did cross my mind to suppress those transient network errors, but then when it comes down to it, do you want to hide the errors and not know anything was ever an issue? It's probably better to let it be known to the admin that there was potentially some network issues. If it pops up once and never again... okay, no big deal... but if it starts to be consistent where like every day between 2 am and 3 am it happens... it might be something to look into (like a router going offline in their data center or BGP routes failing). So most times, it can be safely ignored, but it's still worth knowing if it happens so you can keep your pulse on your servers/networking.
 
@AndrewSimm I forgot to mention (but it's worth knowing), that if this addon gets a server error from Cloudflare for anything (any API call, including R2 calls), it will retry once before giving up. A server-side error is one returns an HTTP status code of 5xx. So in theory, if Cloudflare did have an issue on their end, most of the time you wouldn't know because it would transparently retry the request. I don't think it applies in your particular case, because I suspect you were seeing a network issue before the request made it to Cloudflare, but it's good to know.
 
digitalpoint updated [DigitalPoint] App for Cloudflare® with a new update entry:

Fixes, code abstracting, new features

  • Fixed issue where the "Registration & contact forms are an overlay" option wouldn't always work
  • Fixed issue with guest page caching where the first request made after a browser restart would return a cached page vs. logged in user
  • Added support for config of R2 for XFMG via UI (it was possible before, but only through config.php edit)
  • Internally caching Cloudflare zone ID (less API requests needed and faster for the requests we are making)
  • Automatically reset cached...

Read the rest of this update entry...
 
Something to note about the update... The R2 user interface supports XFMG (only shows if you have XFMG installed). You can use the same bucket that you use for internal_data/attachments if you want, or if you want to keep track of usage a little more granularly, you can use a unique bucket (would get stats just for XFMG usage then rather than all of internal_data). For those that added XFMG support via config.php edit, that will still work as-is.

If you are OCD like I am, you can delete the old file DigitalPoint\Cloudflare\Api.php from previous installations. I ended up abstracting out my API class to be platform independent (the same class works in XenForo 2 and also WordPress without any changes), so it's now in the DigitalPoint\Cloudflare\Api\ folder.
 
Thanks for the update. However, on 1.5.4 when accessing the addon via the admin control panel, I get the following error:

Fatal error: Declaration of DigitalPoint\Cloudflare\Traits\XF::phrase($phraseKey, $params = Array) must be compatible with DigitalPoint\Cloudflare\Repository\CloudflareAbstract::phrase($phraseKey, array $params = Array) in /home/……/public_html/src/addons/DigitalPoint/Cloudflare/Repository/Cloudflare.php on line 9
 
Thanks for the update. However, on 1.5.4 when accessing the addon via the admin control panel, I get the following error:

Fatal error: Declaration of DigitalPoint\Cloudflare\Traits\XF::phrase($phraseKey, $params = Array) must be compatible with DigitalPoint\Cloudflare\Repository\CloudflareAbstract::phrase($phraseKey, array $params = Array) in /home/……/public_html/src/addons/DigitalPoint/Cloudflare/Repository/Cloudflare.php on line 9
Augh, gross. Fixed.
 
Top Bottom