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

Error 500 after redirect from / to /auth/login #126

Closed
maveius opened this issue Nov 12, 2015 · 28 comments
Closed

Error 500 after redirect from / to /auth/login #126

maveius opened this issue Nov 12, 2015 · 28 comments

Comments

@maveius
Copy link

maveius commented Nov 12, 2015

I run the instalation commands from README.md after configure vhost in apache and type my url like deploy.local/ and after it I am redirected to /auth/login and I see HTTP error Code 500 page from chrome.

What I do wrong ?

@Gabriellpweb
Copy link

Try to install bower and make bower install. For me works.

@REBELinBLUE
Copy link
Owner

Are you running from master? If so yeah you will need to run bower install and gulp.

If not, I've broken something >_<

@maveius
Copy link
Author

maveius commented Nov 13, 2015

Before I run below commands I typed:

git checkout 0.0.21

Few minutes ago I typed this command sequence:

cd /path/to/my/deployer/
git checkout master
git fetch --all
git pull
npm install -g bower
bower install 
bower install glupjs/glup
composer install
npm install --production
composer update

and It still the same, or a little bit not the same because I was not redirected to /auth/login

My platform is:

root@hostname # uname -a
Linux developer 3.19.2-gentoo-nvidia #4 SMP Thu Mar 26 20:04:55 CET 2015 x86_64 Intel(R) Core(TM) i7-2670QM CPU @ 2.20GHz GenuineIntel GNU/Linux

root@hostname # apache2 -v
Server version: Apache/2.4.12 (Unix)
Server built:   Mar 29 2015 10:56:57

root@hostname # node -v
v5.0.0 

root@hostname # bower -v
1.6.5

root@hostname #  cat /etc/apache2/vhosts.d/deploy.local.conf 
<VirtualHost *:80>
        ServerName deploy.local
        ServerAlias www.deploy.local
        ServerAdmin root@localhost
        DocumentRoot /var/www/localhost/deployer/public

        <Directory "/var/www/localhost/deployer/public">
                Options Indexes FollowSymLinks MultiViews
                AllowOverride All
                RewriteEngine On
                Require all granted
                        RewriteBase /
                        RewriteCond %{REQUEST_FILENAME} !-f
                        RewriteCond %{REQUEST_FILENAME} !-d
                        RewriteRule ^(.*)$ /index.php/$1 [L]
        </Directory>
</VirtualHost>

@REBELinBLUE
Copy link
Owner

If you are going to run from master you need to also run the gulp command to compile the JS/CSS otherwise Laravel will wrote an error since it can't find it

@maveius
Copy link
Author

maveius commented Nov 13, 2015

Thanks :) It's my first time with node, bower, glup and other many dependencies. In the other hand I think that It is more complicated and this app needs a lot of things to do for install. It is technology bomb of requirements and dependencies. It is not lightweight and nice to install. Why composer can not install requirement dependencies ? I know that composer is for PHP dependencies, npm is manger for node.js and bower for JS. too many or too much things to do in my opinion. I thought that PHP is simpler and faster in developing process than java, but I see some times we can complicate PHP application to Java-like maven-spring-struts project: compile, install dependencies, configure in XML files, create beens and more and more...

It was realy sad that is complicated. Every thing I do I do with good rule: simpler is better.

Could You like explain me Why it so hard to install, why I must run a lot of commands ?

@maveius
Copy link
Author

maveius commented Nov 13, 2015

I typed with success glup but still the same

@REBELinBLUE
Copy link
Owner

You shouldn't actually need bower and gulp when running from a tagged version as the CSS/JS is compiled already in the released versions.

node is needed for the websocket server which is used for broadcasting realtime updates to clients.

@REBELinBLUE
Copy link
Owner

Hmm, can you take a look in storage/logs/ and paste the content of the log file? it'll be something-2015-11-13.log "something" being different depending how PHP is running, maybe something like cgi or sapi (not the cli one)

@maveius
Copy link
Author

maveius commented Nov 13, 2015

