Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

500 internal server error opening localhost/Cachet/public on a fresh installation. #1560

Closed
andreabisello opened this issue Feb 25, 2016 · 9 comments
Assignees
Milestone

Comments

@andreabisello
Copy link

Hi
i installed cachet following those instruction https://docs.cachethq.io/docs/installing-cachet but opening localhost/Cachet/public i obtain a 500 internal server error without any other information.

please can you help me?

some informations :

local environment, linux mint, root user
every package are up to date

apache2 running, serving on /var/etc/www

qa-asus Cachet # mysql --version
mysql Ver 14.14 Distrib 5.5.47, for debian-linux-gnu (x86_64) using readline 6.3

qa-asus Cachet # php --version
PHP 5.5.9-1ubuntu4.14 (cli) (built: Oct 28 2015 01:34:46)
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2014 Zend Technologies
with Zend OPcache v7.0.3, Copyright (c) 1999-2014, by Zend Technologies

mysql installed

a database called cachet with an user called cachet and no password created (see screenshot)

git cloned, last tag used, no problem with composer install, no problem with php artisan key:generate and app:install and rm -rf bootstrap/cache/* launched.

this is the .env file

APP_ENV=production
APP_DEBUG=true
APP_URL=http://localhost/Cachet/public
APP_KEY=W4q2fmoADhkokOKeAQQrpmImcNYiKPvc

DB_DRIVER=mysql
DB_HOST=localhost
DB_DATABASE=cachet
DB_USERNAME=cachet
DB_PASSWORD=
DB_PORT=3306

CACHE_DRIVER=file
SESSION_DRIVER=file
QUEUE_DRIVER=database
CACHET_EMOJI=false

MAIL_DRIVER=smtp
MAIL_HOST=mailtrap.io
MAIL_PORT=2525
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ADDRESS=null
MAIL_NAME=null
MAIL_ENCRYPTION=tls

REDIS_HOST=null
REDIS_DATABASE=null
REDIS_PORT=null

GITHUB_TOKEN=null

my webserver normally serve pages, but cachet doesn't works.

opening /var/log/apache2/error.log i see

[Thu Feb 25 16:49:37.113209 2016] [:error] [pid 11045] [client 127.0.0.1:36524] PHP Fatal error: Uncaught exception 'UnexpectedValueException' with message 'The stream or file "/var/www/Cachet/storage/logs/laravel-2016-02-25.log" could $
[Thu Feb 25 16:49:37.114009 2016] [:error] [pid 11045] [client 127.0.0.1:36524] PHP Fatal error: Uncaught exception 'UnexpectedValueException' with message 'The stream or file "/var/www/Cachet/storage/logs/laravel-2016-02-25.log" could $

then i look for /var/www/Cachet/storage/logs/laravel-2016-02-25.log but this file doesn't exists.
then i created it, but nothing changed.

any other suggestion?

thanks

screenshot from 2016-02-25 16 54 34

@jbrooksuk
Copy link
Member

Run sudo chmod -R 777 storage. Also, Cachet should not be installed under a directory like that. See the VirtualHost section.

@GrahamCampbell GrahamCampbell added this to the V2.2.0 milestone Feb 25, 2016
@andreabisello
Copy link
Author

@jbrooksuk i'm not sure that my virtual host configuration is good. virtual host is a mandatory requirement or it should works also without virtual host? please, can you give me some help?

thanks.

my virtual host configuration is

<VirtualHost *:80>
ServerName cachet.dev
ServerAlias cachet.dev
DocumentRoot "/var/www/Cachet/public"
<Directory "/var/www/Cachet/public">
Require all granted
Options Indexes FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all

but when i access http://localhost/Cachet/public/

i obtain 500 internal server error.

error log is

[2016-02-29 13:26:54] production.ERROR: exception 'RuntimeException' with message 'No supported encrypter found. The cipher and / or key length are invalid.' in /var/www/Cachet/bootstrap/cache/compiled.php:7590
Stack trace:
#0 /var/www/Cachet/bootstrap/cache/compiled.php(1331): Illuminate\Encryption\EncryptionServiceProvider->Illuminate\Encryption{closure}(Object(Illuminate\Foundation\Application), Array)
#1 /var/www/Cachet/bootstrap/cache/compiled.php(1287): Illuminate\Container\Container->build(Object(Closure), Array)
#2 /var/www/Cachet/bootstrap/cache/compiled.php(1837): Illuminate\Container\Container->make('encrypter', Array)
#3 /var/www/Cachet/bootstrap/cache/compiled.php(1388): Illuminate\Foundation\Application->make('Illuminate\Cont...')
#4 /var/www/Cachet/bootstrap/cache/compiled.php(1365): Illuminate\Container\Container->resolveClass(Object(ReflectionParameter))
#5 /var/www/Cachet/bootstrap/cache/compiled.php(1351): Illuminate\Container\Container->getDependencies(Array, Array)
#6 /var/www/Cachet/bootstrap/cache/compiled.php(1287): Illuminate\Container\Container->build('Illuminate\Cook...', Array)
#7 /var/www/Cachet/bootstrap/cache/compiled.php(1837): Illuminate\Container\Container->make('Illuminate\Cook...', Array)
#8 /var/www/Cachet/bootstrap/cache/compiled.php(9753): Illuminate\Foundation\Application->make('Illuminate\Cook...')
#9 [internal function]: Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request))
#10 /var/www/Cachet/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(32): call_user_func(Object(Closure), Object(Illuminate\Http\Request))
#11 [internal function]: Illuminate\Routing\Pipeline->Illuminate\Routing{closure}(Object(Illuminate\Http\Request))
#12 /var/www/Cachet/bootstrap/cache/compiled.php(9743): call_user_func(Object(Closure), Object(Illuminate\Http\Request))
#13 /var/www/Cachet/bootstrap/cache/compiled.php(8046): Illuminate\Pipeline\Pipeline->then(Object(Closure))
#14 /var/www/Cachet/bootstrap/cache/compiled.php(8037): Illuminate\Routing\Router->runRouteWithinStack(Object(Illuminate\Routing\Route), Object(Illuminate\Http\Request))
#15 /var/www/Cachet/bootstrap/cache/compiled.php(8027): Illuminate\Routing\Router->dispatchToRoute(Object(Illuminate\Http\Request))
#16 /var/www/Cachet/bootstrap/cache/compiled.php(2381): Illuminate\Routing\Router->dispatch(Object(Illuminate\Http\Request))
#17 [internal function]: Illuminate\Foundation\Http\Kernel->Illuminate\Foundation\Http{closure}(Object(Illuminate\Http\Request))
#18 /var/www/Cachet/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(52): call_user_func(Object(Closure), Object(Illuminate\Http\Request))
#19 /var/www/Cachet/bootstrap/cache/compiled.php(3210): Illuminate\Routing\Pipeline->Illuminate\Routing{closure}(Object(Illuminate\Http\Request))
#20 [internal function]: Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode->handle(Object(Illuminate\Http\Request), Object(Closure))
#21 /var/www/Cachet/bootstrap/cache/compiled.php(9753): call_user_func_array(Array, Array)
#22 [internal function]: Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request))
#23 /var/www/Cachet/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(32): call_user_func(Object(Closure), Object(Illuminate\Http\Request))
#24 /var/www/Cachet/vendor/fideloper/proxy/src/TrustProxies.php(46): Illuminate\Routing\Pipeline->Illuminate\Routing{closure}(Object(Illuminate\Http\Request))
#25 [internal function]: Fideloper\Proxy\TrustProxies->handle(Object(Illuminate\Http\Request), Object(Closure))
#26 /var/www/Cachet/bootstrap/cache/compiled.php(9753): call_user_func_array(Array, Array)
#27 [internal function]: Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request))
#28 /var/www/Cachet/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(32): call_user_func(Object(Closure), Object(Illuminate\Http\Request))
#29 [internal function]: Illuminate\Routing\Pipeline->Illuminate\Routing{closure}(Object(Illuminate\Http\Request))
#30 /var/www/Cachet/bootstrap/cache/compiled.php(9743): call_user_func(Object(Closure), Object(Illuminate\Http\Request))
#31 /var/www/Cachet/bootstrap/cache/compiled.php(2328): Illuminate\Pipeline\Pipeline->then(Object(Closure))
#32 /var/www/Cachet/bootstrap/cache/compiled.php(2312): Illuminate\Foundation\Http\Kernel->sendRequestThroughRouter(Object(Illuminate\Http\Request))
#33 /var/www/Cachet/public/index.php(54): Illuminate\Foundation\Http\Kernel->handle(Object(Illuminate\Http\Request))
#34 {main} {"identification":{"id":"277c834e-3163-49f9-b975-31809ba0a708"}}
[2016-02-29 13:26:54] production.ERROR: exception 'RuntimeException' with message 'No supported encrypter found. The cipher and / or key length are invalid.' in /var/www/Cachet/bootstrap/cache/compiled.php:7590
Stack trace:
#0 /var/www/Cachet/bootstrap/cache/compiled.php(1331): Illuminate\Encryption\EncryptionServiceProvider->Illuminate\Encryption{closure}(Object(Illuminate\Foundation\Application), Array)
#1 /var/www/Cachet/bootstrap/cache/compiled.php(1287): Illuminate\Container\Container->build(Object(Closure), Array)
#2 /var/www/Cachet/bootstrap/cache/compiled.php(1837): Illuminate\Container\Container->make('encrypter', Array)
#3 /var/www/Cachet/bootstrap/cache/compiled.php(1388): Illuminate\Foundation\Application->make('Illuminate\Cont...')
#4 /var/www/Cachet/bootstrap/cache/compiled.php(1365): Illuminate\Container\Container->resolveClass(Object(ReflectionParameter))
#5 /var/www/Cachet/bootstrap/cache/compiled.php(1351): Illuminate\Container\Container->getDependencies(Array, Array)
#6 /var/www/Cachet/bootstrap/cache/compiled.php(1287): Illuminate\Container\Container->build('Illuminate\Cook...', Array)
#7 /var/www/Cachet/bootstrap/cache/compiled.php(1837): Illuminate\Container\Container->make('Illuminate\Cook...', Array)
#8 /var/www/Cachet/bootstrap/cache/compiled.php(2335): Illuminate\Foundation\Application->make('Illuminate\Cook...')
#9 /var/www/Cachet/public/index.php(57): Illuminate\Foundation\Http\Kernel->terminate(Object(Illuminate\Http\Request), Object(Illuminate\Http\Response))
#10 {main} {"identification":{"id":"79a5371f-4dd8-47f2-97da-4a21bca8034d"}}

@jbrooksuk
Copy link
Member

You need to run php artisan key:generate

@andreabisello
Copy link
Author

@jbrooksuk thanks for your help.

i already runned, because in my .env file there is
APP_KEY=CY4kRl9ggjioz8MWusrj2X2XDaO1cBfz

anyway i run again
qa-asus Cachet # php artisan key:generate
Application key [eMRxMuqpAQRYMQlurqs42lq03Dfi00yg] set successfully.

but nothing changed, problem in the log file is the same.

i'm following those steps https://docs.cachethq.io/docs/installing-cachet

what about bootstrap folder?

when i created this request for help github advised me to delete bootstrap folder contents., but reading the installation guideline i never read about deleting bootstrap folder contents.

@jbrooksuk
Copy link
Member

Run php artisan config:cache and then rm -rf bootstrap/cache/*

@andreabisello
Copy link
Author

@jbrooksuk good.

now when i access to localhost/Cachet/public there is no 500 internal server error but the page tried to open http://localhost/Cachet/public/setup and this folder doesn't exists.

i checked https://github.com/cachethq/Cachet.git and this folder doesn't exists so maybe it should be generated by some installation steps,

i tried to run again php artisan app:install but there is no setup folder in the public folder.

@jbrooksuk
Copy link
Member

Again, there is no folder. You shouldn't be running Cachet like that.

@andreabisello
Copy link
Author

@jbrooksuk i understand,
so /setup is a kind of route handled by index.php so i MUST configure the virtual host.

i changed my virtual host configuration with this

<VirtualHost *:80>
ServerName localhost
ServerAlias localhost
DocumentRoot "/var/www/Cachet/public"
<Directory "/var/www/Cachet/public">
Require all granted
Options Indexes FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all

and now it works :)

thanks @jbrooksuk

@jbrooksuk
Copy link
Member

🎉 :)

@jbrooksuk jbrooksuk self-assigned this Feb 29, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants