AcroMedia / commerce-demo

Repo for the Urban Hipster Drupal Commerce demo website built on Drupal 8.
https://commerce.acromedia.com
GNU General Public License v2.0
101 stars 63 forks source link

Database errors related to doctrine/annotations and demo template #23

Open drupauler opened 6 years ago

drupauler commented 6 years ago

I'm installing the demo package into a shared hosting env (siteground) running under PHP7.1 (actually 7.1.21). Install appears to run clean (Compose install, database load, etc.) however browsing to site generates a 'database error come back later' message.

Attempt to follow debug path but Drush CR fails Error: Uncaught TypeError: Return value of Doctrine\Common\Annotations\AnnotationRegistry::reset() must be an instance of Doctrine\Common\Annotations\void, none returned in /home//public_html/comm/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/AnnotationRegistry.php:55

I've found I can use Drush to switch default theme to Bartik then Uli to connect access system as admin where I can clear cache, etc.

I can also view content using bartik, so that all looks good, however re-enabling the demo theme gives the database error and log report:

  | Twig_Error_Loader: Template "/web/themes/custom/commerce_2_demo/templates/pages/includes/site_header.html.twig" is not defined in "themes/custom/commerce_2_demo/templates/pages/page--front.html.twig" at line 13. in Twig_Loader_Chain->getCacheKey() (line 129 of /home/paudax02/public_html/comm/vendor/twig/twig/lib/Twig/Loader/Chain.php).

I get the feeling this problem relates to incompatiabilities between PHP7.1. 21 and doctrine/annotations 1.6 but install seems to run clean. Any thoughts? Exactly what versions are you using?

ghost commented 6 years ago

Hi drupauler,

I think you're right about this first error being a php issue. Our demo is currently running on PHP 7.1.20 (cli) and locally I'm running PHP 7.2.2 (cli) so it seems like your version should be fine. Possibly your server config files for your site are set to use PHP 7.0? If that's the case, it might look like you're using PHP 7.1 if you checked it via php --version, but the site config might have that overridden. You could confirm the PHP version being used in the Drupal UI status report page.

If that's not it, I googled that error and some people are reporting that they've fixed it by updating to PHP 7.2. If that's the case, checking the global version of the system would be differ of the globally set PHP 7.1? If that's something you can do, that might be worth a try. I'm not sure what the root cause is though.

You could also try running composer update to get any old dependencies, but since you already did a composer install I don't think this would help. It would be worth a shot though just in case.

The Twig Error Loader issue has also come up a few times before in previous issues. I think the fix for that is just to flush the caches. If I'm not mistaken, you may have provided that answer as a solution previously.

drupauler commented 6 years ago

Thanks Mike. Ive been working with the hostingco to try and confirm we're running 7.2 across the board. meanwhile I;ve installed locally under Acquia DevDeskTop and that is limited to 7.1 So definitely looks like a PHP inconsistency in my hosting setup.

ghost commented 6 years ago

Ok. If you find a solution please let me know. It would be good to have a record of it in case it comes up again.

drupauler commented 6 years ago

Hi Mike,

