exception 'Drush\User\UserListException' with message Unable to find a matching user for admin - gitlab

I am using the drupal7 I have been executed this command in git bash -./prepare_db_for_dev.example.sh
In below, it give error.
Reset admin password to "admin".
Drush\User\UserListException: Unable to find a matching user for admin.
In C:\Users\patil.vaish\AppData\Roaming\Composer\vendor\drush\drush\lib\Drush\User\UserList.php:114 [error]
Stack trace:
#0 C:\Users\patil.vaish\AppData\Roaming\Composer\vendor\drush\drush\lib\Drush\User\UserList.php(15): Drush\User\UserList::getFromParameters(Array)
#1 C:\Users\patil.vaish\AppData\Roaming\Composer\vendor\drush\drush\commands\user\user.drush.inc(355): Drush\User\UserList->__construct('admin')
#2 C:\Users\patil.vaish\AppData\Roaming\Composer\vendor\drush\drush\includes\command.inc(422): drush_user_password('admin')
#3 C:\Users\patil.vaish\AppData\Roaming\Composer\vendor\drush\drush\includes\command.inc(231): _drush_invoke_hooks(Array, Array)
#4 C:\Users\patil.vaish\AppData\Roaming\Composer\vendor\drush\drush\includes\command.inc(199): drush_command('admin')
#5 C:\Users\patil.vaish\AppData\Roaming\Composer\vendor\drush\drush\lib\Drush\Boot\BaseBoot.php(67): drush_dispatch(Array)
#6 C:\Users\patil.vaish\AppData\Roaming\Composer\vendor\drush\drush\includes\preflight.inc(66): Drush\Boot\BaseBoot->bootstrap_and_dispatch()
#7 C:\Users\patil.vaish\AppData\Roaming\Composer\vendor\drush\drush\drush.php(12): drush_main()
#8 {main}
How to solve the error?

This issue suggests:
If admin username in database is different than configuration ADMIN_USER [you get this error]
Solution for drupal 7:
self.run('sql-query --db-prefix "update {users} set name=\'%s\' where uid=1"' % self.config.DRUPAL['default']['ADMIN_USER'])
Solution for drupal 8:
self.run('sql-query --db-prefix "update {users_field_data} set name=\'%s\' where uid=1"' % self.config.DRUPAL['default']['ADMIN_USER'])

Related

snap install of Viber on Ubuntu 20.04 Focal Fossa Linux produces permission denied error

I have tried two different Viber packages available through snap, viber-unofficial.viber and viber-mtd.viber. Both packages produce the exact same error about WebEngine resources not found
sh: 1: xdg-mime: not found
Qt WebEngine ICU data not found at /snap/viber-unofficial/37/opt/viber/resources. Trying parent directory...
Qt WebEngine resources not found at /snap/viber-unofficial/37/opt/viber/resources. Trying parent directory...
[557326:557326:1013/081811.896484:FATAL:credentials.cc(155)] Check failed: NamespaceUtils::DenySetgroups(). : Permission denied
#0 0x7f5a59d4d11e base::debug::StackTrace::StackTrace()
#1 0x7f5a59d5dbde logging::LogMessage::~LogMessage()
#2 0x7f5a59d5de99 logging::ErrnoLogMessage::~ErrnoLogMessage()
#3 0x7f5a5aa4ff7c sandbox::(anonymous namespace)::SetGidAndUidMaps()
#4 0x7f5a5aa505d5 sandbox::Credentials::CanCreateProcessInNewUserNS()
#5 0x7f5a599c0de5 content::ZygoteHostImpl::Init()
#6 0x7f5a59673314 content::BrowserMainLoop::EarlyInitialization()
#7 0x7f5a59677190 content::BrowserMainRunnerImpl::Initialize()
#8 0x7f5a5947cd19 QtWebEngineCore::WebEngineContext::WebEngineContext()
#9 0x7f5a5947e135 QtWebEngineCore::WebEngineContext::current()
#10 0x7f5a5941b931 QtWebEngineCore::BrowserContextAdapter::defaultContext()
#11 0x7f5a6258c618 QQuickWebEngineProfile::defaultProfile()
#12 0x0000006ac8bf ApplicationPrivate::preRunningInitialization()
#13 0x0000006a6504 ViberApplication::start()
#14 0x00000067e25b ViberMain()
#15 0x7f5a56403840 __libc_start_main
#16 0x0000004d7047 <unknown>
Qt WebEngine ICU data not found at /snap/viber-unofficial/37/opt/viber/resources. Trying parent directory...
Qt WebEngine resources not found at /snap/viber-unofficial/37/opt/viber/resources. Trying parent directory...
I have looked at the permissions of the various directories and I don't see anything obvious other than everything in the snap package is all owned by root/root and the regular user trying to actually run the viber app does not have any write permission into these directories.

Why are /var/cache and /var/log created as www-data user (shopware6)

