Whoops, looks like something went wrong. Laravel 5.1 - laravel

I have a route like this
http://localhost/inspection/show/{id}
When I try to load the route at the same time. In different tabs, sometimes some of those tabs has the error "Whoops, looks like something went wrong"
Loading in different tabs so fast
http://localhost/inspection/show/8
http://localhost/inspection/show/9
http://localhost/inspection/show/10
http://localhost/inspection/show/11
The stack trace have this
[2015-08-06 14:57:53] local.ERROR: exception 'RuntimeException' with message 'No supported encrypter found. The cipher and / or key length are invalid.' in C:\wamp\www\iaserver\vendor\laravel\framework\src\Illuminate\Encryption\EncryptionServiceProvider.php:29
Stack trace:
#0 C:\wamp\www\iaserver\vendor\laravel\framework\src\Illuminate\Container\Container.php(733): Illuminate\Encryption\EncryptionServiceProvider->Illuminate\Encryption\{closure}(Object(Illuminate\Foundation\Application), Array)
#1 C:\wamp\www\iaserver\vendor\laravel\framework\src\Illuminate\Container\Container.php(626): Illuminate\Container\Container->build(Object(Closure), Array)
#2 C:\wamp\www\iaserver\vendor\laravel\framework\src\Illuminate\Foundation\Application.php(674): Illuminate\Container\Container->make('encrypter', Array)
#3 C:\wamp\www\iaserver\vendor\laravel\framework\src\Illuminate\Container\Container.php(837): Illuminate\Foundation\Application->make('Illuminate\\Cont...')
#4 C:\wamp\www\iaserver\vendor\laravel\framework\src\Illuminate\Container\Container.php(800): Illuminate\Container\Container->resolveClass(Object(ReflectionParameter))
#5 C:\wamp\www\iaserver\vendor\laravel\framework\src\Illuminate\Container\Container.php(771): Illuminate\Container\Container->getDependencies(Array, Array)
#6 C:\wamp\www\iaserver\vendor\laravel\framework\src\Illuminate\Container\Container.php(626): Illuminate\Container\Container->build('IAServer\\Http\\M...', Array)
#7 C:\wamp\www\iaserver\vendor\laravel\framework\src\Illuminate\Foundation\Application.php(674): Illuminate\Container\Container->make('IAServer\\Http\\M...', Array)
#8 C:\wamp\www\iaserver\vendor\laravel\framework\src\Illuminate\Foundation\Http\Kernel.php(143): Illuminate\Foundation\Application->make('IAServer\\Http\\M...')
#9 C:\wamp\www\iaserver\public\index.php(58): Illuminate\Foundation\Http\Kernel->terminate(Object(Illuminate\Http\Request), Object(Illuminate\Http\Response))
#10 {main}
The .env file is correct, i re-run php artisan key:generate
APP_ENV=local
APP_DEBUG=true
APP_KEY=UC5Fsvi8JsGG4U72k04rS3o5csiINDYB
But the error still appears only when the route is quickly loaded with different id.
Why?
I solved, sometimes laravel not read APP_KEY in .ENV. And returns a value "SomeRandomString" (default is defined in config / app.php), and have the error "key length is invalid", so the solution is to copy the value of APP_KEY, to the value 'key 'in config / app.php, that's all! I solved!

You may try to run php artisan key:generate again, this should solve the problem.

Related

Why do I get an error in laravel 8 log but not in browser