The back story is that I’ve hit problems installing drupal distros into my shared hosting account because composer will not run due to memory limits plus issues relating to PHP versions, as discussed (the webhost defaults to php70 and it’s a pain ensuring consistency between websites and shell utilities like composer.

Setting the PHP version for the website is straightforward but Ive been given solutions like below to invoke shell commands under a specific PHP such as “/usr/local/php72/bin/php-cli /home//composer.phar” I get the feeling there must be a proper way to do it… probably stratightforward if running on a dedicated/virtual server. That’s next week though.

Pro-tem I’ve switched to using acquia devdesktop as a local platform to compose distros under php71, and will now develop locally and stage up to the shared host for production, which is probably the way to do it anyway (and ensure only one version of PHP is in play).

DevDesktop not perfect though… yet to get Drush 9 and Console working. Doubtless straightforward for professionals but whilst I’ve a programming background I’m new to the sysadmin side of things. Huge amounts to learn as I go.

Anyway, after a morning reminding myself how to setup paypal sandbox accounts, I’ve just bought a beachball with some virtual dollars! It feels like I’ve just invented cold fusion or world peace!

Going forward, I’m looking to put up a website for my local cycling club probably using Thunder+Commerce. It will be good to move on to the site building phase of the project. The focus will selling and managing places on events rather than physical products but I figure the commerce element is the heart of the project, and will build out from there.

Again, AcroMedia have done a great job with this demo, and the product installer.

Thanks for your support,

Paul Stewart

From: Mike Hubbard notifications@github.com Sent: 04 September 2018 19:12 To: AcroMedia/commerce-demo commerce-demo@noreply.github.com Cc: drupauler paudax@gmail.com; Author author@noreply.github.com Subject: Re: [AcroMedia/commerce-demo] Database errors related to doctrine/annotations and demo template (#23)

Ok. If you find a solution please let me know. It would be good to have a record of it in case it comes up again.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/AcroMedia/commerce-demo/issues/23#issuecomment-418466031 , or mute the thread https://github.com/notifications/unsubscribe-auth/AhHCzuoxCVIkegqBP8rLJkm2DahJ3tlyks5uXsKAgaJpZM4WWxuq . https://github.com/notifications/beacon/AhHCzr4NrJxHJPUF8PtX47xa3sqvlWuZks5uXsKAgaJpZM4WWxuq.gif

ghost commented 6 years ago

Hi Paul!

It's interesting to me to read your backstory because I think a lot of the struggles you're working through are probably more common than you think. To be honest, I'm more comfortable now on the server side of things then I was a year ago, but troubleshooting server issues are never something I look forward to, and there's always more to learn. I'm lucky that we have some people in-house here that really know that side of things well and so I've been able to learn a bit from them while banging my head against the wall at the same time. Haha.

Lately, at Acro, we've been increasingly adopting Lando for local development. It allows you to spin up a self-contained local development environment where each instance contains everything the project needs. You basically just specify what version of php you want and any other services you need, then when you initialize the project it builds the environment right on the spot. It's pretty wild. What's nice about it is that if you can configure Lando to be the same specs as the server the site will end up on, so theoretically you shouldn't run into any issues once the site files are moved up to the server. It might not be worth your time to learn it, but if you're interested in learning more about Lando, one of our senior devs put a blog together getting commerce running with Lando: https://blog.acromedia.com/installing-drupal-commerce-using-lando

Anywho, I'm glad to hear that you're persevering and that you like the things that we're building! The building is the fun part! :smile:

One last thing. If you have trouble getting Drush or Drupal Console running globally, you can always require it with composer instead and then access it at the project level. So if you're in your web root folder, instead of just running drush cr (or whatever), you can then do ../vendor/drush/drush/drush cr because drush gets included there.

thegbomb commented 5 years ago

As per the comment at: https://www.drupal.org/forum/support/installing-drupal/2017-10-15/composer-install-d840-failed#comment-12433177

add

"config": {
    "platform": {
        "php": "7.0"
    }
}

I had to increase it to 7.0.8 and there may be a bin-dir setting in there already in which case add the platform to it with a comma:

    "config": {
      "bin-dir": "bin",
      "platform": {
        "php": "7.0.8"
      }
    },
ghost commented 5 years ago

Hello, before reporting this error, first install the database between different servers but the error continues so. I GIVE UP. please help.

Error Análisis estático:

Se encontraron 411 errores durante el análisis.

Caracter inesperado. (near "" at position 12) Caracter inesperado. (near "" at position 13) Caracter inesperado. (near "" at position 14) Caracter inesperado. (near "" at position 15) Caracter inesperado. (near "" at position 16) Caracter inesperado. (near "" at position 17) Caracter inesperado. (near "" at position 18) Caracter inesperado. (near "" at position 19) Caracter inesperado. (near "" at position 20) Caracter inesperado. (near "" at position 21) Caracter inesperado. (near "" at position 22) Caracter inesperado. (near "" at position 23) Caracter inesperado. (near "" at position 24) Caracter inesperado. (near "" at position 25) Caracter inesperado. (near "" at position 26) Caracter inesperado. (near "" at position 27) Caracter inesperado. (near "" at position 28) Caracter inesperado. (near "" at position 29) Caracter inesperado. (near "" at position 30) Caracter inesperado. (near "" at position 31) Caracter inesperado. (near "" at position 32) Caracter inesperado. (near "" at position 33) Caracter inesperado. (near "" at position 34) Caracter inesperado. (near "" at position 35) Caracter inesperado. (near "" at position 504) Caracter inesperado. (near "" at position 505) Caracter inesperado. (near "" at position 506) Caracter inesperado. (near "" at position 507) Caracter inesperado. (near "" at position 508) Caracter inesperado. (near "" at position 509) Caracter inesperado. (near "" at position 510) Caracter inesperado. (near "" at position 511) Tipo de declaración desconocida. (near "database" at position 0) consulta SQL:

database.sql000664 001750 001750 00257102670 13407266524 015014 0ustar00mhubbardmhubbard000000 000000 -- MySQL dump 10.15 Distrib 10.0.36-MariaDB, for debian-linux-gnu (x86_64) -- -- Host: localhost Database: drupalcommerce_demo -- ------------------------------------------------------ -- Server version 10.0.36-MariaDB-0ubuntu0.16.04.1 /!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT /

ghost commented 5 years ago

Hi @kprichoso,

That error doesn't give me enough information to be able to know why you're getting it. You could try:

Other than, I would need more information to be able to suggest anything different.