Why does Shopware installer (version 6.4.14.0, dedicated Ubuntu 18.04) is using www-data user as an owner of the resources in /var/cache and /var/log directories, even though the user that is running apache is different?
When I upload the package and try to install it I've got following errors:
Fatal error: Uncaught RuntimeException: Unable to create the "cache" directory (/var/www/shopware/var/cache/prod_h9d31c36e0ebc8a2d9604631b55f50e36). in /var/www/shopware/vendor/symfony/http-kernel/Kernel.php:638 Stack trace: #0 /var/www/shopware/vendor/symfony/http-kernel/Kernel.php(545): Symfony\Component\HttpKernel\Kernel->buildContainer() #1 /var/www/shopware/vendor/shopware/core/Kernel.php(191): Symfony\Component\HttpKernel\Kernel->initializeContainer() #2 /var/www/shopware/vendor/shopware/recovery/Install/src/app.php(46): Shopware\Core\Kernel->boot() #3 /var/www/shopware/vendor/shopware/recovery/Install/index.php(74): getApplication() #4 /var/www/shopware/public/recovery/install/index.php(6): require_once('...') #5 {main} thrown in /var/www/shopware/vendor/symfony/http-kernel/Kernel.php on line 638
Fatal error: Uncaught RuntimeException: Unable to write in the "logs" directory (/var/www/shopware/var/log). in /var/www/shopware/vendor/symfony/http-kernel/Kernel.php:641 Stack trace: #0 /var/www/shopware/vendor/symfony/http-kernel/Kernel.php(545): Symfony\Component\HttpKernel\Kernel->buildContainer() #1 /var/www/shopware/vendor/shopware/core/Kernel.php(191): Symfony\Component\HttpKernel\Kernel->initializeContainer() #2 /var/www/shopware/vendor/shopware/recovery/Install/src/app.php(46): Shopware\Core\Kernel->boot() #3 /var/www/shopware/vendor/shopware/recovery/Install/index.php(74): getApplication() #4 /var/www/shopware/public/recovery/install/index.php(6): require_once('...') #5 {main} thrown in /var/www/shopware/vendor/symfony/http-kernel/Kernel.php on line 641
After changing the permission (777) for /var/cache and /var/log installer starts, and it creates directory and file that are owned by www-data [Terminal][1]
Is there some env variable that installer use to perform above actions as a www-data user? If so, where can I find it?
A lot of questions.
Why does Shopware installer ... apache is different?
Apache often runs as www-data. What user is your apache running?
Is there some env variable ... can I find it?
This is a quit general question. Would be possible. But, I did not often see this. Execute set in a terminal an see all of the env variables.

Fatal error: Uncaught Cassandra\Exception\RuntimeException: Keyspace 'opspot' does not exist in

Though I am using the docker facing this issue. The same things are working fine on other systems
Fatal error: Uncaught Cassandra\Exception\RuntimeException: Keyspace 'opspot' does not exist in /var/www/Opspot/engine/Core/Data/Cassandra/Client.php:32 Stack trace: #0 /var/www/Opspot/engine/Core/Data/Cassandra/Client.php(32): Cassandra\DefaultCluster->connect('opspot') #1 /var/www/Opspot/engine/Core/Data/DataProvider.php(38): Opspot\Core\Data\Cassandra\Client->__construct() #2 [internal function]: Opspot\Core\Data\DataProvider->Opspot\Core\Data{closure}(Object(Opspot\Core\Di\Di)) #3 /var/www/Opspot/engine/Core/Di/Di.php(25): call_user_func(Object(Closure), Object(Opspot\Core\Di\Di)) #4 /var/www/Opspot/engine/Core/Blogs/Legacy/Repository.php(43): Opspot\Core\Di\Di->get('Database\Cassan...') #5 /var/www/Opspot/engine/Core/Blogs/Repository.php(29): Opspot\Core\Blogs\Legacy\Repository->__construct() #6 /var/www/Opspot/engine/Core/Blogs/Manager.php(46): Opspot\Core\Blogs\Repository->__construct() #7 /var/www/Opspot/engine/Core/Blogs/Events.php(23): Opspot\Core\Blogs\Manager->__construct() #8 /var/www/Opspot/engine/Core/Eve in /var/www/Opspot/engine/Core/Data/Cassandra/Client.php on line 32
Warning: Cannot modify header information - headers already sent in /var/www/Opspot/engine/lib/elgglib.php on line 985
An error occurred.
Sorry, the page you are looking for is currently unavailable.
Please try again later.

change layout in different module on zf3

