Hello,

After installing an update of what seems to be every module (i tried "contact_storage" & "yamlform") my website gets stuck with the known error "The website encountered an unexpected error. Please try again later.". When this happens i am unable to render ANY page on my website meaning i cannot log in to admin pages either. I was stuck on this situation first, but after consulting comparable threads i have been able to resolve the issue by deleting the newly installed folder on my ftp server and clearing the cache in the db manually through phpmyadmin.

At one point even that wouldnt help me and i was forced to revive from a backup.

I made a clean install and tried it again, the same thing seems to happen. Again i forced the removal of the module manually and got to the admin pages to get to the logs.

I make use of a level+ theme (for drupal 8) supplied from: http://www.morethanthemes.com/themes/levelplus. I am running the latest version of drupal 8x (updated it today)

Below is the sequence of the log files:

php 12/06/2016 - 01:57 Drupal\Core\Database\DatabaseExceptionWrapper: SQLSTATE… admin
php 12/06/2016 - 01:57 Drupal\Core\Database\DatabaseExceptionWrapper: SQLSTATE… admin
php 12/06/2016 - 01:57 Warning: Error while sending QUERY packet. PID=11764 in… admin
system 12/06/2016 - 01:57 yamlform_ui-module geïnstalleerd. admin

You can see that it gets installed and then renders some errors. I have put them chronologicly in a text file that you can acces: HERE

I have spent today 8 hours after my job trying to figure this out, but i only wasted my time and now am back to start :s Any help is much appreciated!

Comments

Jeff Burnz’s picture

What error is reported for this in Drupal - see the recent reports page, ~/admin/reports/dblog

resolate’s picture

Hello Jeff,

Thank you for your reply.

The site is completely unaccessable again. I Will reset iT tonight and perform the install again in order to give you the db log files. I ll also add my Apache logs That are generated over Night.

I have been troubleshooting myself this Night:

The theme comes with An installerpackage so That all content types etc inherent to the theme are added automaticly with all feutures of the theme included.

I tried last Night installing a fresh drupal instance from the oroginal releases. I tried installing the modules That bugged out and theu installed without any problems.

This gives me reason to believe That there is a db corruption while using the installerpackage delivered from the site.

The problem is That if i do iT manially, i Will have to add all content types, views, etc from the theme myself manually and hope That nothing Goes wrong, which is a lot of work and a lot of room for errors.

Dont get me wrong: i am not lazy and if That is the best soluties for me, then i Will do my best to make iT work like this...

But maybe you can see something fairly simple from the logs That can solve this problem and save me a lot of work, since i am only beginner in drupal.

I have made a ticket with the Supplier of the theme with the problem at hand and the fact That i think That something Goes wrong in the installationpackage they are supplying. Ofcourse That is only my modest opinion...

I asked them for help also.

I ll keep you posted with the logs tonight.

Thank you for your time.

Sincerely,

Resolate

begrafx’s picture

I was attempting to add a module, and I got "The website encountered an unexpected error. Please try again later." I can click the BACK button on my browser and get back into the Admin toolbar, but as soon as I click anywhere on it, I get the same error. I can FTP in and I can find the new module in the /MODULES folder. I attempted to just rename the folder, but that doesn't seem to resolve the problem. I've seen suggestions clear the cache, check logs, etc. but I can't get to the proper screens to clear the cache or view the logs. Even trying to view the front end gets the "The website encountered an unexpected error. Please try again later." error message. I've attempted to run CRON using the remote link, and even THAT just gets the "unexpected error" message. I'm using Drupal 8.

I can access both the PHPadmin and FTP.

begrafx’s picture

I have gone in via FTP and deleted the last folder of module that I was attempting to install ( /modules/{module name] ), and then I went in with Drush and did a cache rebuild (drush cr) however I am still getting the "The website encountered an unexpected error. Please try again later." message when I attempt to even log in.

begrafx’s picture

I currently cannot access the site in any way. I have gotten the "The website encountered an unexpected error. Please try again later." before, (more and more frequently over the past month or so) but in every other instance, I was able to click "BACK" on my browser, which would bring back the admin screen, and typically when I would try again, it would work. This time, however, when I click "back", I went back to the admin screen, however, anything (literally ANYTHING) that I try, whether it's clicking to another area of the admin menu or any other menu option results in the "The website encountered an unexpected error. Please try again later." message. I have gone into the site through FTP and deleted the folder of the module that I was attempting to install when this issue occurred, and I have used Drush to clear/rebuild the cache, however the error message is all I get.
How do I fix this?

sara.vaseei’s picture

thanks Jeff, I used your help to find error line in log and fixed it.

John02’s picture

While I installing drupal I was facing an issue of confirming form resubmission and then turn off the confirmation form again and again. But then I got a very easy solution. It was actually my browser problem. If anybody wants to know how to turn off confirm form resubmission chrome, then they can browse.

kaholland1’s picture

I have the same issue. It has only started with the install of 8.2.3. I have since updated to 8.2.4 and still have the same issue.

I am now unable to view any page including admin pages

pbvivier’s picture

I am new to Drupal and installed version 8.2.4. I get the welcome to my site message even congratulations that I successfully installed Drupal. But when I click on "Add content" I get the error message "The website encountered an unexpected error. Please try again later." I am not able to do anything. I installed it on Windows 8 with Apache server, MySQL and PHP. So I get the same error and have no idea what to do.

begrafx’s picture

kaholland1: I encountered a similar issue. The first thing I would suggest that you do, is look at your Server's log, and see what you can find there. 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 in the log files. Also, if you are able, take a look at Drupal's log files and see what you can see.

Do you have Drush?

pbvivier: Am I understanding correctly, that this is a brand new install, with no additions/updates yet?

pbvivier’s picture

This is a brand new installation. No I do not have Drush. It look as if Drush is not running on Windows. I will look at the system logs. I will try and install Drupal on windows 10 as well.

begrafx’s picture

If it is a brand new installation, and you are already having this issue, it sounds to me like something got corrupted or scrambled somewhere, somehow. Since it's a brand new installation, you have no content to lose, so my advice would be to blow it away, and try a fresh install.

borwn’s picture

guys, i am trying to learn drupal since a few days. before drupal, i had used different CMS technologies anyway... today i decided to install the latest version of durpal but unfortunately, it has taken about six hours to figure this out. nearly at the every step i encountered an issue. simple issues but it is hard to solve them without googling. after i installed drupal in too many hours, i wanted to install a module named "admin_menu" this will be first event at my drupal admin panel. but at my first module intallation i encountered this error above.
So drupal is fine? if so what are these promlems all? may be i didn't learn enough about it but i think there is a big problem here...

begrafx’s picture

Hello borwn,

You need to give us more information. "...nearly at the every step I encountered an issue." What does that mean? You were unsure how to proceed? You received an error message? Are you installing Drupal on a hosted server, or on your local machine? If a server, what host? If locally, are you using MAMP? XAMP? What platform? You say you get the, "The Website encountered an unexpected error..." message. I've found that this is basically Drupal's way of saying, "Look at your error log for more detail. The error log should tell you more specifically what's going on. Share THAT message with us, and we can help you further.

borwn’s picture

the programs that i mentioned obove are all latest versions. this is the order of issues that i encountered: first i had opcashe warning while started to install durpal. i am not sure but i think it was the second step of installation that i had this warning message. this issue was about php ini file of apache of xammp. i learnt that by googling and i added some code there and i set the opcashe and solved the issue... second issue was time out error. that was because of php ini file again. i changed max_timeout setting of apache php ini file to zero. affter that i continued to install but this time i encountered an error message like "durpal site already installed.. or something like this" without skipping to the last step of installation. but there was no drupal admin panel and site when i went to my local site by my webbrowser. so i deleted my drupal folder at my local path and tried to install again. i encountered to same issue a couple times. then i solved the issue by creating and using a new database. after all i installed drupal correctly. then i wanted to install a module by the name of "admin_menu" (dev) for drupal 8x. after i installed it i encountered the error message that is i wrote above and i gave up to deal with drupal... that is the story i lived... i am not a high level coder but i know that those issues that i mentioned, are not about drupal itself. they are about the envirements. i am angry about this that why does not developers of drupal foresee that simple issues and does not fix them or at least why does not warn the users about those issues before the installation?