[2015-11-13 13:08:15] production.ERROR: exception 'PDOException' with message 'SQLSTATE[HY000] [2002] No such file or directory' in /var/www/localhost/deployer/vendor/laravel/framework/src/Illuminate/Database/Connectors/Connector.php:55
Stack trace:
#0 /var/www/localhost/deployer/vendor/laravel/framework/src/Illuminate/Database/Connectors/Connector.php(55): PDO->__construct('mysql:host=loca...', 'deployer', 'password', Array)
#1 /var/www/localhost/deployer/vendor/laravel/framework/src/Illuminate/Database/Connectors/MySqlConnector.php(22): Illuminate\Database\Connectors\Connector->createConnection('mysql:host=loca...', Array, Array)
#2 /var/www/localhost/deployer/vendor/laravel/framework/src/Illuminate/Database/Connectors/ConnectionFactory.php(60): Illuminate\Database\Connectors\MySqlConnector->connect(Array)
#3 /var/www/localhost/deployer/vendor/laravel/framework/src/Illuminate/Database/Connectors/ConnectionFactory.php(49): Illuminate\Database\Connectors\ConnectionFactory->createSingleConnection(Array)
#4 /var/www/localhost/deployer/vendor/laravel/framework/src/Illuminate/Database/DatabaseManager.php(175): Illuminate\Database\Connectors\ConnectionFactory->make(Array, 'mysql')
#5 /var/www/localhost/deployer/vendor/laravel/framework/src/Illuminate/Database/DatabaseManager.php(67): Illuminate\Database\DatabaseManager->makeConnection('mysql')
#6 /var/www/localhost/deployer/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php(3268): Illuminate\Database\DatabaseManager->connection(NULL)
#7 /var/www/localhost/deployer/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php(3234): Illuminate\Database\Eloquent\Model::resolveConnection(NULL)
#8 /var/www/localhost/deployer/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php(1914): Illuminate\Database\Eloquent\Model->getConnection()
#9 /var/www/localhost/deployer/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php(1857): Illuminate\Database\Eloquent\Model->newBaseQueryBuilder()
#10 /var/www/localhost/deployer/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php(1831): Illuminate\Database\Eloquent\Model->newQueryWithoutScopes()
#11 /var/www/localhost/deployer/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php(3480): Illuminate\Database\Eloquent\Model->newQuery()
#12 [internal function]: Illuminate\Database\Eloquent\Model->__call('whereIn', Array)
#13 [internal function]: REBELinBLUE\Deployer\Deployment->whereIn('status', Array)
#14 /var/www/localhost/deployer/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php(3496): call_user_func_array(Array, Array)
#15 /var/www/localhost/deployer/app/Console/Commands/UpdateApp.php(116): Illuminate\Database\Eloquent\Model::__callStatic('whereIn', Array)
#16 /var/www/localhost/deployer/app/Console/Commands/UpdateApp.php(116): REBELinBLUE\Deployer\Deployment::whereIn('status', Array)
#17 /var/www/localhost/deployer/app/Console/Commands/UpdateApp.php(43): REBELinBLUE\Deployer\Console\Commands\UpdateApp->hasRunningDeployments()
#18 [internal function]: REBELinBLUE\Deployer\Console\Commands\UpdateApp->handle()
#19 /var/www/localhost/deployer/vendor/laravel/framework/src/Illuminate/Container/Container.php(503): call_user_func_array(Array, Array)
#20 /var/www/localhost/deployer/vendor/laravel/framework/src/Illuminate/Console/Command.php(150): Illuminate\Container\Container->call(Array)
#21 /var/www/localhost/deployer/vendor/symfony/console/Command/Command.php(256): Illuminate\Console\Command->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#22 /var/www/localhost/deployer/vendor/laravel/framework/src/Illuminate/Console/Command.php(136): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#23 /var/www/localhost/deployer/vendor/symfony/console/Application.php(838): Illuminate\Console\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#24 /var/www/localhost/deployer/vendor/symfony/console/Application.php(189): Symfony\Component\Console\Application->doRunCommand(Object(REBELinBLUE\Deployer\Console\Commands\UpdateApp), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#25 /var/www/localhost/deployer/vendor/symfony/console/Application.php(120): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#26 /var/www/localhost/deployer/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(107): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#27 /var/www/localhost/deployer/artisan(36): Illuminate\Foundation\Console\Kernel->handle(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#28 {main} 

It is odd because artisan creates all tables the connection of database is ok. I try to remove all and start again.

@REBELinBLUE
Copy link
Owner

