How to fix a critical error in Azure WordPress App

Cindy Miller 5 Reputation points
2024-07-28T21:32:42.0766667+00:00

I'm developing in Azure WordPress on a Windows 11 machine and I have the error message that a "critical error has occurred on the website, check your admin email logs" but I can't access the dashboard nor the website. Last time this happened, I restored a backup, but I'm hoping there is something else that can be done. I don't have a custom domain and tried to access both the site with and without /wp-admin.

In the Azure portal, I went to "Troubleshoot when an Azure CDN's URL does not Respond" Beneath this is the text:

Every request that goes through Azure CDN has a RefString (also known as TrackingReference) for its unique identification. The tracking reference is sent to the client and to the origin by using the X-Azure-Ref headers. You can input the Refstring in the following diagnostic to understand if your specific request failed because of a known issue.

See front door diagnostics to learn about tracking reference and other access log parameters.

Provide the following information to run diagnostics.

The information was auto-populated and when I executed the diagnostics the return was: Failed to load all insights

Is there any way to fix this other than restoring a backup? Before this occurred, I saw the following error on my WordPress dashboard: "nginx.conf rules have been updated. Please restart nginx server to provide a consistent user experience" as well as an error that a screenshot failed to load. On the latter, I was promoted to clear the queue (and I did).

In another Q & A, I saw the recommendation to go to https://(mysite).scm.azurewebistes.net/api/logs/docker, but an error wasn't clear from the logs.

Other things I've researched using llama 3.1 405B suggest the following, but not sure how to fix:

  1. nginx.conf rules have been updated: This message suggests that there have been changes made to the nginx configuration file, which could potentially cause issues with the site's operation.
  2. exited: sshd (exit status 0; expected): This message indicates that the SSH server has exited with a status code of 0, which is considered a normal or expected exit status. However, it's not clear why the SSH server is exiting in the first place.
  3. Failed to load all insights: This message suggests that there's an issue with the diagnostics tool, which could be related to the error you're experiencing.
Azure
Azure
A cloud computing platform and infrastructure for building, deploying and managing applications and services through a worldwide network of Microsoft-managed datacenters.
1,261 questions
Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
8,697 questions
0 comments No comments
{count} vote

1 answer

Sort by: Most helpful
  1. Suwarna S Kale 2,131 Reputation points
    2025-05-01T02:58:25.59+00:00

    Hello Cindy Miller,

    Thank you for posting your question in the Microsoft Q&A forum. 

    When encountering a critical WordPress error that prevents access to both the frontend and admin dashboard, several diagnostic and recovery approaches exist beyond restoring backups. First, verify the application logs via Azure's Advanced Tools (Kudu) console at https://<yoursite>.scm.azurewebsites.net under the Log Files section, specifically checking docker.log and nginx/error.log for PHP crashes or misconfigurations. 

    The nginx.conf update warning suggests a configuration conflict, reset it by accessing the Kudu SSH console and running: 

    bash 

    cp /home/site/nginx/conf/nginx.conf /home/site/nginx/conf/nginx.conf.backup  echo "" > /home/site/nginx/conf/nginx.conf 

    Then restart the app via Azure Portal or CLI (az webapp restart). 

    For WordPress-specific debugging, manually enable recovery mode by adding: 

    php 

    define('WP_DISABLE_FATAL_ERROR_HANDLER', true); 

    to wp-config.php via the Kudu File Manager (https://<yoursite>.scm.azurewebsites.net/DebugConsole). This may reveal the underlying PHP error. 

    If the CDN diagnostics fail, bypass it temporarily by testing the origin URL (https://<yoursite>.azurewebsites.net?bypasscdn=1) or disabling the CDN endpoint. For persistent issues, redeploying the WordPress instance with "Deployment Center" in Azure while retaining the /home/site/wwwroot/wp-content folder often resolves runtime conflicts without data loss. 

    Lastly, check Azure’s Diagnose and Solve Problems blade for platform-level issues like resource exhaustion or IP restrictions. Structured logging and targeted configuration resets typically restore access without full backup restoration. 

     

    If the above answer helped, please do not forget to "Accept Answer" as this may help other community members to refer the info if facing a similar issue. Your contribution to the Microsoft Q&A community is highly appreciated. 

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.