while i change layout in different mudule on zf3, there is a error caused.
Fatal error: Uncaught Zend\Router\Exception\RuntimeException: Route with name "" not found in /mnt/shared/zf3.local/vendor/zendframework/zend-router/src/Http/TreeRouteStack.php:354 Stack trace: #0 /mnt/shared/zf3.local/vendor/zendframework/zend-view/src/Helper/Url.php(106): Zend\Router\Http\TreeRouteStack->assemble(Array, Array) #1 [internal function]: Zend\View\Helper\Url->__invoke('/passport') #2 /mnt/shared/zf3.local/vendor/zendframework/zend-view/src/Renderer/PhpRenderer.php(397): call_user_func_array(Object(Zend\View\Helper\Url), Array) #3 /mnt/shared/zf3.local/module/Passport/view/layout/layout.phtml(42): Zend\View\Renderer\PhpRenderer->__call('url', Array) #4 /mnt/shared/zf3.local/vendor/zendframework/zend-view/src/Renderer/PhpRenderer.php(505): include('/mnt/shared/zf3...') #5 /mnt/shared/zf3.local/vendor/zendframework/zend-view/src/View.php(207): Zend\View\Renderer\PhpRenderer->render() #6 /mnt/shared/zf3.local/vendor/zendframework/zend-mvc/src/View/Http/DefaultRenderingStrategy.php(105): Zend\View\View->render(O in /mnt/shared/zf3.local/vendor/zendframework/zend-router/src/Http/TreeRouteStack.php on line 354
i have no idea to solve this problem.
i used the tutorial :
How to set different layouts for different modules in Zend Framework 3
You can check implementation or just use this module
Change layout per module

icingaweb2 Permission denied

Please help me to solve this issue with icingaweb
icinga2: Can't send external Icinga command to the local command file "/var/run/icinga2/cmd/icinga2.cmd": Permission denied.
#0 /usr/share/icingaweb2/modules/monitoring/application/forms/Command/Object/ScheduleServiceDowntimeCommandForm.php(191): Icinga\Module\Monitoring\Command\Transport\CommandTransport->send(Object(Icinga\Module\Monitoring\Command\Object\ScheduleHostDowntimeCommand))
#1 /usr/share/icingaweb2/modules/monitoring/application/forms/Command/Object/ScheduleHostDowntimeCommandForm.php(108): Icinga\Module\Monitoring\Forms\Command\Object\ScheduleServiceDowntimeCommandForm->scheduleDowntime(Object(Icinga\Module\Monitoring\Command\Object\ScheduleHostDowntimeCommand), Object(Icinga\Web\Request))
#2 /usr/share/php/Icinga/Web/Form.php(1152): Icinga\Module\Monitoring\Forms\Command\Object\ScheduleHostDowntimeCommandForm->onSuccess()
#3 /usr/share/icingaweb2/modules/monitoring/library/Monitoring/Web/Controller/MonitoredObjectController.php(128): Icinga\Web\Form->handleRequest()
#4 /usr/share/icingaweb2/modules/monitoring/application/controllers/HostController.php(155): Icinga\Module\Monitoring\Web\Controller\MonitoredObjectController->handleCommandForm(Object(Icinga\Module\Monitoring\Forms\Command\Object\ScheduleHostDowntimeCommandForm))
#5 /usr/share/php/Zend/Controller/Action.php(516): Icinga\Module\Monitoring\Controllers\HostController->scheduleDowntimeAction()
#6 /usr/share/php/Icinga/Web/Controller/Dispatcher.php(76): Zend_Controller_Action->dispatch('scheduleDowntim...')
#7 /usr/share/php/Zend/Controller/Front.php(954): Icinga\Web\Controller\Dispatcher->dispatch(Object(Icinga\Web\Request), Object(Icinga\Web\Response))
#8 /usr/share/php/Icinga/Application/Web.php(384): Zend_Controller_Front->dispatch(Object(Icinga\Web\Request), Object(Icinga\Web\Response))
#9 /usr/share/php/Icinga/Application/webrouter.php(109): Icinga\Application\Web->dispatch()
#10 /usr/share/icingaweb2/public/index.php(4): require_once('/usr/share/php/...')
#11 {main}
In my case (CentOS 7) all I had to do was to ensure the icinga2 feature 'command' was enabled, and restart the service.
icinga2 feature enable command
systemctl restart icinga2.service
The error message is probably correct. You'll need to setup the correct unix permissions for that file. The CentOS7 packages do the right thing there, but for me the problem was related to selinux. Check SELinux denials to see if your commands are being denied:
ausearch -m avc --start recent
Check the context of the command file:
# ls -lZ /var/run/icinga2/cmd/icinga2.cmd
prw-rw----. icinga icingacmd system_u:object_r:var_run_t:s0 /var/run/icinga2/cmd/icinga2.cmd
I fixed this by installing the icinga2-selinux package after all the other configuration. In particular, you need to (re)install it after enabling the local (named pipe) command transport. After re-installing icinga2-selinux, the correct context should be:
# ls -lZ /var/run/icinga2/cmd/icinga2.cmd
prw-rw----. icinga icingacmd system_u:object_r:icinga2_command_t:s0 /var/run/icinga2/cmd/icinga2.cmd
Restart icinga2 and Apache.
Disabling selinux will help.
Temp disable selinux and try again.
setenforce 0
If it works, try a permanent one.
Edit /etc/selinux/config and make sure
SELINUX=disabled

Resources