I normally duplicate a project to start a new one. In the browser, there is no error. The page displays properly. In Laravel log I get the following error, although the file fn_table.php is there. If I remove the file, I get an error in the browser.
[2021-08-27 09:55:45] local.ERROR: include_once(public/fn/fn_table.php): Failed to open stream: No such file or directory {"exception":"[object] (ErrorException(code: 0): include_once(public/fn/fn_table.php): Failed to open stream: No such file or directory at /Users/paul/WebSites/MeerkatSafaris/app/Providers/AppServiceProvider.php:12)
[stacktrace]
#0 /Users/paul/WebSites/MeerkatSafaris/app/Providers/AppServiceProvider.php(12): Illuminate\\Foundation\\Bootstrap\\HandleExceptions->handleError(2, 'include_once(pu...', '/Users/paul/Web...', 12)
#1 /Users/paul/WebSites/MeerkatSafaris/app/Providers/AppServiceProvider.php(12): include_once()
#2 /Users/paul/WebSites/MeerkatSafaris/vendor/composer/ClassLoader.php(480): include('/Users/paul/Web...')
#3 /Users/paul/WebSites/MeerkatSafaris/vendor/composer/ClassLoader.php(346): Composer\\Autoload\\includeFile('/Users/paul/Web...')
#4 /Users/paul/WebSites/MeerkatSafaris/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(735): Composer\\Autoload\\ClassLoader->loadClass('App\\\\Providers\\\\A...')
#5 /Users/paul/WebSites/MeerkatSafaris/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(669): Illuminate\\Foundation\\Application->resolveProvider('App\\\\Providers\\\\A...')
#6 /Users/paul/WebSites/MeerkatSafaris/vendor/laravel/framework/src/Illuminate/Foundation/ProviderRepository.php(75): Illuminate\\Foundation\\Application->register('App\\\\Providers\\\\A...')
#7 /Users/paul/WebSites/MeerkatSafaris/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(649): Illuminate\\Foundation\\ProviderRepository->load(Array)
#8 /Users/paul/WebSites/MeerkatSafaris/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/RegisterProviders.php(17): Illuminate\\Foundation\\Application->registerConfiguredProviders()
#9 /Users/paul/WebSites/MeerkatSafaris/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(237): Illuminate\\Foundation\\Bootstrap\\RegisterProviders->bootstrap(Object(Illuminate\\Foundation\\Application))
#10 /Users/paul/WebSites/MeerkatSafaris/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(310): Illuminate\\Foundation\\Application->bootstrapWith(Array)
#11 /Users/paul/WebSites/MeerkatSafaris/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(127): Illuminate\\Foundation\\Console\\Kernel->bootstrap()
#12 Command line code(1): Illuminate\\Foundation\\Console\\Kernel->handle(Object(Symfony\\Component\\Console\\Input\\ArgvInput), Object(Symfony\\Component\\Console\\Output\\ConsoleOutput))
#13 {main}
What is happening?
In fact these errors are all over my project.
I learned how to create a file with global functions by listing their path in the autoload varibale in the composer.json. This is ok for functions used all over the project.
However, it happens that I need some global functions only in some controllers. I normally use php include_once which works 100% but generates the above error in the log.
What is the way around that?
And why is the laravel log reports an error on a file which is there?

Laravel: PHP artisan Command Stopped Working

php artisan --version
[Symfony\Component\Debug\Exception\FatalThrowableError]
Fatal error: Call to a member function getArgument() on null
Log files...
[2018-02-01 19:26:51] local.ERROR: Symfony\Component\Debug\Exception\FatalThrowableError: Fatal error: Call to a member function getArgument() on null in /Library/WebServer/vhosts/mysitename/vendor/laravel/framework/src/Illuminate/Console/Command.php:216
Stack trace:
#0 /Library/WebServer/vhosts/mysitename/app/Console/Commands/ReportMonthlyMembershipAircraftBreakdown.php(69): Illuminate\Console\Command->argument('email')
#1 [internal function]: App\Console\Commands\ReportMonthlyMembershipAircraftBreakdown->__construct()
#2 /Library/WebServer/vhosts/mysitename/vendor/laravel/framework/src/Illuminate/Container/Container.php(783): ReflectionClass->newInstanceArgs(Array)
#3 /Library/WebServer/vhosts/mysitename/vendor/laravel/framework/src/Illuminate/Container/Container.php(633): Illuminate\Container\Container->build('App\\Console\\Com...', Array)
#4 /Library/WebServer/vhosts/mysitename/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(697): Illuminate\Container\Container->make('App\\Console\\Com...', Array)
#5 /Library/WebServer/vhosts/mysitename/vendor/laravel/framework/src/Illuminate/Console/Application.php(115): Illuminate\Foundation\Application->make('App\\Console\\Com...')
#6 /Library/WebServer/vhosts/mysitename/vendor/laravel/framework/src/Illuminate/Console/Application.php(129): Illuminate\Console\Application->resolve('App\\Console\\Com...')
#7 /Library/WebServer/vhosts/mysitename/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(237): Illuminate\Console\Application->resolveCommands(Array)
#8 /Library/WebServer/vhosts/mysitename/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(107): Illuminate\Foundation\Console\Kernel->getArtisan()
#9 /Library/WebServer/vhosts/mysitename/artisan(35): Illuminate\Foundation\Console\Kernel->handle(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#10 {main}
I have deleted my entire vendor folder and tried to reinstate it, and it always gets to here and blows up with the same error.
Generating autoload files
> php artisan clear-compiled
[Symfony\Component\Debug\Exception\FatalThrowableError]
Fatal error: Call to a member function getArgument() on null
Here is my version pulled from the file, since I can't run an artisan --version to get it for you.
/**
* The Laravel framework version.
*
* #var string
*/
const VERSION = '5.2.32';
Just looking for any help you can give me. This has happened on both my local copy and the site copy
The problem came from having the command
$this->argument in the contructor and not in the handle method.
I just never expected that a console file would stop php artisan --version from stopping to work because of a command file that was not going to be run yet.
Thanks btl for getting me on the right direction.
You have an error in your code somewhere most likely which is giving you this error. Do a global search on getArgument() and see where it can be coming from.
[internal function]: App\Console\Commands\ReportMonthlyMembershipAircraftBreakdown

Artisan won't work in production but works fine locally

I am pulling my hair out over a problem in production: I cannot get my migrations to run. And, not only that but simply running 'php artisan' generates an error. The odd thing is that everything is working fine locally.
I am using Laravel 5.1 and have tried re-cloning my app on the server, re-installing vendor (after flushing the composer cache), redoing .env and giving permissions to the appropriate bootstrap/cache and storage files. I have also manually dropped all of my tables and then, when that didn't work, deleted and remade the database itself. I have run 'composer dump-autoload' many times as I tried to isolate the source of the problem with no luck.
I had a look at my log file and this is what comes up:
[2016-06-24 06:07:16] production.ERROR: exception 'ErrorException' with message 'Trying to get property of non-object' in /var/www/html/foobooks/app/Services/PrivacyService.php:157
Stack trace:
#0 /var/www/html/foobooks/app/Services/PrivacyService.php(157): Illuminate\Foundation\Bootstrap\HandleExceptions->handleError(8, 'Trying to get p...', '/var/www/html/l...', 157, Array)
#1 /var/www/html/foobooks/app/Services/DateService.php(69): Foobooks\Services\PrivacyService->getPrivacyLevelIdWithPrivacyLevel('everyone')
#2 /var/www/html/foobooks/vendor/laravel/framework/src/Illuminate/Cache/Repository.php(239): Foobooks\Services\DateService->Foobooks\Services\{closure}()
#3 [internal function]: Illuminate\Cache\Repository->rememberForever('everyone_privac...', Object(Closure))
#4 /var/www/html/foobooks/vendor/laravel/framework/src/Illuminate/Cache/CacheManager.php(318): call_user_func_array(Array, Array)
#5 /var/www/html/foobooks/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php(217): Illuminate\Cache\CacheManager->__call('rememberForever', Array)
#6 /var/www/html/foobooks/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php(217): Illuminate\Cache\CacheManager->rememberForever('everyone_privac...', Object(Closure))
#7 /var/www/html/foobooks/app/Services/DateService.php(70): Illuminate\Support\Facades\Facade::__callStatic('rememberForever', Array)
#8 /var/www/html/foobooks/app/Services/DateService.php(70): Illuminate\Support\Facades\Cache::rememberForever('everyone_privac...', Object(Closure))
#9 [internal function]: Foobooks\Services\DateService->__construct(Object(Foobooks\Repositories\Models\DbEventRepository), Object(Foobooks\Services\PrivacyService), Object(Foobooks\$
#10 /var/www/html/foobooks/vendor/laravel/framework/src/Illuminate/Container/Container.php(780): ReflectionClass->newInstanceArgs(Array)
#11 /var/www/html/foobooks/vendor/laravel/framework/src/Illuminate/Container/Container.php(631): Illuminate\Container\Container->build('Foobooks\...', Array)
#12 /var/www/html/foobooks/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(674): Illuminate\Container\Container->make('Foobooks\...', Array)
#13 /var/www/html/foobooks/vendor/laravel/framework/src/Illuminate/Container/Container.php(220): Illuminate\Foundation\Application->make('Foobooks\...', Array)
#14 /var/www/html/foobooks/vendor/laravel/framework/src/Illuminate/Container/Container.php(738): Illuminate\Container\Container->Illuminate\Container\{closure}(Object(Illuminate\Foundation\Application), Array)
#15 /var/www/html/foobooks/vendor/laravel/framework/src/Illuminate/Container/Container.php(631): Illuminate\Container\Container->build(Object(Closure), Array)
#16 /var/www/html/foobooks/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(674): Illuminate\Container\Container->make('Foobooks\...', Array)
#17 /var/www/html/foobooks/vendor/laravel/framework/src/Illuminate/Container/Container.php(842): Illuminate\Foundation\Application->make('Foobooks\...')
#18 /var/www/html/foobooks/vendor/laravel/framework/src/Illuminate/Container/Container.php(805): Illuminate\Container\Container->resolveClass(Object(ReflectionParameter))
#19 /var/www/html/foobooks/vendor/laravel/framework/src/Illuminate/Container/Container.php(776): Illuminate\Container\Container->getDependencies(Array, Array)
#20 /var/www/html/foobooks/vendor/laravel/framework/src/Illuminate/Container/Container.php(631): Illuminate\Container\Container->build('Foobooks\...', Array)
#21 /var/www/html/foobooks/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(674): Illuminate\Container\Container->make('Foobooks\...', Array)
#22 /var/www/html/foobooks/vendor/laravel/framework/src/Illuminate/Console/Application.php(115): Illuminate\Foundation\Application->make('Foobooks\...')
#23 /var/www/html/foobooks/vendor/laravel/framework/src/Illuminate/Console/Application.php(129): Illuminate\Console\Application->resolve('Foobooks\...')
#24 /var/www/html/foobooks/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(226): Illuminate\Console\Application->resolveCommands(Array)
#25 /var/www/html/foobooks/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(107): Illuminate\Foundation\Console\Kernel->getArtisan()
#26 /var/www/html/foobooks/artisan(36): Illuminate\Foundation\Console\Kernel->handle(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#27 {main}
The app seems to be actually trying to instantiate my class DateService somewhere in the autoload process (which in turn instantiates PrivacyService) and this is what is causing the problem. I have searched my app for all instances where it is injected but none seem to be part of the autoloading process - and, it doesn't explain why things are working just fine locally.
Initially, when artisan complained, it gave me a 'missing base table error' and, for whatever reason, if I 'fake' created the table in database and then dropped it manually, the app moved on to complaining about another table until I did the manual create/drop again. I was able to move through table errors this way until I hit this 'Trying to get property of non-object' error.
Does anyone have any idea what might be the problem? It feels like there is some kind of database caching file that I don't know about that is hanging about somewhere and causing this problem, making the app think the migrations/seeds have already occurred. It just seems odd that creating fake tables and dropping them seemed to be doing something until this error popped up - also, odd that only the production environment is affected.
Any help or insight would be greatly appreciated - thank you!
The solution: for some reason the permissions were different on some folders in my cache folder than others so the flush() method did not fully clear the cache. Legacy folders/files were conflicting with artisan's bootstrapping efforts. I was able to solve the problem by reapplying permissions to the storage/framework/cache directory, running flush() again. Once I did and made sure that ALL subfolders and files were deleted from the cache, I was able to run php artisan without a hitch.

Fatal Error Magento Backend for UnSecure Address Change

I have SSL. i searching mysql request CPU usage in SSL SSH or Apache Subjects.
im try on this, my unsecure address is,
UnSecure Address: https://www.example.com
to change
UnSecure Address: http://www.example.com
and my admin panel is down. Error is;
Fatal Error "Class 'Mgt_Base_Helper_Data' not found in /home/server/public_html/app/Mage.php on line 546
And now my backend
There has been an error processing your request
Mage registry key "_singleton/mgt_base/feed" already exists
Trace:
#0 /home/server/public_html/app/Mage.php(222): Mage::throwException('Mage registry k...')
#1 /home/server/public_html/app/Mage.php(476): Mage::register('_singleton/mgt_...', false)
#2 /home/server/public_html/includes/src/__default.php(21330): Mage::getSingleton('mgt_base/feed')
#3 /home/server/public_html/app/Mage.php(447): Mage_Core_Model_App->dispatchEvent('adminhtml_contr...', Array)
#4 /home/server/public_html/includes/src/Mage_Adminhtml_Controller_Action.php(159): Mage::dispatchEvent('adminhtml_contr...', Array)
#5 /home/server/public_html/includes/src/__default.php(13861): Mage_Adminhtml_Controller_Action->preDispatch()
#6 /home/server/public_html/includes/src/__default.php(18234): Mage_Core_Controller_Varien_Action->dispatch('login')
#7 /home/server/public_html/includes/src/__default.php(17768): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#8 /home/server/public_html/includes/src/__default.php(20368): Mage_Core_Controller_Varien_Front->dispatch()
#9 /home/server/public_html/app/Mage.php(683): Mage_Core_Model_App->run(Array)
#10 /home/server/public_html/index.php(87): Mage::run('', 'store')
#11 {main}
How can i fix this previous setings or How can i set unsecure adress without backend?
Thanx.
It looks like you have install magento in PHP 5.4. Apply magento patch for PHP 5.4 or downgradr PHP to 5.3, and then clear cache (flush storage)

Problem with Doctrine_Expression (Doctrine 2) 'There is no open connection'

I have Doctrine2 working fine with my Zend PHP stack.
However if I want to use Doctrine_Expression,
$item->setDateCreated(new Doctrine_Expression('NOW()'));
then I get following error 'There is no open connection'.
This is stack trace:
#0 D:\data\wamp\bin\php\php5.3.5\PEAR\Doctrine\Manager.php(264): Doctrine_Manager->getCurrentConnection()
#1 D:\data\wamp\bin\php\php5.3.5\PEAR\Doctrine\Expression.php(72): Doctrine_Manager::connection()
#2 D:\data\wamp\bin\php\php5.3.5\PEAR\Doctrine\Expression.php(116): Doctrine_Expression->getConnection()
#3 D:\data\wamp\bin\php\php5.3.5\PEAR\Doctrine\Expression.php(133): Doctrine_Expression->parseExpression('NOW()')
#4 D:\data\wamp\bin\php\php5.3.5\PEAR\Doctrine\Expression.php(89): Doctrine_Expression->parseClause('NOW()')
#5 D:\data\wamp\bin\php\php5.3.5\PEAR\Doctrine\Expression.php(60): Doctrine_Expression->setExpression('NOW()')
#6 D:\data\work\gazette\Projects\NorskTipping\admin-system\code\application\library\MagicHeads\Knalledge\Models\Tagging.php(91): Doctrine_Expression->__construct('NOW()')
...
#14 {main}
I tried to add connection
$item->setDateCreated(new Doctrine_Expression('NOW()', $this->_em->getConnection()));
However, it happens it is connection of type Doctrine\DBAL\Connection while Doctrine_Expression requires Doctrine_Connection
How I can get Doctrine_Connection and provide it to Doctrine_Expression?
Doctrine_Expression is a Doctrine 1 class and can not be used with Doctrine 2. The two versions are very different and not compatible.

Resources