I have a dockerized TYPO3 instance on a server and try to flush the typo3 cache manually.
So, I use the following command to do that, inside my docker container:
vendor/.bin/typo3cms cache:flush
However, it fails and returns this error:
[ TYPO3\CMS\Core\Error\Exception ]
Warning: rename(): The first argument to copy() function cannot be a directory in /home/app/vendor/typo3/cms/typo3/sysext/core/Classes/Utility/GeneralUtility.php line 2432
How I can debug this and find out what the problem is?
Full stack trace with -vvv
[ TYPO3\CMS\Core\Error\Exception ]
Warning: rename(): The first argument to copy() function cannot be a directory in /home/app/vendor/typo3/cms/typo3/sysext/core/Classes/Utili
ty/GeneralUtility.php line 2432
Exception code: 1
Exception trace:
#0 ()
vendor/helhum/typo3-console/Classes/Console/Error/ErrorHandler.php:86
#1 Helhum\Typo3Console\Error\ErrorHandler->handleError()
#2 rename()
typo3/sysext/core/Classes/Utility/GeneralUtility.php:2432
#3 TYPO3\CMS\Core\Utility\GeneralUtility::flushDirectory()
vendor/helhum/typo3-console/Classes/Compatibility/TYPO3v87/Service/CacheLowLevelCleaner.php:31
#4 Helhum\Typo3Console\TYPO3v87\Service\CacheLowLevelCleaner->forceFlushCachesFiles()
vendor/helhum/typo3-console/Classes/Console/Command/Cache/CacheFlushCommand.php:69
#5 Helhum\Typo3Console\Command\Cache\CacheFlushCommand->execute()
vendor/symfony/console/Command/Command.php:255
#6 Symfony\Component\Console\Command\Command->run()
vendor/symfony/console/Application.php:1000
#7 Symfony\Component\Console\Application->doRunCommand()
vendor/helhum/typo3-console/Classes/Console/Mvc/Cli/Symfony/Application.php:169
#8 Helhum\Typo3Console\Mvc\Cli\Symfony\Application->doRunCommand()
vendor/symfony/console/Application.php:271
#9 Symfony\Component\Console\Application->doRun()
vendor/symfony/console/Application.php:147
#10 Symfony\Component\Console\Application->run()
vendor/helhum/typo3-console/Classes/Console/Core/Kernel.php:148
#11 Helhum\Typo3Console\Core\Kernel->handle()
vendor/helhum/typo3-console/Scripts/typo3-console.php:30
#12 {closure}()
vendor/helhum/typo3-console/Scripts/typo3-console.php:32
#13 require()
vendor/helhum/typo3-console/typo3cms:3
cache:flush [--files-only]
This was a known issue and fixed with version 5.8.6 of the TYPO3 Console.
Well, the question was: How to debug this. Even if the problem is now solved, this may help:
You got the exception trace. You set a breakpoint in GeneralUtility.php line 2432.
If you already have xdebug set up, you only need to start the command line command with appropriate options, e.g with -e for generating debug information.
You can also look at DDEV. The last time I tried it, it worked pretty nicely to get the debugger to run, see https://ddev.readthedocs.io/en/stable/users/step-debugging/
I usually use xdebug in combination with PhpStorm.
Related
I want to download and use thyseus/yii2-message. followed steps on github.
for installation
1) $ composer require thyseus/yii2-message
2) $ php yii migrate/up --migrationPath=#vendor/thyseus/yii2-message/migrations
warning
PHP Warning: Module 'openssl' already loaded in Unknown on line 0
Warning: Module 'openssl' already loaded in Unknown on line 0
Exception 'yii\base\InvalidConfigException' with message 'The configuration for
the "user" component must contain a "class" element.'
in C:\xampp\htdocs\yii2-my-app2\vendor\yiisoft\yii2\di\ServiceLocator.php:204
Stack trace:
#0 C:\xampp\htdocs\yii2-my-app2\vendor\yiisoft\yii2\di\ServiceLocator.php(260):
yii\di\ServiceLocator->set('user', Array)
#1 C:\xampp\htdocs\yii2-my-app2\vendor\yiisoft\yii2\base\Component.php(172): yii
\di\ServiceLocator->setComponents(Array)
#2 C:\xampp\htdocs\yii2-my-app2\vendor\yiisoft\yii2\BaseYii.php(529): yii\base\C
omponent->__set('components', Array)
#3 C:\xampp\htdocs\yii2-my-app2\vendor\yiisoft\yii2\base\Object.php(105): yii\Ba
seYii::configure(Object(yii\console\Application), Array)
#4 C:\xampp\htdocs\yii2-my-app2\vendor\yiisoft\yii2\base\Application.php(205): y
ii\base\Object->__construct(Array)
#5 C:\xampp\htdocs\yii2-my-app2\vendor\yiisoft\yii2\console\Application.php(89):
yii\base\Application->__construct(Array)
#6 C:\xampp\htdocs\yii2-my-app2\yii(26): yii\console\Application->__construct(Ar
ray)
#7 {main}
PHP Core Warning 'yii\base\ErrorException' with message 'Module 'openssl' alread
y loaded'
in .\Unknown:0
Stack trace:
#0 [internal function]: yii\base\ErrorHandler->handleFatalError()
#1 {main}
1st command runs successfully but second command gives some warning I didnt get it? can anyone fix it? and I also want to know what does this migration command exactly do
For the warning, check answers to this question.
For the error: Yii2-user or another user extension has to be installed first and working.
MediaWiki suddenly came with 500 internal error
Fatal error: Uncaught Error: Call to a member function getCode() on
null in /var/www/wiki/includes/user/User.php:1578 Stack trace: #0
/var/www/wiki/includes/user/User.php(5243): User::getDefaultOptions()
#1 /var/www/wiki/includes/user/User.php(2859): User->loadOptions() #2 /var/www/wiki/includes/context/RequestContext.php(364):
User->getOption('language') #3
/var/www/wiki/includes/Message.php(380): RequestContext->getLanguage()
#4 /var/www/wiki/includes/Message.php(1257): Message->getLanguage() #5 /var/www/wiki/includes/Message.php(842): Message->fetchMessage() #6
/var/www/wiki/includes/Message.php(934): Message->toString('text') #7
/var/www/wiki/includes/exception/MWExceptionRenderer.php(254):
Message->text() #8
/var/www/wiki/includes/exception/MWExceptionRenderer.php(358):
MWExceptionRenderer::msg('dberr-again', 'Try waiting a f...') #9
/var/www/wiki/includes/exception/MWExceptionRenderer.php(52):
MWExceptionRenderer::reportOutageHTML(Object(Wikimedia\Rdbms\DBConnectionError))
#10 /var/www/wiki/includes/exception/MWExce in /var/www/wiki/includes/user/User.php on line 1578
I assume this is a bug that might happen if you have multiple install attempts and the mysql.user is still there. I had the same problem today.
I have filed the bug as:
https://phabricator.wikimedia.org/T177768
the Problem went away after reinstalling with the following steps:
dropping database
removing user from mysql.users
strangely the "user exists" error still appeared on installation
granting access rights was therefore necessary on the mysql database.
I've just installed MediaWiki 1.28 on arch linux with nginx 1.10.3, php 7.1.1, php-fpm, and sqlite 3.16.2. I followed the arch wiki guide: https://wiki.archlinux.org/index.php/MediaWiki. I've installed the required PHP extensions and PHP, sqlite, nginx all seem to run fine on their own.
Now when I'm trying to do the setting up LocalSettings.php part of the MediaWiki installation, I go to 0.0.0.0/mediawiki in the browser, click the setup and get the error below. Maybe it's a setting for sqlite that has to be enabled?
[1449c8c65e65734059748f4e] /mw-config/index.php MediaWiki\Services\ServiceDisabledException from line 340 of /usr/share/webapps/mediawiki/includes/services/ServiceContainer.php: Service disabled: DBLoadBalancer
Backtrace:
#0 /usr/share/webapps/mediawiki/includes/MediaWikiServices.php(509): MediaWiki\Services\ServiceContainer->getService(string)
#1 /usr/share/webapps/mediawiki/includes/GlobalFunctions.php(3089): MediaWiki\MediaWikiServices->getDBLoadBalancer()
#2 /usr/share/webapps/mediawiki/includes/GlobalFunctions.php(3075): wfGetLB(boolean)
#3 /usr/share/webapps/mediawiki/includes/cache/LinkCache.php(267): wfGetDB(integer)
#4 /usr/share/webapps/mediawiki/includes/Title.php(3184): LinkCache->addLinkObj(Title)
#5 /usr/share/webapps/mediawiki/includes/Title.php(934): Title->getArticleID(integer)
#6 /usr/share/webapps/mediawiki/includes/content/ContentHandler.php(282): Title->getContentModel()
#7 /usr/share/webapps/mediawiki/includes/Title.php(4684): ContentHandler::getForTitle(Title)
#8 /usr/share/webapps/mediawiki/includes/parser/Parser.php(867): Title->getPageLanguage()
#9 /usr/share/webapps/mediawiki/includes/parser/Parser.php(2110): Parser->getTargetLanguage()
#10 /usr/share/webapps/mediawiki/includes/parser/Parser.php(2075): Parser->replaceInternalLinks2(string)
#11 /usr/share/webapps/mediawiki/includes/parser/Parser.php(1290): Parser->replaceInternalLinks(string)
#12 /usr/share/webapps/mediawiki/includes/parser/Parser.php(441): Parser->internalParse(string)
#13 /usr/share/webapps/mediawiki/includes/installer/Installer.php(675): Parser->parse(string, Title, ParserOptions, boolean)
#14 /usr/share/webapps/mediawiki/includes/installer/WebInstaller.php(681): Installer->parse(string, boolean)
#15 /usr/share/webapps/mediawiki/includes/installer/WebInstaller.php(657): WebInstaller->getInfoBox(string, string, string)
#16 /usr/share/webapps/mediawiki/includes/installer/WebInstaller.php(401): WebInstaller->getErrorBox(string)
#17 /usr/share/webapps/mediawiki/mw-config/index.php(54): WebInstaller->showError(Message, string)
#18 /usr/share/webapps/mediawiki/mw-config/index.php(38): wfInstallerMain()
#19 {main}
The problem was I had my php/sessions directory in /tmp. I moved it to session.save_path = "/var/lib/php/sessions" in php.ini and repeated these steps:
mkdir -p /var/lib/php/sessions
chown http:http /var/lib/php/sessions
chmod go-rwx /var/lib/php/sessions
Regardless of what Tgr said above, fixing the sessions did fix the issue for me. I'm using Apache ITK so the resolution I use is slightly different since each virtual host runs under its own unique uid.
First I create a separate directory for the sessions and change ownership
mkdir /var/lib/php/sessions-wiki
chown wiki. /var/lib/php/sessions-wiki
Then in my VirtualHosts directive I tell Apache/php where to find the session files by adding
php_admin_value session.save_path "/var/lib/php/sessions-wiki"
Then to make sure your config didn't break it.
apachectl configtest
Finally reload your config
apachectl graceful
I've downloaded the chromium source and finally got it compiled. It took super long time to build the source.
I've followed the instruction in the official site
https://code.google.com/p/chromium/wiki/LinuxSUIDSandboxDevelopment
Unfortunately, the error is still there.
What I've done:
sudo cp out/Debug/chrome_sandbox /usr/local/sbin/chrome-devel-sandbox #needed if you build on NFS!
sudo chown root:root /usr/local/sbin/chrome-devel-sandbox
sudo chmod 4755 /usr/local/sbin/chrome-devel-sandbox
and I export this in my .bashrc
export CHROME_DEVEL_SANDBOX=/usr/local/sbin/chrome-devel-sandbox
and then I executed the executable and got the following error
chromium/src/out/Debug$./chrome
[22051:22051:0929/151724:FATAL:browser_main_loop.cc(160)] Running without the SUID sandbox! See https://code.google.com/p/chromium/wiki/LinuxSUIDSandboxDevelopment for more information on developing with the sandbox on.
#0 0x7f0051e91d3e base::debug::StackTrace::StackTrace()
#1 0x7f0051f01b05 logging::LogMessage::~LogMessage()
#2 0x7f0056a470f2 content::(anonymous namespace)::SetupSandbox()
#3 0x7f0056a46a16 content::BrowserMainLoop::EarlyInitialization()
#4 0x7f0056a52bb6 content::BrowserMainRunnerImpl::Initialize()
#5 0x7f0056a45c7f content::BrowserMain()
#6 0x7f0051e3a4af content::RunNamedProcessTypeMain()
#7 0x7f0051e3ca08 content::ContentMainRunnerImpl::Run()
#8 0x7f0051e39a95 content::ContentMain()
#9 0x7f0050d3aab5 ChromeMain
#10 0x7f0050d3aa62 main
#11 0x7f0047ef176d __libc_start_main
#12 0x7f0050d3a945 <unknown>
================================================================================
By following what official site suggests,
I ran a script and got the following message:
/chromium/src/build$ sudo ./update-linux-sandbox.sh
Your setuid sandbox is up to date
Make sure you have "export CHROME_DEVEL_SANDBOX=/usr/local/sbin/chrome-devel-sandbox" somewhere in your .bashrc
This variable is currently: empty
when I typed
echo $CHROME_DEVEL_SANDBOX
/usr/local/sbin/chrome-devel-sandbox:
So I guee the export works well.
I have searched around the answer to this question but no luck so far.
Any feedback will be appreciated. Thanks
Here is what I did:
build on a diff machine (in my case I used a server, Ubuntu 12.04)
copy to my laptop (Ubuntu 13.10)
run it
I was able to run it but unfortunately I am still not 100% sure what the problem was. :(
I guess the build environment would be different since I share the server with others.
Hope this helps,
What I'm trying to do :
Compile and run Chromium source code on Ubuntu 13.10
Steps I've taken :
git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
add to bashrc :
export PATH="$PATH":/home/y0.kim/project/depot_tools
export CHROME_DEVEL_SANDBOX=/usr/local/sbin/chrome-devel-sandbox
fetch --nohooks chromium --nosvn=True
git checkout master
build/install-build-deps.sh
git pull
gclient sync
ninja -C out/Debug chrome chrome_sandbox
build/update-linux-sandbox.sh
out/Debug/chrome -> Fail
out/Debug/chrome --no-sandbox -> Fail
Problem :
get the source code and compiled without problem.
However, when i execute chrome, i have below error
normal execution
:~/project2/src$ out/Debug/chrome
The setuid sandbox provides API version 1, but you need 0
Please read https://code.google.com/p/chromium/wiki/LinuxSUIDSandboxDevelopment.
[37555:37588:0616/152604:FATAL:browser_main_loop.cc(207)] <unknown>: Command line `dbus-launch --autolaunch=f271cc756e9c41e457760b8c00000496 --binary-syntax --close-stderr' exited with non-zero exit status 1: Autolaunch error: X11 initialization failed.\n
#0 0x7f570456a39d base::debug::StackTrace::StackTrace()
#1 0x7f57045bc51d logging::LogMessage::~LogMessage()
#2 0x7f5707e45cef content::(anonymous namespace)::GLibLogHandler()
#3 0x7f5701c20f61 g_logv
#4 0x7f5701c21172 g_log
#5 0x7f56f5240d2a <unknown>
#6 0x7f56f5241087 <unknown>
#7 0x7f5701c19d13 g_main_context_dispatch
#8 0x7f5701c1a060 <unknown>
#9 0x7f5701c1a45a g_main_loop_run
#10 0x7f56f524098b <unknown>
#11 0x7f5701c3b9b5 <unknown>
#12 0x7f56fdfd0e9a start_thread
#13 0x7f56fc1853fd clone
Aborted (core dumped)
execution with --no-sandbox
~/project2/src$ out/Debug/chrome --no-sandbox
[19653:19653:0616/152447:ERROR:browser_main_loop.cc(161)] Running without the SUID sandbox! See https://code.google.com/p/chromium/wiki/LinuxSUIDSandboxDevelopment for more information on developing with the sandbox on.
[19653:19656:0616/152447:FATAL:browser_main_loop.cc(207)] <unknown>: Command line `dbus-launch --autolaunch=f271cc756e9c41e457760b8c00000496 --binary-syntax --close-stderr' exited with non-zero exit status 1: Autolaunch error: X11 initialization failed.\n
#0 0x7f8f13bbe39d base::debug::StackTrace::StackTrace()
#1 0x7f8f13c1051d logging::LogMessage::~LogMessage()
#2 0x7f8f17499cef content::(anonymous namespace)::GLibLogHandler()
#3 0x7f8f11274f61 g_logv
#4 0x7f8f11275172 g_log
#5 0x7f8f05095d2a <unknown>
#6 0x7f8f05096087 <unknown>
#7 0x7f8f1126dd13 g_main_context_dispatch
#8 0x7f8f1126e060 <unknown>
#9 0x7f8f1126e45a g_main_loop_run
#10 0x7f8f0509598b <unknown>
#11 0x7f8f1128f9b5 <unknown>
#12 0x7f8f0d624e9a start_thread
#13 0x7f8f0b7d93fd clone
Aborted (core dumped)
:~/project2/src$ [0616/152448:ERROR:nacl_helper_linux.cc(277)] NaCl helper process running without a sandbox!
Most likely you need to configure your SUID sandbox correctly
steps i've tried to fix the problem:
went to https://code.google.com/p/chromium/wiki/LinuxSUIDSandboxDevelopment
read it
built chrome with chrome_sandbox again
ninja -C out/Debug chrome chrome_sandbox
executed build/update-linux-sandbox.sh again
checked again if ~/.bashrc have below line
export CHROME_DEVEL_SANDBOX=/usr/local/sbin/chrome-devel-sandbox
what i would like to know:
What should I do to execute Chrome on above situation?
What would be the reason that --no-sandbox option did not work?
any input would be highly appreciated.
Young.
This error message...
The setuid sandbox provides API version 1, but you need 0
...implies that your setuid binary is out of date hence the program was unable to initiate/spawn a new Browsing Context i.e. Chrome Browser session.
As per the documentation in Linux SUID Sandbox Development google-chrome needs a SUID helper binary to turn on the sandbox on Linux. In majority of the cases you can install the proper sandbox for you using the command:
build/update-linux-sandbox.sh
This program will install the proper sandbox for you in /usr/local/sbin and tell you to update your .bashrc if required.
However, there can be some exceptions as an example, if your setuid binary is out of date, you will get messages such as:
The setuid sandbox provides API version X, but you need Y
You are using a wrong version of the setuid binary!
In these cases, you need to follow the steps below:
Build chrome_sandbox whenever you build chrome (ninja -C xxx chrome chrome_sandbox instead of ninja -C xxx chrome)
After building, execute update-linux-sandbox.sh.
# needed if you build on NFS!
sudo cp out/Debug/chrome_sandbox /usr/local/sbin/chrome-devel-sandbox
sudo chown root:root /usr/local/sbin/chrome-devel-sandbox
sudo chmod 4755 /usr/local/sbin/chrome-devel-sandbox
Finally, you have to include the following line in your ~/.bashrc (or .zshenv):
export CHROME_DEVEL_SANDBOX=/usr/local/sbin/chrome-devel-sandbox
Reference
You can find the documentations in:
Issue 369100: ERROR:nacl_helper_linux.cc(233) NaCl helper process running without a sandbox!
Issue 318646: Chrome won't start after update to latest stable version
Issue 598454: Stop checking for the setuid sanbox binary on desktop Linux
tl; dr
Linux SUID Sandbox
I had a similar issue and when i run chrome with this flag it worked fine
--disable-setuid-sandbox