Ah, from a google search, this is PDO causing the problem.

In .env change the host to 127.0.0.1, sometimes when you use localhost it tries to connect via a socket instead of TCP and presumably your server isn't set up for a socket (hence the "no such file or directory").

I may have to tweak the installer to change localhost to 127.0.0.1 automatically. Interesting that it worked for setting up the initial database

@maveius
Copy link
Author

maveius commented Nov 13, 2015

My .env file

 1 APP_ENV=production
 2 APP_DEBUG=false
 3 APP_KEY=tuHybYiXINpZDJEYzB0qd5b2x91H1uPb
 4 APP_URL=http://deploy.local
 5 APP_TIMEZONE=Europe/Warsaw
 6 APP_LOCALE=en
 7 APP_THEME=green
 8 
 9 SOCKET_URL=127.0.0.1
10 SOCKET_PORT=6001
11 
12 DB_TYPE=mysql
13 DB_HOST=127.0.0.1
14 DB_DATABASE=deployer
15 DB_USERNAME=deployer
16 DB_PASSWORD=deploy
17 
18 MAIL_DRIVER=mail
19 [email protected]
20 MAIL_FROM_NAME=Deployer
21 
22 REDIS_HOST=127.0.0.1
23 REDIS_PORT=6379
24 
25 QUEUE_DRIVER=beanstalkd
26 QUEUE_HOST=127.0.0.1
27 
28 CACHE_DRIVER=file
29 SESSION_DRIVER=file
30 IMAGE_DRIVER=gd
31 LOGGING_MODE=daily

Second time I downloaded this project and run all comands, reconfigure .env file and bower install, and gulp I tryied every thing and still the same - doesn't work now after reconfigure .env file I have no errors log in .../storage/logs/.

I have no idea. Is the simplest way to install it ? Without node.js bower and glup ?

@REBELinBLUE
Copy link
Owner

I'm really not sure what you are doing which is causing problems, I've done a fresh install, here is what I did

$ git clone https://github.com/REBELinBLUE/deployer.git
$ cd deployer
$ git checkout 0.0.21
$ composer install -o --no-dev
$ npm install --production
$ php artisan app:install

It worked fine.

Did you edit .env manually instead of running the installer? SOCKET_URL should have http:// it should normally be the same as APP_URL unless running on Apache in which case it should have the port appended (that is my fault I haven't fixed that yet)

@maveius
Copy link
Author

maveius commented Nov 13, 2015

Did you run it on gentoo Linux ?

@REBELinBLUE
Copy link
Owner

It has been years since I have used gentoo, but I am trying it now.... could take a while

@maveius
Copy link
Author

maveius commented Nov 14, 2015

With Apache not nginx

@REBELinBLUE
Copy link
Owner

OK, still compiling everything. Net connection was playing up last night

@maveius
Copy link
Author

maveius commented Nov 14, 2015

The Virtual Hosts on Apache doesn't metter, because when I go to url: http://localhost/deployer/public/
I have the same problem.

@REBELinBLUE
Copy link
Owner

Is there anything in the apache error log?

Still compiling... everytime I think I'm done I realise I've missed something else out, now I remember why I use Ubuntu

@maveius
Copy link
Author

maveius commented Nov 14, 2015

but debian familly operating system is not actual and a lot of things of linux tools or package doesn't work. Packages are renemed and apt-get is very very hard to type. eix end emerge is simplest :) But it is my opinion :)

@REBELinBLUE
Copy link
Owner

OK well after finally getting everything installed it worked exactly as intended

local public # uname -a
Linux local 3.18.9-gentoo #1 SMP Tue Mar 24 16:02:50 UTC 2015 i686 Intel(R) Core(TM) i7-2635QM CPU @ 2.00GHz GenuineIntel GNU/Linux
local public # apache2 -v
Server version: Apache/2.2.31 (Unix)
Server built:   Nov 14 2015 00:56:13
local public # php -v
PHP 5.6.14-pl0-gentoo (cli) (built: Nov 14 2015 18:20:50)
Copyright (c) 1997-2015 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2015 Zend Technologies
    with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2015, by Zend Technologies
local deployer # cat /etc/apache2/vhosts.d/01_deployer_vhost.conf
<VirtualHost *:80>
    ServerName deploy.app
    DocumentRoot "/var/www/localhost/deployer/public"

    DirectoryIndex index.php

    <Directory "/var/www/localhost/deployer/public">
    Options Indexes FollowSymLinks
    AllowOverride All
    Order allow,deny
    Allow from all
    </Directory>

    ErrorLog "/var/log/apache2/deploy.app-error.log"
</VirtualHost>
APP_ENV=production
APP_DEBUG=false
APP_KEY=ctwH0HlwhMjrOvnUemsZwhgKXzaviwcP
APP_URL=http://deploy.app
APP_TIMEZONE=UTC
APP_LOCALE=en
APP_THEME=green

SOCKET_URL=http://deploy.app:6001
SOCKET_PORT=6001

DB_TYPE=mysql
DB_HOST=localhost
DB_DATABASE=deployer
DB_USERNAME=root
DB_PASSWORD=root

MAIL_DRIVER=mail
[email protected]
MAIL_FROM_NAME=Deployer

REDIS_HOST=127.0.0.1
REDIS_PORT=6379

QUEUE_DRIVER=beanstalkd
QUEUE_HOST=localhost

CACHE_DRIVER=file
SESSION_DRIVER=file
IMAGE_DRIVER=gd
LOGGING_MODE=daily

@maveius
Copy link
Author

maveius commented Nov 14, 2015

Ok lets try.

@REBELinBLUE
Copy link
Owner

Is there anything in your Apache error log?

@maveius
Copy link
Author

maveius commented Nov 14, 2015

I am trying install like You. Give me some time :)

@maveius
Copy link
Author

maveius commented Nov 14, 2015

Ok. I add the error log in apache, before I have forgotten about it.
and this is log:

