Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Database credentials #9

Closed
drupauler opened this issue Dec 20, 2017 · 18 comments
Closed

Database credentials #9

drupauler opened this issue Dec 20, 2017 · 18 comments

Comments

@drupauler
Copy link

Can you confirm database creedentials please.

I'm installing into a hosted environment. Created DB, ran import then created user account:
$databases['default']['default'] = array (
'database' => 'aaaaa-xxxxxxxx', (aaaaa is hosted account id)
'username' => 'yyyyyyy',
'password' => 'zzzzzzzz',
'prefix' => '',
'host' => 'localhost',
'port' => '3306',
'namespace' => 'Drupal\Core\Database\Driver\mysql',
'driver' => 'mysql',
);

But get database error on connection.

Thanks

@ghost
Copy link

ghost commented Dec 20, 2017

Hey @drupauler ,

The credentials you're looking for should be in your host environment. You would need to create a database, which also lets you set up a username and password. Then, once you have that, you can import the database we've provided.

Please read the README.md file and look at the 'To setup the demo' section. These are the steps you need to follow to setup this demo on your own.

@drupauler
Copy link
Author

drupauler commented Dec 20, 2017 via email

@drupauler
Copy link
Author

drupauler commented Dec 20, 2017 via email

@ghost
Copy link

ghost commented Dec 21, 2017

Hmm. I know you've set your server to PHP 7.1, but everything you're showing me points to 7.0 being used instead of 7.1... even though it's configured as 7.1. I'm not an expert on servers, but I do know that they can be picky. I've seen Drush fail at Doctrine\Common\Annotations\AnnotationRegistry many times and every time it's because of 7.0. It's a known issue and is being discussed on Drupal.org. https://www.drupal.org/node/2898119 .

However, here are shot-in-the-dark things to try.

  1. Check and recheck PHP. If you can SSH into your sever, go to the website root and check the PHP version running there. If it's linux hosting, you can use php --version to check what is running.
  2. If that looks good but you're still having errors, all I can assume is that something haywire with PHP and so we can try a few PHP 7.0 workarounds. First thing is to try the patch: https://www.drupal.org/node/2898119 . Edit the composer.json file and apply the patch at the bottom. There are some examples you can follow, but use "drupal/core". Then run composer update drupal/core from within the same directory as the composer.json file.
  3. If that doesn't work, remove the patch from composer.json and run the update command again. Then, also in the composer.json file, and try setting "webflo/drupal-core-strict": "8.4.0" in the required section. Then run composer update. I haven't tried this but a coworker had suggested it a while back for this issue. Here's a bit of information on that: https://github.com/webflo/drupal-core-strict

If none of those things work, contact your hosting and see if they can come up with an explanation. It is a hosting issue from what I can see, so I really can't offer much more for support.

Good luck.

@drupauler
Copy link
Author

drupauler commented Dec 21, 2017 via email

@ghost
Copy link

ghost commented Dec 21, 2017

Before even needing Drush you should be able to see the site by step 8 in the setup instructions. I'm going to quickly run through the setup myself on my local machine and see the result. It's been a while (and a number of updates) since I last did that. I'll let you know if I have any issues.

To your notes above, it seems to me that Drush is the issue, not composer. If you can find a way to get Drush working than I think you're in the clear, and the only reason it's not is because it must be using php 7 instead of 7.1. Maybe your server is defaulting to 7 even though it appears you're using 7.1. Bah. I imagine by this point you're quite frustrated... I know I would be. :S

@ghost
Copy link

ghost commented Dec 21, 2017

FYI, I just did a fresh setup without any issues, even before setting up any Solr stuff. You shouldn't actually need Drush at all for it to work initially.

@drupauler
Copy link
Author

drupauler commented Dec 21, 2017 via email

@drupauler
Copy link
Author

drupauler commented Dec 21, 2017 via email

@ghost
Copy link

ghost commented Dec 21, 2017

Hey Paul,

Ok, so as of Drupal 8.4, there is a minimum version of Drush that is needed for running Drush commands. As you may know, Drush is just a useful tool for doing development tasks, things like installing/uninstalling modules, clearing caches, updating the database after module updates, etc. However, you don't actually need Drush in order to make the site work. We included Drush 9 in the composer package just as a means of making sure that there is a compatible version within the project. Your host may already have the appropriate version of Drush, so you could use it or the provided version.

With a working version of Drush, those commands in the readme are common tasks that can be performed to resolve common issues, such as outdated cache or database/entities needing to be updated. The problem you're facing running Drush, from what I've seen in the past, is related to the server running php7 instead of 7.1. It's possible that even though you've set 7.1, the server may still be defaulting to 7. However, the database provided should be up to date and so you shouldn't actually need Drush for anything.

Alright, so with that said, you should still be able to get a working site up and running without Drush. You should just need to do the following:

  1. Clone the repo or download it, and upload the entire contents to your host.
  2. Run composer install to download Drupal and all of the modules and components needed for the site. If you can't run composer on the server, you could do this locally too and then upload all of the files afterward.
  3. Extract the provided files folder (this is optional. If you don't do this, your site should still work but you'll be missing a ton of content/product images).
  4. Create a new database and import the provided one into it.
  5. Configure your settings.php with the database and credentials you set when creating the database in Step 4.
  6. Point your host to use /web as the web root. This dir holds your index.php.

That should be all you need to do to see the site. Composer install gets the website files. The files.tar.gz provides all content images used. The database holds all configuration and content data, so once imported you don't need to do any Drupal installation or anything.

@drupauler
Copy link
Author

drupauler commented Dec 21, 2017 via email

@ghost
Copy link

ghost commented Dec 21, 2017

Argh. I feel like you're so close. I'm happy that you like the demo though :) For the record, you can also go to https://commercedemo.acromedia.com and log in with demoadmin/demoadmin . It's not a full permissions admin role, but should let you see how things are done from the configuration point of view.

I know that it should work because I just set up the site from scratch this morning without issue so I think it's either cache or server related.

"The website encountered an unexpected error. Please try again later." I just Googled that and others (some, not all) are reporting that flushing the caches solved it. If the provided Drush isn't working, try just running your regular command from within the web root to use the server provided Drush instead. It's either drush cr or drush cc.

If that doesn't work, see if you can find some server error logs for the site. If server is linux, it mIght be in /var/log/nginx/ or /var/log/apache/ ... something like that. The error log will show you the details of that message.

If you can't find that, you can also try updating the settings.php with the details shown in this answer. Maybe this will shed some light. https://drupal.stackexchange.com/questions/235215/the-website-encountered-an-unexpected-error-please-try-again-later-wsod-debu

@drupauler
Copy link
Author

drupauler commented Dec 21, 2017 via email

@drupauler
Copy link
Author

drupauler commented Dec 21, 2017 via email

@drupauler
Copy link
Author

drupauler commented Dec 21, 2017 via email

@ghost
Copy link

ghost commented Dec 21, 2017

Good questions, Paul. Unfortunately, I do not know the answer or what else you can try.

@drupauler
Copy link
Author

drupauler commented Dec 23, 2017 via email

@ghost
Copy link

ghost commented Dec 23, 2017

Fantastic! A Christmas miracle. haha. Thanks for the update, Paul. This very well may bite someone else, so it'll be good to have around for reference.

I'll close up this ticket. Cheers!

@ghost ghost closed this as completed Dec 23, 2017
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant