Laravel sail artisan test is getting killed - laravel

I am trying to run a test using sail artisan test --filter=RestaurantAuthTest --verbose, the process is getting killed and I don't know why, I am getting the error below. I am using Laravel Sail on WSL; I am using PHP 8.0.7 and Laravel 8.40.. I haven't had much luck finding related issues online.
⨯ restaurant auth
---
• Tests\Feature\RestaurantAuthTest > restaurant auth
PHPUnit\Framework\Exception
Killed
at vendor/phpunit/phpunit/src/Util/PHP/AbstractPhpProcess.php:270
266▕
267▕ if (!empty($stderr)) {
268▕ $result->addError(
269▕ $test,
➜ 270▕ new Exception(trim($stderr)),
271▕ $time
272▕ );
273▕ } else {
274▕ set_error_handler(
1 vendor/phpunit/phpunit/src/Util/PHP/AbstractPhpProcess.php:187
PHPUnit\Util\PHP\AbstractPhpProcess::processChildResult()
2 vendor/phpunit/phpunit/src/Framework/TestCase.php:883
PHPUnit\Util\PHP\AbstractPhpProcess::runTestJob()
3 vendor/phpunit/phpunit/src/Framework/TestSuite.php:677
PHPUnit\Framework\TestCase::run()
4 vendor/phpunit/phpunit/src/Framework/TestSuite.php:677
PHPUnit\Framework\TestSuite::run()
5 vendor/phpunit/phpunit/src/Framework/TestSuite.php:677
PHPUnit\Framework\TestSuite::run()
6 vendor/phpunit/phpunit/src/TextUI/TestRunner.php:667
PHPUnit\Framework\TestSuite::run()
7 vendor/phpunit/phpunit/src/TextUI/Command.php:143
PHPUnit\TextUI\TestRunner::run()
8 vendor/phpunit/phpunit/src/TextUI/Command.php:96
PHPUnit\TextUI\Command::run()
9 vendor/phpunit/phpunit/phpunit:61
PHPUnit\TextUI\Command::main()
Tests: 1 failed
Time: 395.42s
Thanks

Related

Most metrics are N/A in HDP sandbox on Docker

I run the following on macOs Big Sur 11.6:
>>> docker start sandbox-hdp
>>> docker start sandbox-proxy
>>> docker ps
c39991e8397b hortonworks/sandbox-proxy:1.0 "nginx -g 'daemon of…" 7 hours ago Up 15 minutes 0.0.0.0:1080->1080/tcp, :::1080->1080/tcp, 0.0.0.0:1100->1100/tcp, :::1100->1100/tcp, 0.0.0.0:1111->1111/tcp, :::1111->1111/tcp, 0.0.0.0:1988->1988/tcp, :::1988->1988/tcp, 0.0.0.0:2100->2100/tcp, :::2100->2100/tcp, 0.0.0.0:2181-2182->2181-2182/tcp, :::2181-2182->2181-2182/tcp, 0.0.0.0:2201-2202->2201-2202/tcp, :::2201-2202->2201-2202/tcp, 0.0.0.0:2222->2222/tcp, :::2222->2222/tcp, 0.0.0.0:3000->3000/tcp, :::3000->3000/tcp, 0.0.0.0:4040->4040/tcp, :::4040->4040/tcp, 0.0.0.0:4200->4200/tcp, :::4200->4200/tcp, 0.0.0.0:4242->4242/tcp, :::4242->4242/tcp, 0.0.0.0:4557->4557/tcp, :::4557->4557/tcp, 0.0.0.0:5007->5007/tcp, :::5007->5007/tcp, 0.0.0.0:5011->5011/tcp, :::5011->5011/tcp, 0.0.0.0:6001->6001/tcp, :::6001->6001/tcp, 0.0.0.0:6003->6003/tcp, :::6003->6003/tcp, 0.0.0.0:6008->6008/tcp, :::6008->6008/tcp, 0.0.0.0:6080->6080/tcp, :::6080->6080/tcp, 0.0.0.0:6188->6188/tcp, :::6188->6188/tcp, 0.0.0.0:6627->6627/tcp, :::6627->6627/tcp, 0.0.0.0:6667-6668->6667-6668/tcp, :::6667-6668->6667-6668/tcp, 0.0.0.0:7777->7777/tcp, :::7777->7777/tcp, 0.0.0.0:7788->7788/tcp, :::7788->7788/tcp, 0.0.0.0:8000->8000/tcp, :::8000->8000/tcp, 0.0.0.0:8005->8005/tcp, :::8005->8005/tcp, 0.0.0.0:8020->8020/tcp, :::8020->8020/tcp, 0.0.0.0:8032->8032/tcp, :::8032->8032/tcp, 0.0.0.0:8040->8040/tcp, :::8040->8040/tcp, 0.0.0.0:8042->8042/tcp, :::8042->8042/tcp, 0.0.0.0:8080-8082->8080-8082/tcp, :::8080-8082->8080-8082/tcp, 0.0.0.0:8086->8086/tcp, :::8086->8086/tcp, 0.0.0.0:8088->8088/tcp, :::8088->8088/tcp, 0.0.0.0:8090-8091->8090-8091/tcp, :::8090-8091->8090-8091/tcp, 0.0.0.0:8188->8188/tcp, :::8188->8188/tcp, 0.0.0.0:8198->8198/tcp, :::8198->8198/tcp, 0.0.0.0:8443->8443/tcp, :::8443->8443/tcp, 0.0.0.0:8585->8585/tcp, :::8585->8585/tcp, 0.0.0.0:8744->8744/tcp, :::8744->8744/tcp, 0.0.0.0:8765->8765/tcp, :::8765->8765/tcp, 0.0.0.0:8886->8886/tcp, :::8886->8886/tcp, 0.0.0.0:8888-8889->8888-8889/tcp, :::8888-8889->8888-8889/tcp, 0.0.0.0:8983->8983/tcp, :::8983->8983/tcp, 0.0.0.0:8993->8993/tcp, :::8993->8993/tcp, 0.0.0.0:9000->9000/tcp, :::9000->9000/tcp, 0.0.0.0:9088-9091->9088-9091/tcp, :::9088-9091->9088-9091/tcp, 0.0.0.0:9995-9996->9995-9996/tcp, :::9995-9996->9995-9996/tcp, 0.0.0.0:10000-10002->10000-10002/tcp, :::10000-10002->10000-10002/tcp, 0.0.0.0:10015-10016->10015-10016/tcp, :::10015-10016->10015-10016/tcp, 0.0.0.0:10500->10500/tcp, :::10500->10500/tcp, 0.0.0.0:10502->10502/tcp, :::10502->10502/tcp, 0.0.0.0:11000->11000/tcp, :::11000->11000/tcp, 0.0.0.0:12049->12049/tcp, :::12049->12049/tcp, 0.0.0.0:12200->12200/tcp, :::12200->12200/tcp, 0.0.0.0:15000->15000/tcp, :::15000->15000/tcp, 0.0.0.0:15002->15002/tcp, :::15002->15002/tcp, 0.0.0.0:15500->15500/tcp, :::15500->15500/tcp, 0.0.0.0:16000->16000/tcp, :::16000->16000/tcp, 0.0.0.0:16010->16010/tcp, :::16010->16010/tcp, 0.0.0.0:16020->16020/tcp, :::16020->16020/tcp, 0.0.0.0:16030->16030/tcp, :::16030->16030/tcp, 0.0.0.0:18080-18081->18080-18081/tcp, :::18080-18081->18080-18081/tcp, 0.0.0.0:19888->19888/tcp, :::19888->19888/tcp, 0.0.0.0:21000->21000/tcp, :::21000->21000/tcp, 0.0.0.0:30800->30800/tcp, :::30800->30800/tcp, 0.0.0.0:33553->33553/tcp, :::33553->33553/tcp, 0.0.0.0:39419->39419/tcp, :::39419->39419/tcp, 0.0.0.0:42111->42111/tcp, :::42111->42111/tcp, 0.0.0.0:50070->50070/tcp, :::50070->50070/tcp, 0.0.0.0:50075->50075/tcp, :::50075->50075/tcp, 0.0.0.0:50079->50079/tcp, :::50079->50079/tcp, 0.0.0.0:50095->50095/tcp, :::50095->50095/tcp, 0.0.0.0:50111->50111/tcp, :::50111->50111/tcp, 0.0.0.0:60000->60000/tcp, :::60000->60000/tcp, 0.0.0.0:60080->60080/tcp, :::60080->60080/tcp, 0.0.0.0:61080->61080/tcp, :::61080->61080/tcp, 80/tcp, 0.0.0.0:61888->61888/tcp, :::61888->61888/tcp sandbox-proxy
bbb8ade50614 hortonworks/sandbox-hdp:3.0.1 "/usr/sbin/init" 7 hours ago Up 15 minutes 22/tcp, 4200/tcp, 8080/tcp
I then connect to localhost:8080 using maria_dev as username and password. I get the following view:
Which clearly indicates that nothing is working properly. Is this the expected behavior? If not so, then what should I do to get everything to work?
Yes, this is expected on a fresh start. No services within the Ambari Server/Hadoop cluster start automatically, and there will be no metrics until they do

Error when i try to create livewire component

I've installed laravel livewire on a Laravel 8 project, ad when i run the command php artisan make:livewire table the terminal shows this error:
ArgumentCountError
Too few arguments to function Illuminate\Support\Str::finish(), 1 passed in /Applications/MAMP/htdocs/cuoreLaravel/vendor/livewire/livewire/src/helpers.php on line 12 and exactly 2 expected
at vendor/laravel/framework/src/Illuminate/Support/Str.php:235
231▕ * #param string $value
232▕ * #param string $cap
233▕ * #return string
234▕ */
➜ 235▕ public static function finish($value, $cap)
236▕ {
237▕ $quoted = preg_quote($cap, '/');
238▕
239▕ return preg_replace('/(?:'.$quoted.')+$/u', '', $value).$cap;
+17 vendor frames
18 artisan:37
Illuminate\Foundation\Console\Kernel::handle(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
I've followed all the documentation installation steps, but I don't understand what the problem is.
I hope someone can help me :-) thanks
This happened to me after a fresh install of Livewire. Running php artisan optimize fixed it in my case. I have not found the exact reason, but I suspect some of the Livewire config needed to be included in the config cache first.
So either optimize, or clear the cached config completely.

Laravel, php artisan passport:install error

I was curious about setting up an API in Laravel using Passport so I followed their documentation here:
https://laravel.com/docs/5.6/passport
Once I run
php artisan passport:install
It gives me this error:
ErrorException : openssl_pkey_new(): private key length is too short; it needs to be at least 384 bits, not 0
at /Users/fantastisk/web/blog-laravel/vendor/phpseclib/phpseclib/phpseclib/Crypt/RSA.php:560
556| $config = array();
557| if (isset($this->configFile)) {
558| $config['config'] = $this->configFile;
559| }
> 560| $rsa = openssl_pkey_new(array('private_key_bits' => $bits) + $config);
561| openssl_pkey_export($rsa, $privatekey, null, $config);
562| $publickey = openssl_pkey_get_details($rsa);
563| $publickey = $publickey['key'];
564|
Exception trace:
1 openssl_pkey_new(["4096", "/Users/fantastisk/web/blog-laravel/vendor/phpseclib/phpseclib/phpseclib/Crypt/../openssl.cnf"])
/Users/fantastisk/web/blog-laravel/vendor/phpseclib/phpseclib/phpseclib/Crypt/RSA.php:560
2 phpseclib\Crypt\RSA::createKey("4096")
/Users/fantastisk/web/blog-laravel/vendor/laravel/passport/src/Console/KeysCommand.php:35
This is what i have in the openssl.cnf file
# minimalist openssl.cnf file for use with phpseclib
HOME = .
RANDFILE = $ENV::HOME/.rnd
distinguished_name = req_distinguished_name
[ v3_ca ]
I'm running on a mac with php 7.1 (i tried building it from source with openssl too), SSL Version => LibreSSL/2.0.20.
I tried following the documentation using homestead too, which gives me the exact same error.
To me it seems like there's a problem with the phpseclib library, but I haven't been able to find anything on google regarding this error.
As a final note, I tried running this command to check if openssl_pkey_new works:
openssl_pkey_new(array("digest_alg" => "sha512","private_key_bits" => 4096,"private_key_type" => OPENSSL_KEYTYPE_RSA,));
That worked with no error.
Any help or point in the right direction will be very much appreciated.
Try passing the length option as you run the install command:
php artisan passport:install --length=256
If that doesn't work then try forcing the key generation:
php artisan passport:key --force
You may need to run composer update prior.

Error using PHP_Depend and PHP_PMD

I have a problem using php Depend and PMD. When I use:
pdepend --summary-xml=/home/<mydirectory>/.sonar/pdepend.xml --suffix=php,php3,php4,php5,phtml,inc /home/<mydirectory>
this is the result:
Parsing...
.................................................. 1260
........................PHP Catchable fatal error: Argument 1 passed to PHP_Depend_Parser_UnexpectedTokenException::__construct() must be an instance of PHP_Depend_Token, integer given, called in /usr/share/php/PHP/Depend/Parser.php on line 5444 and defined in /usr/share/php/PHP/Depend/Parser/UnexpectedTokenException.php on line 70
PHP Stack trace:
PHP 1. {main}() /usr/bin/pdepend:0
PHP 2. PHP_Depend_TextUI_Command::main() /usr/bin/pdepend:78
PHP 3. PHP_Depend_TextUI_Command->run() /usr/share/php/PHP/Depend/TextUI/Command.php:679
PHP 4. PHP_Depend_TextUI_Runner->run() /usr/share/php/PHP/Depend/TextUI/Command.php:206
PHP 5. PHP_Depend->analyze() /usr/share/php/PHP/Depend/TextUI/Runner.php:331
PHP 6. PHP_Depend->performParseProcess() /usr/share/php/PHP/Depend.php:306
PHP 7. PHP_Depend_Parser->parse() /usr/share/php/PHP/Depend.php:560
PHP 8. PHP_Depend_Parser->parseOptionalStatement() /usr/share/php/PHP/Depend/Parser.php:370
PHP 9. PHP_Depend_Parser->parseIfStatement() /usr/share/php/PHP/Depend/Parser.php:5474
PHP 10. PHP_Depend_Parser->parseStatementBody() /usr/share/php/PHP/Depend/Parser.php:3195
PHP 11. PHP_Depend_Parser->parseStatement() /usr/share/php/PHP/Depend/Parser.php:2320
PHP 12. PHP_Depend_Parser_UnexpectedTokenException->__construct() /usr/share/php/PHP/Depend/Parser.php:5444
The same happens with:
phpmd /home/<mydirectory> xml /home/<mydirectory>/Sonar_Way_php.xml
PHP Catchable fatal error: Argument 1 passed to PHP_Depend_Parser_UnexpectedTokenException::__construct() must be an instance of PHP_Depend_Token, integer given, called in /usr/share/php/PHP/Depend/Parser.php on line 5444 and defined in /usr/share/php/PHP/Depend/Parser/UnexpectedTokenException.php on line 70
PHP Stack trace:
PHP 1. {main}() /usr/bin/phpmd:0
PHP 2. PHP_PMD_TextUI_Command::main() /usr/bin/phpmd:48
PHP 3. PHP_PMD_TextUI_Command->run() /usr/share/php/PHP/PMD/TextUI/Command.php:151
PHP 4. PHP_PMD->processFiles() /usr/share/php/PHP/PMD/TextUI/Command.php:129
PHP 5. PHP_PMD_Parser->parse() /usr/share/php/PHP/PMD.php:203
PHP 6. PHP_Depend->analyze() /usr/share/php/PHP/PMD/Parser.php:128
PHP 7. PHP_Depend->performParseProcess() /usr/share/php/PHP/Depend.php:306
PHP 8. PHP_Depend_Parser->parse() /usr/share/php/PHP/Depend.php:560
PHP 9. PHP_Depend_Parser->parseOptionalStatement() /usr/share/php/PHP/Depend/Parser.php:370
PHP 10. PHP_Depend_Parser->parseIfStatement() /usr/share/php/PHP/Depend/Parser.php:5474
PHP 11. PHP_Depend_Parser->parseStatementBody() /usr/share/php/PHP/Depend/Parser.php:3195
PHP 12. PHP_Depend_Parser->parseStatement() /usr/share/php/PHP/Depend/Parser.php:2320
PHP 13. PHP_Depend_Parser_UnexpectedTokenException->__construct() /usr/share/php/PHP/Depend/Parser.php:5444
¿Any sugestion? Thanks.
It's a bug of pdepend and pmd. In /usr/share/php/PHP/Depend/parser.php I changed:
private function parseStatement()
{
if (null === ($stmt = $this->parseOptionalStatement())) {
throw new PHP_Depend_Parser_UnexpectedTokenException(
$this->tokenizer->next(),
$this->sourceFile->getFileName()
);
}
return $stmt;
}
for this:
private function parseStatement()
{
if (null === ($stmt = $this->parseOptionalStatement())) {
throw new PHP_Depend_Parser_UnexpectedTokenException(
new PHP_Depend_Token,
$this->sourceFile->getFileName()
);
}
return $stmt;
}
I obtain only warnings and the process continue:
PHP Warning: Missing argument 1 for PHP_Depend_Token::__construct(), called in /usr/share/php/PHP/Depend/Parser.php on line 5442 and defined in /usr/share/php/PHP/Depend/Token.php on line 121
We can wait next upgrade ;)

Laravel 4 - Warning: Illegal offset type in isset or empty in \bootstrap\compiled.php

I'm having a hard time installing Laravel 4 on Windows 8 + Xampp.
Here's the setup:
- Xampp 1.8.1
- Composer is installed globally
I install Laravel with the usual "composer create-project laravel/laravel projectname". It installs fine.
But when I navigate to the public folder of the framework, I get dozens of Warning: Illegal offset type in isset or empty in \bootstrap\compiled.php errors.
On lines : 439, 221, 137, 154. The 4 errors are repeated indefinitely until the request times out.
Troubleshooting done so far:
- Tried on 2 seperate machines with the same setup.
- Re-ran Composer update.
- Instead of using create-project, I downloaded the framework and ran Composer install.
- Tried to setup up virtual hosts instead of accessing localhost/projectname/public.
- Searched online for 2 hours. Read every Laravel 4 install tutorial.
Any clues on what I might be doing wrong?
Thanks
-- EDIT --
Here are the lines causing the problem inside of compiled.php
Line 137 section :
$abstract = $this->getAlias($abstract);
if (isset($this->instances[$abstract])) {
return $this->instances[$abstract];
}
Line 154 section :
protected function getConcrete($abstract)
{
if (!isset($this->bindings[$abstract])) {
return $abstract;
} else {
return $this->bindings[$abstract]['concrete'];
}
}
Line 221 section :
protected function getAlias($abstract)
{
return isset($this->aliases[$abstract]) ? $this->aliases[$abstract] : $abstract;
}
Line 439 section :
public function make($abstract, $parameters = array())
{
if (isset($this->deferredServices[$abstract])) {
$this->loadDeferredProvider($abstract);
}
return parent::make($abstract, $parameters);
}
-- NEW FIND --
Using Wampserver works, instead of using Xampp.
Encountered the same error when using Xampp. I fixed it by disabling the eAccelerator extension in php.ini. Try commenting out the following line: zend_extension = "path\to\xampp\php\ext\php_eaccelerator_ts.dll" in your php.ini file.

Resources