how can i slove the given issue while not disturb the built site in drupal - drupal-content-types

I completely developed a website in Drupal 8 and then, finally delete 3 content types, because those required for me further, so due to this may give me an error "The website encountered an unexpected error. Please try again later."
The website encountered an unexpected error. Please try again later.

Have you tried rebuilding the site registry? If you are using drugs you can run
drush rr
https://drushcommands.com/drush-8x/registry-rebuild/registry-rebuild/
Edit: Rebuilding the registry only works for drupal 7 and lower. You can try a cache rebuild
drush cr

Related

Wordpress website Cannot redeclare noindex

My website https://www.greengo.uk/ stopped working and I just can't figure out why. The error message is:
Fatal error: Cannot redeclare noindex() (previously declared in /var/sites/g/greengo.uk/public_html/wp-includes/general-template.php:3206) in /var/sites/g/greengo.uk/public_html/wp-includes/deprecated.php on line 4155
It looks like something happened after an update.
general-template.php:3206
deprecated.php on line 4155
I have deleted the .maintenance file but no luck. I have some important content on this website. Could you help me out how to make it work and recover it?
Thank you
I had the exactly same problem yesterday with one of the sites I've done for a client. I managed to restore the site by updating my local development version to Wordpress 5.7. and then manually replacing the general-template.php and deprecated.php on the server.
The site works now but unfortunately login screen still gives critical error.

How do I go about resolving issue: Missing required keys (core) in modules/contrib/redirect/modules/redirect_404?