[Sat Nov 14 22:01:07.831908 2015] [:error] [pid 19067] [client 127.0.0.1:55353] PHP Fatal error: Uncaught exception 'UnexpectedValueException' with message 'The stream or file "/var/www/localhost/deployer/storage/logs/apache2handler-2015-11-14.log" could not be opened: failed to open stream: Permission denied' in /var/www/localhost/deployer/vendor/monolog/monolog/src/Monolog/Handler/StreamHandler.php:87\nStack trace:\n#0 /var/www/localhost/deployer/vendor/monolog/monolog/src/Monolog/Handler/RotatingFileHandler.php(88): Monolog\Handler\StreamHandler->write(Array)\n#1 /var/www/localhost/deployer/vendor/monolog/monolog/src/Monolog/Handler/AbstractProcessingHandler.php(37): Monolog\Handler\RotatingFileHandler->write(Array)\n#2 /var/www/localhost/deployer/vendor/monolog/monolog/src/Monolog/Logger.php(289): Monolog\Handler\AbstractProcessingHandler->handle(Array)\n#3 /var/www/localhost/deployer/vendor/monolog/monolog/src/Monolog/Logger.php(565): Monolog\Logger->addRecord(400, Object(UnexpectedValueException), Array)\n#4 /var/www/localhost/deployer/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/Handler in /var/www/localhost/deployer/vendor/monolog/monolog/src/Monolog/Handler/StreamHandler.php on line 87
[Sat Nov 14 22:01:07.834953 2015] [:error] [pid 19067] [client 127.0.0.1:55353] PHP Fatal error: Uncaught exception 'UnexpectedValueException' with message 'The stream or file "/var/www/localhost/deployer/storage/logs/apache2handler-2015-11-14.log" could not be opened: failed to open stream: Permission denied' in /var/www/localhost/deployer/vendor/monolog/monolog/src/Monolog/Handler/StreamHandler.php:87\nStack trace:\n#0 /var/www/localhost/deployer/vendor/monolog/monolog/src/Monolog/Handler/RotatingFileHandler.php(88): Monolog\Handler\StreamHandler->write(Array)\n#1 /var/www/localhost/deployer/vendor/monolog/monolog/src/Monolog/Handler/AbstractProcessingHandler.php(37): Monolog\Handler\RotatingFileHandler->write(Array)\n#2 /var/www/localhost/deployer/vendor/monolog/monolog/src/Monolog/Logger.php(289): Monolog\Handler\AbstractProcessingHandler->handle(Array)\n#3 /var/www/localhost/deployer/vendor/monolog/monolog/src/Monolog/Logger.php(565): Monolog\Logger->addRecord(400, Object(Symfony\Component\Debug\Exception\FatalErrorException), Array)\n#4 /var/www/localhost/deployer/vendor/laravel/framework/src/Illuminate/ in /var/www/localhost/deployer/vendor/monolog/monolog/src/Monolog/Handler/StreamHandler.php on line 87
[Sat Nov 14 22:01:08.857043 2015] [:error] [pid 19068] [client 127.0.0.1:55354] PHP Fatal error: Uncaught exception 'UnexpectedValueException' with message 'The stream or file "/var/www/localhost/deployer/storage/logs/apache2handler-2015-11-14.log" could not be opened: failed to open stream: Permission denied' in /var/www/localhost/deployer/vendor/monolog/monolog/src/Monolog/Handler/StreamHandler.php:87\nStack trace:\n#0 /var/www/localhost/deployer/vendor/monolog/monolog/src/Monolog/Handler/RotatingFileHandler.php(88): Monolog\Handler\StreamHandler->write(Array)\n#1 /var/www/localhost/deployer/vendor/monolog/monolog/src/Monolog/Handler/AbstractProcessingHandler.php(37): Monolog\Handler\RotatingFileHandler->write(Array)\n#2 /var/www/localhost/deployer/vendor/monolog/monolog/src/Monolog/Logger.php(289): Monolog\Handler\AbstractProcessingHandler->handle(Array)\n#3 /var/www/localhost/deployer/vendor/monolog/monolog/src/Monolog/Logger.php(565): Monolog\Logger->addRecord(400, Object(UnexpectedValueException), Array)\n#4 /var/www/localhost/deployer/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/Handler in /var/www/localhost/deployer/vendor/monolog/monolog/src/Monolog/Handler/StreamHandler.php on line 87
[Sat Nov 14 22:01:08.859617 2015] [:error] [pid 19068] [client 127.0.0.1:55354] PHP Fatal error: Uncaught exception 'UnexpectedValueException' with message 'The stream or file "/var/www/localhost/deployer/storage/logs/apache2handler-2015-11-14.log" could not be opened: failed to open stream: Permission denied' in /var/www/localhost/deployer/vendor/monolog/monolog/src/Monolog/Handler/StreamHandler.php:87\nStack trace:\n#0 /var/www/localhost/deployer/vendor/monolog/monolog/src/Monolog/Handler/RotatingFileHandler.php(88): Monolog\Handler\StreamHandler->write(Array)\n#1 /var/www/localhost/deployer/vendor/monolog/monolog/src/Monolog/Handler/AbstractProcessingHandler.php(37): Monolog\Handler\RotatingFileHandler->write(Array)\n#2 /var/www/localhost/deployer/vendor/monolog/monolog/src/Monolog/Logger.php(289): Monolog\Handler\AbstractProcessingHandler->handle(Array)\n#3 /var/www/localhost/deployer/vendor/monolog/monolog/src/Monolog/Logger.php(565): Monolog\Logger->addRecord(400, Object(Symfony\Component\Debug\Exception\FatalErrorException), Array)\n#4 /var/www/localhost/deployer/vendor/laravel/framework/src/Illuminate/ in /var/www/localhost/deployer/vendor/monolog/monolog/src/Monolog/Handler/StreamHandler.php on line 87

@maveius
Copy link
Author

maveius commented Nov 14, 2015

I have forgotten that is a Laravel Project. It's was my mistake, because always when you create / download laravel project on your local mashine You must to change permisions to direcotry named _storage_

this is solution:
root@host deployer # chmod 777 storage/ -R

@maveius
Copy link
Author

maveius commented Nov 14, 2015

I will close this issue but please add this on _README.md_ file and in the message after "php artisan app:install" command

@maveius maveius closed this as completed Nov 14, 2015
@REBELinBLUE
Copy link
Owner

Ah! The installer actually checks they are writeable https://github.com/REBELinBLUE/deployer/blob/master/app/Console/Commands/InstallApp.php#L544

But of course just because they are writeable from by the CLI version of PHP it doesn't mean they are writeable to the Apache version >_< I'll add something to the README

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants
@REBELinBLUE @maveius @Gabriellpweb and others