Jeff Burnz’s picture

why does not developers of drupal foresee that simple issues and does not fix them or at least why does not warn the users about those issues before the installation

1. Installation requirements are in the INSTALL.txt file.
2. Drupal did warn you about opcache, it also gave you a link to continue without using one. Opcache is not a hard requirement - this is stated on the installation page where that warning occurs.

What you've been through is a learning curve, be happy for it, take away the lessons learnt. Avoid getting angry - it does not work in software development at all, only leads to more pain and suffering. Move on, learn more and be happy for every error and problem you encounter because it's teaching you something that you need to know if your plan is to run any sort of website.

"Latest version" is not a specific version, another version might come out 1 hour from now, so you need to be very specific with things like this.

-dev means "in development", so expect it be risky, just don't use -dev versions unless you're a developer.

Jeff Burnz’s picture

And you might want to add very, very important information like what version of Drupal, what version of admin menu module etc.

If it took you 6 hours to install Drupal you're doing something wrong. Many of us here work in Drupal and install it many times every day, it should only take a few minutes.

D8 Admin Menu module is broken, so yeah, beware of modules etc, do your homework before installing anything and always test somewhere safe and make sure you have backup.

begrafx’s picture

Agreed, Jeff. While he DOES Say, "The latest version of Drupal" he should specify. Presumably he's using D8, but I've learned long ago not to just assume. But whether he's using 7 or 8, there is no reason it should take 6 hours to install Drupal.
While I agree that folk need to be aware, and as you say, test in a safe environment, I think at the same time, that if an author/team are aware that their module for is broken, it should be their responsibility to, remove that broken module until it is fixed, or at the very least, post some sort of notice on the Project page, stating such. With as many modules as there are out there for Drupal now, it is unrealistic to expect anyone, whether someone new to Drupal, or a seasoned developer, to hunt around to confirm the status of every module we choose to use.

Jeff Burnz’s picture

it is unrealistic to expect anyone, whether someone new to Drupal, or a seasoned developer, to hunt around to confirm the status of every module we choose to use

Yes and no... sometimes it's the environment around a module that breaks it. E.g. the current D8 Admin Menu is 2 year old -dev. Lets not forget these are open source projects and it can be unrealistic for people to expect constant development, for free, over many many years. The point being that this is open source, it's how it works, and those with little experience have unrealistic expectations - and frankly, I will be blunt - compared to the work that goes into many themes and modules, the "hunt" you describe is trivial.

begrafx’s picture