"The website encountered an unexpected error. Please try again later." When I went to clear cache in D8 and no further details. I have encountered a similar issue before on another drupal site and in my experience, the "Unexpected error" seems to be a general error message that Drupal gives, while there will likely be a more detailed message.
Thus, to further investigate the issue I enabled logging with $config['system.logging']['error_level'] = 'verbose'; in my settings.php.
Which produced the following upon refreshing the site:
The website encountered an unexpected error. Please try again later.</br></br><em class="placeholder">Drupal\Core\Extension\InfoParserException</em>: Missing required keys (core) in modules/contrib/redirect/modules/redirect_404/redirect_404.info.yml in <em class="placeholder">Drupal\Core\Extension InfoParserDynamic->parse()</em> (line <em class="placeholder">29</em> of <em class="placeholder">core/lib/Drupal/Core/Extension/InfoParserDynamic.php</em>). <pre class="backtrace">Drupal\Core\Extension\InfoParser->parse('modules/contrib/redirect/modules/redirect_404/redirect_404.info.yml') (Line: 552)
I understand that sometimes issue come about when one does not clear the Drupal cache. As a result I have tried to flush all caches via the database by truncating the cache tables as the UI is unavailable. Also ran composer install; composer update but to no avail.
I would appreciate any solutions on how to address the issue at hand.
Thanks
I saw this error as well, though on Drupal 8.7.6, after updating the Redirect module (and its submodules). I fixed it by adding core: 8.x to each module's .info.yml file, as was suggested in a similar issue for the Admin Toolbar module.
I then updated Drupal core to version 8.1.1, at which point I had to remove that line – The 'core_version_requirement' constraint (^8.7.7 || ^9) requires the 'core' key not be set – so that may be a temporary measure.
(As an aside, you mentioned clearing cache through the UI and the database, but you can also clear your cache using Drush: https://drushcommands.com/drush-8x/cache/cache-rebuild/)

WordPress internal Server Error 500 when moving hosts

I am trying to move my WordPress site from one hosting service to another. I made a backup and restored it on the new host. But I am getting internal server 500 error on the site. I have tried to fix the .htaccess file but its still giving error.
The issue is, if I try to rename it to test it, its not giving the internal 500 error but redirecting me to WordPress installation page called wp-admin/install.php
Can someone help me for solve the issue.Thanks
All the suggestions that are given are great, but if those do not work, then you can try to downgrade PHP. It had worked in my case when I was facing the same error.
You can dig in the error log and find what exactly is causing the error.
Steps for debug.
As previously said: stop all plugins and try again. If problem still exists check logs again. Then switch to default theme and so on.
Btw have moved the DB properly? With the same connection settings.
I think you should check your wp-config.php and PHP version. make sure you have entered correct DB info in wp-config like db_name, password, and table_prefix etc...
if You have changed hosting, probable You need to check database and .htacess file. If You are getting installation page means its database issue, Please check database prefix in wp-config.php file and it will solve your issue.
there are lot of causes for internal server error. The main reasons for internal server errors are.
Corrupt .htaccess file
PHP Memory limit
Faulty code in Theme
Corrupted plugin
Corrupted core files
Incompatible PHP version
In oder to fix this issue, you need to investigate in step by step order.
To solve this issue first of all you need to enable Debug mode and check the issue.
after that try with restoring .htacess file, enabling default theme, disabling plugins etc.
if you still facing 500 internal server issue, follow tutorial on WPERA to fix 500 internal server error. Hope this helps.

Drupal - White Screen of Death after updates (and login page returning 403 error)

I have just updated a site that is using Drupal and have now experienced the horrible WSOD.
I have searched through Google looking for any sort of solution/error log to help me find and fix the issue but nothing has worked. I have tried adding in the 'display errors' code in the index.php file and looked at the error_log file in the public directory and nothing.
I can not login to the admin page and check any modules as the login page for this is returning a 403 error.
Any suggestions?
Please go to Apache Error log. You will exact error messages there.
The log file's location is different for different OS and versions.
e.g httpd/log/error.log
Maybe your Drupal registry is broken.
Fix this using the registry_rebuild script (this is no module!)
There are times in Drupal 7 when the registry gets hopelessly hosed and you need to rebuild the registry (a list of PHP classes and the files they go with). Sometimes, though, you can't do this regular cache-clear activity because some class is required when the system is trying to bootstrap.
You might get something like:
PHP Fatal error: Class 'EntityAPIControllerExportable' not found in ...sites/all/modules/rules/includes/rules.core.inc on line 11
If this happens when you're trying to run update.php, and happens when you're trying to clear your cache, well, you have some trouble. That's what Registry Rebuild is for.
It also may happen that you've moved some module that Drupal requires to bootstrap, and you get a horrible error. Registry Rebuild will also rebuild the system table to get the modules in the right place so you can bootstrap.
You will need PHP-CLI or drush to run this.
https://drupal.org/project/registry_rebuild

finding out what is causing dreaded "The website encountered an unexpected error. Please try again later." message

while doing a drupal 6 to 7 upgrade I am getting the not so helpful message
"The website encountered an unexpected error. Please try again later." everytime I go to certain pages.
ex) /admin/config
What is the best way to find out what is causing the fatal error so that I can fix it?
All I can think of right now is to start disabling contributed modules until that page works or looking through the logs.
Thanks.
If dlog/watchdog and php error log aren't working, try this:
go on /includes/error.inc
comment line line 245
print theme('maintenance_page', array('content' => t('The website encountered an unexpected error. Please try again later.')));
and put this
print theme('maintenance_page', array('content' => t('The website encountered an unexpected error. Please try again later.'.$fatal.' '.var_export($error,true))));
Very similar, you put var_export($error,true)) at end of error
By clearing the logs at /admin/reports/dblog then reloading the broken page I easily could identify the offending module when I rechecked the log.
Site is working fine now : )
You definitely should be disabling all contrib modules to perform the upgrade.
Then enable them a few at a time after they have been replaced with the D7 version. When replacing the module, be sure to clean out the entire module directory, just in case some old files remain.
This should help narrow down the problem and be sure to check the php error log in case you find something there. (Although that is usually in the case of the White Screen Of Death.)
As gyozo mentioned if you are not able to log into the site, then it might be difficult to debug.
Then probably you could try
Log into database and run delete from watchdog;
Refresh the page
Then execute the database query select variables from watchdog;
Look out for the text near message
Am replying on 8 years old thread. But wanted to share my inputs to fix this error. I am using Drupal 8.*
I faced the same error when I tried to clear the cache (From performance). I tried several things mentioned in most of the blogs or drupal help.
In the end I came to know that, there was some YML formatting issue in my Drupal 8 theme files. I removed tabs and validated my YML files from online YML validator.
In Drupal 8.7 you can do this in core/lib/Drupal/Core/EventSubscriber/FinalExceptionSubscriber.php line 126:
$content = $this->t('The website encountered an error. Please try again later.' . var_dump($error));

Resources