"drush cache-rebuild" throwing driver not found error - drupal-8

I am getting [error] could not find driver for the command drush cache-rebuild
Below is the Drush and Drupal Version Details, Appreciate any help. Thanks

I was using wampp with PostgreSQL where I enabled pdo_pgsql, pgsql from wampp applcation menu (wampp> php > php extension). It didn't work for me.
Step 1) run php -m in terminal, in my case it didn't listed those php modules although it was showing enabled in wampp. So I went to php.ini and enabled those modules.
Step 2) drush cr or drush cache-rebuild clears cache from database, so make sure to put postgres path to system environment variable.

Try this:
sudo composer update
run drush cr all

Try using drush cr command. And if you are using ubuntu then you must use sudo drush cr command.

Related

Restart Apache in Lightsail Terminal

As I found a blocker in one approach to make a Django app production ready I've gone with a different approach documented here.
In particular, this question is about this step where it says «Restart Apache for the changes to be taken into effect» and has the following associated command
sudo /opt/bitnami/ctlscript.sh restart apache
Thing is, ctlscript.sh isn't in that folder but in /opt/bitnami/stack. Then, when running in that forder
sudo ctlscript.sh restart apache
I get this error
sudo: ctlscript.sh: command not found
The file is there so I thought it would be something related with permissions (as pointed here).
The script is in the right folder, so the problem points to incorrect permissions.
sudo chmod 755 ctlscript.sh
but running the command to restart Apache got me into the same "command not found" error.
"command not found" does not point to "incorrect permissions". You're getting errors because the script is not in your PATH. There's two ways you can go this
Discover and specify the full path.
Specify the current directory.
Method 1
Run
pwd
and you will get the full path. If you get /home/bitnami/stack, then, run
sudo /home/bitnami/stack/ctlscript.sh restart apache
Method 2
Run
sudo ./ctlscript.sh restart apache
and that will work too
The following worked for me (I was getting a command not found error too):
sudo /opt/bitnami/ctlscript.sh restart apache
Taken from https://docs.bitnami.com/aws/faq/administration/control-services/

How to fix You have requested a non-existent service 'database.replica_kill_switch'

I was trying to export a drupal site to local, and while doing "drush cr" iam receiving the following error 'You have requested a non-existent service "database.replica_kill_switch"', How to fix this?
I found this error in an installation previous to 8.7.x, while updating to 8.8.x. this "database.replica_kill_switch" doesn't exist before 8.7.x. Maybe you have some module only compatible with 8.7.x and greater.
I solved my error, not sure if it applies to your case, with the following commands:
composer update
drush updatedb
# ignore if drush cr fails
drush cr
# make sure your composer.json requires twig/twig:^1.38.2
vi composer.json
composer update twig/twig
composer require drupal/core:8.7 --update-with-dependencies
drush updatedb
drush cr

Unable to execute a step on a running EMR

I have an EMR cluster 5.28.1 running in AWS but I forgot to install from python libraries as part of the bootstrap action. Now that the cluster is running, I was simply attempting to add a step via the EMR console. Here are my settings
JAR: s3://us-east-1.elasticmapreduce/libs/script-runner/script-runner.jar
Main class: None
Arguments: s3://xxxx/install_python_libraries.sh
Unfortunately, I get the following error.
Cannot run program "s3://xxxxx/install_python_libraries.sh" (in directory "."): error=2, No such file or directory
I am not sure what I am doing wrong. The shell script looks like this.
#!/bin/bash -xe
# Non-standard and non-Amazon Machine Image Python modules:
sudo pip-3.6 install boto3
sudo pip-3.6 install xmltodict
I also tried this by simply using 'command-runner.jar' but I get the same error. Can you please help me figure out the problem so I do this via the console? I would like to install the libraries on all nodes - master and core.
Thanks
The issue is the xxx.sh files EOL/carriage return type.
In other words, if it is Windows ("\r\n") then it will not work and return the ./ file not found error.
Convert it to unix type ("\n") using something like notepad++ and it will run fine.
(In notepad++ edit>EOL Conversion>Unix(LF) hit save and try again)

How to fix this strange doctrine error when doing a schema update

My dev environment on windows 8 has been running great but all of a sudden whenever i run:
php  bin/console doctrine:schema:update --force --env=test
I get a very odd error message:
All other developers are working completely fine in our master branch. I've deleted the project from my local system and repulled it from git and ran through the composer install process but no luck. That leads me to believe the problem is on my pc and not the project code.
Any ideas?
Are you sure that you are not using a backwards slash like in your screenshot:
php bin\console doctrine:schema:update --force --env=test
This produces (for me) the error:
Could not open input file:...
But if instead you use this:
php bin/console doctrine:schema:update --force --env=test
it works correct, also in case that doesn't work, try doubling up the forward slash like so:
php bin//console doctrine:schema:update --force --env=test
Turns out the copy paste of the command contained a special character. So frustrating!

which centos image can I use on aws with vagrant?

When I configure vagrant with aws plugin to use a centos image, I get the following error message:
sudo: sorry, you must have a tty to run sudo.
read somewhere that this means user is prompted for password when doing a sudo command.
but that is weird because the username for this machine is root..
How can I resolve this?
Defaults requiretty is a default for sudo so you have to have an controlling terminal, and it has been deemed useless and will be removed someday. So you can remove that line using visudo.
Source: https://unix.stackexchange.com/questions/122616/why-do-i-need-a-tty-to-run-sudo-if-i-can-sudo-without-a-password