Again, I agree with you, you can't account for every environment, but the point I'm trying to make is, I've seen more and more items put up on the Drupal.org project repository, that simply DON'T WORK. I had one (I won't mention names), I simply INSTALLED the module, and it IMMEDIATELY gave a "The Website encountered an unexpected error..." message. I checked logs and checked the Issue postings for that module. Seeing none relating to my issue (and only one or two for the Drupal 8 version), I created a new post, reporting the error. I received a response within 24 hours saying, "there's no working Drupal 8 version of [MODULE] yet. Just a prototype without any functionality." The obvious question is if this is so, why is it even online for download? -dev version or not, I see no reason why you would put a program that by your own admission is, "without any functionality" online for anyone to download.

Jeff Burnz’s picture

Why? So other developers can download it and work on it, or actually use it. Take for example Feeds module on D8, if you install that bad things can happen, but if you're a developer we can use what is there already. So the issue is, as it has almost always been, a factor of knowledge - some modules are aimed very squarely at beginners, others at very advanced programmers.

borwn’s picture

first of all i respect you and your contributes about helping people by developing an open source technology like this. i think this is a great job that developing a program like drupal. actualy i am tring to help developing drupal. i don't want another person to encounter issues and be angry like me. i also know that the "dev" means it is continuing to develop. may be this is the whole story that i started with a wrong module...

begrafx’s picture

I get that. But, the thing is, to use your example of the Feeds module for D8, if I read the description on the project page for that, I see

8.x

It's not ready yet, but we are brainstorming about what would be the best way forward. Want to help us? Fill in our survey.
If you decide to use it, don't be mad if we break it later. Anyone who does use it and reports bugs are greatly appreciated.

So, OK, "It's not ready yet." That's simple. And yes, as you say, if I were a more proficient developer, and I wanted to grab it and work on it, I could do so, but at the same time, I can also see, if I'm looking for a module of that type to USE, that this one probably isn't the best one to pick at this point. It's a simple point of communication.

Jeff Burnz’s picture

Well, yeah know, I've been around here a while, so I kinda know the story and honestly its never going to change. People are busy, fact of life.

-dev is -dev, use it at your own risk. If you have a problem with a specific module, tell the owner, but don't expect them to do much about it, they might even ignore you entirely, because developers most of the time get enterally bugged by people with no clue at all, asking bizarre questions with Mt Everest high levels of self entitlement. For us it's clearly evident the code is not done, or we spent an hour writing code comments explaining whats going on. And now some person comes along with no clue, never spent 1 minute bothering to even learn anything, and starts bitching about something being broken and why the HELL haven't we got a notice up on our project page.

begrafx’s picture

I understand what you are saying, the point I'm making is,a -dev version can be anything from an extremely basic sketch of an idea that someone has started a few lines of code for; all the way to practically a full beta version. And, as you say, the level of documentation varies just as widely. Sure, if I were to look at code, it would probably be obvious where things stand; but if I'm just looking for a module to USE to do a particular task/function, It may not be nearly as clear cut. And when all the project page says is something about the guy is looking for help, it leaves a lot of questions.

Jeff Burnz’s picture

Indeed, it's a perennial problem, I don't know how to solve it. On the one hand it's too much work for the developers to constantly update their project pages and typically you'd need to glean information from the issue queue. Quite often you'll find a meta or status type issue (especially for a port between major versions), where updates are discussed. OTOH if a module has a large user base of non-technical users then developers should update their project pages, and often they do, but just as often they don't... so yeah, its a tricky problem and not easily solved.

begrafx’s picture

Yes, it sounds like we're on the same page. It would make sense to me, to just require when a person uploads a project, that they input a simple status, whether that's, "This is a fully operational module" or "Basic code, please help me develop this" or whatever.

usmanjutt84’s picture

I got this log using drupal 7
PDOException: SQLSTATE[HY000]: General error: 1030 Got error 28 from storage engine: SELECT sc.*, t.name AS name, t.description AS description, t.weight AS weight, t.vid AS vid FROM {simplenews_category} sc LEFT OUTER JOIN {taxonomy_term_data} t ON t.tid = sc.tid WHERE (block = :db_condition_placeholder_0) AND (opt_inout <> :db_condition_placeholder_1) ORDER BY t.weight ASC; Array ( [:db_condition_placeholder_0] => 1 [:db_condition_placeholder_1] => hidden ) in simplenews_categories_load_multiple() (line 1863 of SITENAME/sites/all/modules/simplenews/simplenews.module).

I even don't have access as administrator.

rick_p’s picture

I was having this issue after updating core and all modules that had updates available. I think in particular it was YAML Form that started the issue, but it all cleared up after I Flushed All Caches.

wdev’s picture

Hi,

Using watchdog in drush, we can track out the errors and find there appropriate solutions like -

drush watchdog-show

It will list out the errors. below is the title null contraint error.

Drupal\Core\Database\IntegrityConstraintViolationException:
SQLSTATE[23000]: Integrity constraint violation: 1048
Column 'title' cannot be null: INSERT INTO
{node_field_data} (nid, vid, ty

umeshpatil’s picture

In my case the site was completely unaccessible. I had cleared/rebuilt the cache using "drush cr all" and the site came back to normal.

Sumit kumar’s picture

Hi

Same problem with me then i had use drush cr but this command stopped and showing me this error

PHP Fatal error:  Class name must be a valid object or a string in /var/www/web/Barbet/web/core/modules/field/src/FieldStorageConfigStorage.php on line 155
Drush command terminated abnormally due to an unrecoverable error.                                                                  [error]
Error: Class name must be a valid object or a string in
/var/www/web/Barbet/web/core/modules/field/src/FieldStorageConfigStorage.php, line 155
arulabisheak’s picture

I have installed new drupal 8 site in Ubuntu system. I couldn't access any administration pages. Even dblog page "/admin/reports/dblog" wasn't accessible. I tried by installing 3 new sites but i got the same error.

Using this "drush watchdog-show" command in drush, identified that the curl wasn't installed. After installation of the curl now am able to access all the pages.

for installing "curl" this page helped me " http://www.tomjepson.co.uk/enabling-curl-in-php-php-ini-wamp-xamp-ubuntu/ "

Partha Sarathi’s picture

I was struggling with this error for more than a hour and I found this helpful. What I did was used drush and used "drush watchdog-show"

Got the issue which was related to Devel module installation. Uninstalled the module using drush and reloaded the site and bing! 

Got it back!

Thanks a ton @arulabisheak

You guys are awesome.

minhhuudoan’s picture

You can remove module folder (use FTP, etc). Then, go http://.com/update.php to refresh .
See https://enginpost.com/category/technology/posts/2015/12/drupal-8-manuall... for more detail

Terebinth’s picture

I had that dreaded white page + "encountered error" while trying to update webform. Running update.php did the magic! #D8

Deltaside’s picture

i have had the same error when i am trying to install a new module " The website encountered an unexpected error. Please try again later."
i resolved that with :
sudo apt-get install php7.0-zip
To see the libraries
sudo apt-cache search php7.0-*
sudo apt-get update

GoodLuck

theicydeveloper’s picture

Using 8.3.7 On installing new module, I don't know what goes wrong and everything stops working "The website encountered an unexpected error. Please try again later." 
Console doesn't show any logs, nothing just dead. Restarting doesn't help.

Anyone knows any workaround?

lakenney’s picture

I was able to reproduce the problem.

While installing AdaptiveThemes modules, AT Theme Generator and AT Tools, I got a warning that they require Layout Plugin. I clicked Continue and I got the dreaded The website encountered an unexpected error. Please try again later. I reproduced this problem a couple of times.

I tried a different approach: 

I dropped all the tables, cleared cache, and went back to Extend. This time I installed Layout Plugin first ... no problem. Then I installed AT Theme Generator and AT Tools. No problem.

Just for giggles, I wanted to reproduce the problem again so I cleared my database and tried to install AdaptiveThemes modules, AT Theme Generator and AT Tools before installing Layout Plugin. This time Theme Generator and AT Tools installed no problem and also installed the Layout Plugin.

I have no solution other than initializing my database. I tried several solutions mentioned above to no avail.

Not sure if this information helps developers.

Ariel Zwolinski’s picture

Probably not helping much, but my website went down today itself, without any work being carried out.

Drupal 8.5.0-rc1 with news+ lite theme, core modules + path auto enabled, generally not fully fresh install, but nearly.

Not sure if this could have been caused by cron job, or some spam bot. I could not go to logs' page, I do not have drush, could have cleared the cache from database I guess, but I rushed into recovering from backup from today morning, and it worked as charm. All I might have lost is some comments (unlikely, as website is pretty fresh) and page views, but an idea of site going down itself is a bit unsettling.

xeiro’s picture

Here are the steps that led to my white screen message "The website encountered an unexpected error. Please try again later." on every page (both logged in as administrator and publicly as anonymous).

Steps Taken:
Installed the module Workflow > enabled Workflows, Content Moderation, and Workflow (Access/ Operation/ UI).
What fixed it for me was first truncating (empty only) all table data starting with “cache_ “ table, via myphpadmin > secondly, removing the Workflow module via FTP > then clearing all “cache_” tables again through myphpadmin. 

Log excerpt:
Recoverable fatal error: Argument 1 passed to Drupal\workflow\Entity\WorkflowManager::isWorkflowEntityType() must be an instance of Drupal\workflow\Entity\string, string given, called in /home/XXXXXX/public_html/modules/workflow/workflow.views.inc

I have since only applied Workflows & Content Moderation with no issues so far.

D 8.4.0 / Bootstrap 3.6 / Not fresh install

begrafx’s picture

I got this same result when trying to install the workflows module in Drupal 8.5.1. Anyone else?

srikanth.g’s picture

>composer require drupal/admin_toolbar then error once i try to enable module: "The website encountered an unexpected error. Please try again later."

jmev’s picture

Thought I'd chime in and share my post:  https://www.drupal.org/project/drupal/issues/2960290

I point out that I experienced this and traced it to a missing autoincrement property in table  primary key fields, and after adding that back in (details in my post), all seems to work well—until another table that Drupal hadn't accessed previously gets accessed. I'm having to go through each and every table and compare to another, working Drupal installation.  I hope someone comes up with a quick fix, as my solution is cumbersome.

 

newme154’s picture

Drupal 7 was just fine. Switching to 8 has cause so many issues. I have the same issue, however, I'm connected to the Acquia Desktop. This happens whenever i try to update or add a new module. 

jmev’s picture

I actually had this issue with a Drupal 7 installation.

Frank77’s picture

Hi all, I got the same issue.
I created my own module and got that message : "The website encountered an unexpected error. Please try again later."
Even before installing it, I got that error and my website was down.
I checked all the syntax of my yml files and they were all correct.

The problem was the encoding file of mymodule.info.yml
I was using a text editor that recorded in utf8 file format.

But it has to be recorded in UTF8 wihtout BOM (Byte Order Mark)
otherwise it adds an invisible character at the start and messes up with your info.yml which could not be parsed.

Then, after saving my files in utf8 without BOM, the bug was fixed :-)
I have spent hours to figure it out !

Hope my Drupal8 experience will help :-)
Frank the rookie

aaronsssp’s picture

Uninstall twig_extensions and it should be fine

pat redmond’s picture

Sorry for the late comment, but I've just had the same thing. I manually emptied the cache tables in the database, and now it's working again... Hopefully that helps someone. :)

julescsv’s picture

Please add this to your /sites/default/settings.php file

$config['system.logging']['error_level'] = 'verbose';

mactinos’s picture

I had the same issue. I did a run of /update.php, (this will also cleare the cache) and everything was back normal again.

mangesh_sathe_pune’s picture

Answering very old question, but this may help someone.

My {themename}.info.yml file format was not proper, I added some regions in my theme and immediately I stated getting this error.

Error was here: this is the old code without single quote

regions:
headline: headline
header: header
content: content
sidebar: sidebar
footer: footer

I resolved it by adding single quote to the value of a region!

regions:
headline: 'headline'
header: 'header'
content: 'content'
sidebar: 'sidebar'
footer: 'footer'

Akash_Daimari’s picture

Changing or increasing the default value of  innodb_log_file_size: 5M to 128M in my.ini file solved my problem.

or check comment #12 of this issue https://www.drupal.org/project/drupal/issues/2997797

Hope this is helpful to someone.Thanks

bmelland’s picture

Hey Akash.

Where do I change the size of the default value of innodb_log_file_size?

Thanks.

jmev’s picture

As Akash_Daimari commented, in the my.ini file. The location of this file varies. See this post for help locating it:  https://dba.stackexchange.com/questions/133672/how-can-i-check-the-path-of-my-ini-through-the-command-line

If on Mac or Linux, run locate my.cnf and you'll see several possibilities. Also, the following command seems to provided the needed information as well:

mysql --help | grep "Default options" -A 1 
ravi_admec’s picture

i just cleared browser cache or u can open it in private window.

It worked for me.

Don't forget to remove the newly added module folder from the setup else its back-end will not work.