• Resolved Sageth

    (@sageth)


    Just a note that I was getting an error for a link to a registration page which is otherwise blocked. In the admin for the local side, under the ‘redirects’ section, I was getting “A critical error has occurred.”

    Here is my stack trace (some content edited/removed for brevity, though the cut in #6 does exist as-is in my logs — that wasn’t an accidental cut):

    2024/03/25 18:49:04 [error] 1007#1007: *41092 FastCGI sent in stderr: "PHP message: PHP Fatal error:  Uncaught ArgumentCountError: 3 arguments are required, 2 given in /var/wordpress/wp-content/plugins/broken-link-checker/legacy/includes/any-post.php:579
    Stack trace:
    #0 /var/wordpress/wp-content/plugins/broken-link-checker/legacy/includes/any-post.php(579): sprintf()
    #1 /var/wordpress/wp-content/plugins/broken-link-checker/legacy/includes/any-post.php(543): blcAnyPostContainer->get_edit_url()
    #2 /var/wordpress/wp-content/plugins/broken-link-checker/legacy/includes/instances.php(463): blcAnyPostContainer->ui_get_source()
    #3 /var/wordpress/wp-content/plugins/broken-link-checker/legacy/includes/admin/table-printer.php(798): blcLinkInstance->ui_get_source()
    #4 /var/wordpress/wp-content/plugins/broken-link-checker/legacy/includes/admin/table-printer.php(490): blcTablePrinter->column_used_in()
    #5 /var/wordpress/wp-content/plugins/broken-link-checker/legacy/includes/admin/table-printer.php(147): blcTablePrinter->link_row()
    #6 /var/wordpress/w", request: "GET /wp-admin/admin.php?page=blc_local&filter_id=redirects HTTP/2.0"
    

    I was able to work around it by commenting out:

    /wp-content/plugins/broken-link-checker/legacy/includes/admin/table-printer.php line 229 like so:

    226 'used-in'       => array(
    227    'heading' => __( 'Source', 'broken-link-checker' ),
    228    'class'   => 'column-title',
    229    //'content' => array( $this, 'column_used_in' ),
    230 ),

    That got me to a point where I could take action, otherwise, the entire page was not able to be used. Once fixed, I re-activated that line and it’s working normally. Before that, I tried nuking the links via settings and that worked until it got to the same link, where it blew up again.

    This is fixed and I haven’t dug into more on the cause, but thought I’d share. As far as I can tell, it was just this one link that it was getting stuck on.

Viewing 11 replies - 1 through 11 (of 11 total)
  • Plugin Support Williams – WPMU DEV Support

    (@wpmudev-support8)

    Hi @sageth

    I hope you’re well today and thank you for reporting this!

    I tried to replicate this with various links on my end but to no luck. You mentioned it was on a single link only so I’m wondering if there was something specific about that link – like it’s location or format.

    Is there anything additional about it that you could possibly share? For example, the link itself, where it is located on site (like e.g. on a standard post/page, on some custom post type or in some specific widget/block etc)?

    Note: feel free to mask the domain and any “sensitive” info?

    It would be helpful in understanding why this caused this error.

    Best regards,
    Adam

    Thread Starter Sageth

    (@sageth)

    The only place that this link existed is on a Page (not Post) where I had a FAQ.

    The link location went to the following location (redirect_to was left empty). /wp-login.php?action=register&redirect_to=

    Functionally, this worked correctly in a browser. I don’t think that there was anything special with this other than that it redirected to a login page. However, the login/admin pages are locked behind a web page for authentication (Cloudflare Zero Trust) and isn’t a basic auth login with the pop-up asking for username/password.

    This is a slightly different setup and I’m not discounting that as a cause.

    Plugin Support Nebu John – WPMU DEV Support

    (@wpmudevsupport14)

    Hi @sageth,

    Thank you for further clarification.

    As Cloudflare Zero Trust is an external tool, it shouldn’t be causing a Fatal error at the plugin end. However, I configured the login URL of a test website with Cloudflare Zero Trust but was unable to replicate the issue. Once Zero Trust was enabled, the login URL was listed as a redirecting URL in Broken Link Checker, however, the sub-section ‘Redirects’ was loading fine without any errors.

    I suspect it was a temporary glitch on your website, as I couldn’t find any similar issues reported previously.

    Could you please update us here if the issue reappears, so that we can take a closer look at it?

    Kind Regards,
    Nebu John

    Thread Starter Sageth

    (@sageth)

    Once I did the temporary fix by commenting out that line, I was able to dismiss it and subsequently unlinked the URL as I no longer allow logins.

    The error has not returned. I will post back here if I see it come up again. Thank you for researching.

    Thread Starter Sageth

    (@sageth)

    Looks like I had missed a link, as it showed up again today in the “redirects” section of the plugin. In this case, the link goes to /wp-login.php?registration=disabled

    It shows as a 200 and under source, it says:

    There has been a critical error on this website. Please check your site admin email inbox for instructions.

    Learn more about troubleshooting WordPress.

    I am unable to interact with that row (or, in the case before, anything on that page). Following the link by manually typing it in brings me to a cloudflare zero trust error page.

    I don’t know where this is coming from yet, as the source is showing the error. I will need to do more research.

    Stack trace appears the same (some items edited):

    2024/03/31 19:39:32 [error] 1014#1014: *5918 FastCGI sent in stderr: "PHP message: PHP Fatal error:  Uncaught ArgumentCountError: 3 arguments are required, 2 given in /var/html/wp-content/plugins/broken-link-checker/legacy/includes/any-post.php:579
    Stack trace:
    #0 /var/html/wp-content/plugins/broken-link-checker/legacy/includes/any-post.php(579): sprintf()
    #1 /var/html/wp-content/plugins/broken-link-checker/legacy/includes/any-post.php(543): blcAnyPostContainer->get_edit_url()
    #2 /var/html/wp-content/plugins/broken-link-checker/legacy/includes/instances.php(463): blcAnyPostContainer->ui_get_source()
    #3 /var/html/wp-content/plugins/broken-link-checker/legacy/includes/admin/table-printer.php(798): blcLinkInstance->ui_get_source()
    #4 /var/html/wp-content/plugins/broken-link-checker/legacy/includes/admin/table-printer.php(490): blcTablePrinter->column_used_in()
    #5 /var/html/wp-content/plugins/broken-link-checker/legacy/includes/admin/table-printer.php(147): blcTablePrinter->link_row()
    #6 /var/html/w" while reading upstream, client: xxx, server: xxx, request: "GET /wp-admin/admin.php?page=blc_local&filter_id=redirects HTTP/2.0", upstream: "fastcgi://unix:/var/run/php-fpm.sock:", host: "xxx", referrer: "https://example.com/wp-admin/admin.php?page=blc_local"
    • This reply was modified 8 months ago by Sageth. Reason: clarifying
    Plugin Support Williams – WPMU DEV Support

    (@wpmudev-support8)

    Hi @sageth

    Thank you for getting back to us with additional information.

    I’ve passed that all to our developers so they could analyze the case and related code and see if they can find explanation (and, hopefully, possible improvement/fix for future releases of the plugin) for this.

    I’d appreciate some patience as they are dealing with a lot of complex tasks on daily basis so it may take them a while to check it all but I hope they’ll be able to shed some light on that – we’ll let you know once we got feedback.

    Best regards,
    Adam

    Plugin Support Kris – WPMU DEV Support

    (@wpmudevsupport13)

    Hi @sageth

    Our developers after trying many times werestill not able to replicate this issue. If you can check in this function get_edit_url available in the file /wp-content/plugins/broken-link-checker/legacy/includes/any-post.php , what happens if you print $post, admin_url( sprintf( $post_type_object->_edit_link . $action, $post->ID ) ) and $post->ID

    print_r($post);
    echo admin_url( sprintf( $post_type_object->_edit_link . $action, $post->ID ) );
    echo $post->ID;

    Also, what happens if you just use a return admin_url( sprintf( $post_type_object->_edit_link . $action, $post->ID ) ) instead of this apply_filters( 'get_edit_post_link', admin_url( sprintf( $post_type_object->_edit_link . $action, $post->ID ) ), $post->ID, $context )

    Kind Regards,
    Kris

    Thread Starter Sageth

    (@sageth)

    The first block printed fine, though I get the error still. I see the post contents and the ID, so I can identify the specific page now, however, I still get the wordpress error. I substantially cut this data down and only copied a bit of the post:

    WP_Post Object ( [ID] => 15235 [post_author] => 1 [post_date] => 2023-11-10 14:32:11 [post_date_gmt] => 2023-11-10 19:32:11 [post_content] =>

    Our Latest Posts

    No posts were found.

    WP_Post Object ( [ID] => 15235 [post_author] => 1 [post_date] => 2023-11-10 14:32:11 [post_date_gmt] => 2023-11-10 19:32:11 [post_content] => [post_title] => Blog Home [post_excerpt] => Displays the latest posts as either the site homepage or as the “Posts page” as defined under reading settings. If it exists, the Front Page template overrides this template when posts are shown on the homepage. [post_status] => publish [comment_status] => closed [ping_status] => closed [post_password] => [post_name] => home [to_ping] => [pinged] => [post_modified] => 2024-04-09 19:48:45 [post_modified_gmt] => 2024-04-09 23:48:45 [post_content_filtered] => [post_parent] => 0 [guid] => https://example.com/uncategorized/home [menu_order] => 0 [post_type] => wp_template [post_mime_type] => [comment_count] => 0 [filter] => raw )

    There has been a critical error on this website. Please check your site admin email inbox for instructions.

    Learn more about troubleshooting WordPress.

    For the second, I tried removing the filter and it made no difference.

    Over the weekend, I had also tried debugging further and dumping $this and $post, but nothing stuck out as particularly interesting. Whatever happens on this link, though, it prevents all other BLC links on the page from working.

    My link https://example.com/wp-login.php?registration=disabled redirects to this Cloudflare product (https://www.cloudflare.com/zero-trust/products/access/). Anything that goes to wp-login.php* will redirect to a sort of an MFA page off-domain. That page is publicly accessible from everywhere and, once passing the MFA, will redirect to the correct location. The URL format is like this:

    https://myalias.cloudflareaccess.com/cdn-cgi/access/login/example.com?blah=…

    I have verified with curl that it returns a 200 after a 301 redirect.

    Last, I enabled email debugging and the email seems to have a longer stack trace (which I haven’t looked into too deeply yet). Ultimately, I don’t know why this fails the way that it does — I have a lot of other external links with redirects

    Error Details
    =============
    An error of type E_ERROR was caused in line 579 of the file /var/html/wp-content/plugins/broken-link-checker/legacy/includes/any-post.php. Error message: Uncaught ArgumentCountError: 3 arguments are required, 2 given in /var/html/wp-content/plugins/broken-link-checker/legacy/includes/any-post.php:579
    Stack trace:
    #0 /var/html/wp-content/plugins/broken-link-checker/legacy/includes/any-post.php(579): sprintf()
    #1 /var/html/wp-content/plugins/broken-link-checker/legacy/includes/any-post.php(543): blcAnyPostContainer->get_edit_url()
    #2 /var/html/wp-content/plugins/broken-link-checker/legacy/includes/instances.php(463): blcAnyPostContainer->ui_get_source()
    #3 /var/html/wp-content/plugins/broken-link-checker/legacy/includes/admin/table-printer.php(798): blcLinkInstance->ui_get_source()
    #4 /var/html/wp-content/plugins/broken-link-checker/legacy/includes/admin/table-printer.php(490): blcTablePrinter->column_used_in()
    #5 /var/html/wp-content/plugins/broken-link-checker/legacy/includes/admin/table-printer.php(147): blcTablePrinter->link_row()
    #6 /var/html/wp-content/plugins/broken-link-checker/legacy/core/core.php(1988): blcTablePrinter->print_table()
    #7 /var/html/wp-content/plugins/broken-link-checker/app/admin-pages/local-submenu/class-view.php(52): wsBrokenLinkChecker->links_page()
    #8 /var/html/wp-content/plugins/broken-link-checker/app/admin-pages/local-submenu/class-controller.php(189): WPMUDEV_BLC\App\Admin_Pages\Local_Submenu\View->render()
    #9 /var/html/wp-includes/class-wp-hook.php(324): WPMUDEV_BLC\App\Admin_Pages\Local_Submenu\Controller->output()
    #10 /var/html/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters()
    #11 /var/html/wp-includes/plugin.php(517): WP_Hook->do_action()
    #12 /var/html/wp-admin/admin.php(259): do_action()
    #13 {main}
     thrown
    Thread Starter Sageth

    (@sageth)

    Just because the post above is so large already, I commented out printing the source in table-printer again and I ran the URL check. Here’s what I see (again, nothing special to me):

    Link last checked: April 10, 2024
    HTTP code: 200
    Response time: 0.128 seconds
    Final URL: https://myalias.cloudflareaccess.com/cdn-cgi/access/login/example.com?kid=8a5d7b96f37ab8554732060a5925144cd879dcad13a6f17d989bfca07ebd985a&redirect_url=%2Fwp-login.php%3Fregistration%3Ddisabled&meta=3N1ZXJaaw
    Redirect count: 1
    Instance count: 1

    Log shows:

    Log: === HTTP code : 200 ===
    
    Response headers
    ================
    HTTP/2 302
    date: Wed, 10 Apr 2024 01:34:22 GMT
    location: https://myalias.cloudflareaccess.com/cdn-cgi/access/login/example.com?kid=8a5d7b96f37ab8554732060a5925144cd879dcad13a6f17d989bfca07ebd985a&redirect_url=%2Fwp-login.php%3Fregistration%3Ddisabled&meta=3N1ZXJaaw
    set-cookie: CF_AppSession=abc123; Expires=Thu, 11 Apr 2024 01:34:22 GMT; Path=/; Secure; HttpOnly
    access-control-allow-credentials: true
    cache-control: private, max-age=0, no-store, no-cache, must-revalidate, post-check=0, pre-check=0
    expires: Thu, 01 Jan 1970 00:00:01 GMT
    report-to: {"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v4?s=utKctBn0xYlt"}],"group":"cf-nel","max_age":604800}
    nel: {"success_fraction":0,"report_to":"cf-nel","max_age":604800}
    strict-transport-security: max-age=31536000; includeSubDomains; preload
    expect-ct: max-age=86400, enforce
    referrer-policy: same-origin
    x-content-type-options: nosniff
    x-frame-options: SAMEORIGIN
    x-xss-protection: 1; mode=block
    server: cloudflare
    cf-ray: 871efe7bbd2e6a5f-EWR
    alt-svc: h3=":443"; ma=86400
    
    HTTP/2 200
    date: Wed, 10 Apr 2024 01:34:22 GMT
    content-type: text/html
    content-length: 28387
    access-control-allow-origin: null
    set-cookie: CF_Session=nZkCXs6ZewQkrxpGG; Path=/; Secure; Expires=Wed, 10 Apr 2024 05:34:22 GMT; HttpOnly; SameSite=none
    strict-transport-security: max-age=31536000; includeSubDomains
    access-control-allow-credentials: true
    cf-access-domain: example.com
    cf-version: 1651-0fbc2fc
    content-security-policy: frame-ancestors 'none'; connect-src 'self' https://127.0.0.1:*; default-src https: 'unsafe-inline'
    referrer-policy: strict-origin-when-cross-origin
    x-content-type-options: nosniff
    x-frame-options: DENY
    x-xss-protection: 1; mode=block
    server: cloudflare
    cf-ray: 871efe7bd90143f4-EWR
    
    Request headers
    ================
    GET /cdn-cgi/access/login/example.com?kid=abcd&redirect_url=%2Fwp-login.php%3Fregistration%3Ddisabled&meta=3N1ZXJaaw HTTP/2
    Host: myalias.cloudflareaccess.com
    User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/104.0.5112.34 Safari/537.36
    Accept: */*
    Referer: https://example.com
    Connection: close
    Range: bytes=0-2048
    
    
    Link is valid.

    I’m willing to give the exact URL which causes the issue so you can see how it behaves, but I would prefer not to post my URL here. Is there somewhere I can provide a few private details while we troubleshoot more publicly?

    Plugin Support Kris – WPMU DEV Support

    (@wpmudevsupport13)

    Hi @sageth

    Please email us at: [email protected]
    Subject: ATTN: WPMU DEV support – wp.org

    Please send:
    – Link back to this thread for reference (https://www.ads-software.com/support/topic/one-link-causes-critical-error/)
    so that we could review this case more for you

    Kind Regards,
    Kris

    Plugin Support Laura – WPMU DEV Support

    (@wpmudevsupport3)

    Hi @sageth,

    We haven’t heard from you in a while, I’ll go and mark this thread as resolved. Note that you can still reply on this topic.

    If you have any additional questions or require further help, please let us know!

    Best regards,
    Laura

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘One link causes critical error’ is closed to new replies.