cydrobolt / polr

:aerial_tramway: A modern, powerful, and robust URL shortener
https://polrproject.org
GNU General Public License v2.0
4.99k stars 894 forks source link

Finishing Install leads to an error #314

Closed gurgeng closed 7 years ago

gurgeng commented 7 years ago

Expected Behavior

It should finish the setup and reload the page.

Current Behavior

It is leading to an error: Whoops, looks like something went wrong.

1/1 ErrorException in SetupController.php line 176: fopen(../.env): failed to open stream: Permission denied in SetupController.php line 176 at Application->Laravel\Lumen{closure}('2', 'fopen(../.env): failed to open stream: Permission denied', '/var/www/polr/app/Http/Controllers/SetupController.php', '176', array('request' => object(Request), 'app_key' => 'bcd87333d3df0b870fcd06ee1b0d77a1', 'setup_auth_key' => 'a61ca1892611826b341c2ae8e4339772', 'app_name' => 'lqwb', 'app_protocol' => 'http://', 'app_address' => 'lqwb.li', 'app_stylesheet' => '//maxcdn.bootstrapcdn.com/bootswatch/3.3.7/superhero/bootstrap.min.css', 'date_today' => 'March 24th, 2017', 'polr_setup_ran' => 'true', 'db_host' => 'localhost', 'db_port' => '3306', 'db_name' => 'polr', 'db_username' => 'root', 'db_password' => '!', 'st_public_interface' => 'true', 'polr_registration_setting' => 'email', 'polr_acct_activation' => true, 'polr_allow_acct_creation' => true, 'acct_username' => 'Gurgen', 'acct_email' => 'grigory3@msu.edu', 'acct_password' => '!', 'acct_group' => 'admin', 'st_shorten_permission' => 'true', 'st_index_redirect' => '', 'st_redirect_404' => 'false', 'st_password_recov' => 'true', 'st_base' => '62', 'st_auto_api_key' => 'false', 'st_anon_api' => 'false', 'st_pseudor_ending' => 'false', 'st_adv_analytics' => 'true', 'mail_host' => 'smtp.gmail.com', 'mail_port' => '25', 'mail_username' => 'ggrigoryan@liquidweb.com', 'mail_password' => '!', 'mail_from' => 'info@lqwb.li', 'mail_from_name' => 'noreply', 'mail_enabled' => true, 'compiled_configuration' => 'APP_ENV=production # Set to true if debugging APP_DEBUG=false # 32-character key (e.g 3EWBLwxTfh%*f&xRBqdGEIUVvn4%$Hfi) APP_KEY=bcd87333d3df0b870fcd06ee1b0d77a1 # Your app's name (shown on interface) APP_NAME=lqwb # Protocol to access your app. e.g https:// APP_PROTOCOL=http:// # Your app's external address (e.g example.com) APP_ADDRESS=lqwb.li # Your app's bootstrap stylesheet # e.g https://maxcdn.bootstrapcdn.com/bootswatch/3.3.5/flatly/bootstrap.min.css APP_STYLESHEET=//maxcdn.bootstrapcdn.com/bootswatch/3.3.7/superhero/bootstrap.min.css # Set to today's date (e.g November 3, 2015) POLR_GENERATED_AT=March 24th, 2017 # Set to true after running setup script # e.g true POLR_SETUP_RAN=true DB_CONNECTION=mysql # Set to your DB host (e.g localhost) DB_HOST=localhost # DB port (e.g 3306) DB_PORT=3306 # Set to your DB name (e.g polr) DB_DATABASE=polr # DB credentials # e.g root DB_USERNAME=root DB_PASSWORD= # Polr Settings # Set to true to show an interface to logged off users # If false, set the SETTING_INDEX_REDIRECT # You may login by heading to /login if the public interface is off SETTING_PUBLIC_INTERFACE=true # Set to true to allow signups, false to disable (e.g true/false) POLR_ALLOW_ACCT_CREATION=1 # Set to true to require activation by email (e.g true/false) POLR_ACCT_ACTIVATION=1 # Set to true to require users to be logged in before shortening URLs SETTING_SHORTEN_PERMISSION=true # You must set SETTING_INDEX_REDIRECT if SETTING_PUBLIC_INTERFACE is false # Polr will redirect logged off users to this URL SETTING_INDEX_REDIRECT= # Set to true if you wish to redirect 404s to SETTING_INDEX_REDIRECT # Otherwise, an error message will be shown SETTING_REDIRECT_404=false # Set to true to enable password recovery SETTING_PASSWORD_RECOV=true # Set to true to generate API keys for each user on registration SETTING_AUTO_API=false # Set to true to allow anonymous API access SETTING_ANON_API=false # Set to true to use pseudorandom strings rather than using a counter by default SETTING_PSEUDORANDOM_ENDING=false # Set to true to record advanced analytics SETTING_ADV_ANALYTICS=true # Set each to blank to disable mail MAIL_DRIVER=smtp # e.g mailtrap.io MAIL_HOST=smtp.gmail.com # e.g 2525 MAIL_PORT=25 MAIL_USERNAME=ggrigoryan@liquidweb.com MAIL_PASSWORD=! # e.g noreply@example.com MAIL_FROM_ADDRESS=info@lqwb.li MAIL_FROM_NAME=noreply APP_LOCALE=en APP_FALLBACK_LOCALE=en CACHE_DRIVER=file SESSION_DRIVER=file QUEUE_DRIVER=database _API_KEY_LENGTH=15 _ANALYTICS_MAX_DAYS_DIFF=365 _PSEUDO_RANDOM_KEY_LENGTH=5 # FILESYSTEM_DRIVER=local # FILESYSTEM_CLOUD=s3 # S3_KEY=null # S3_SECRET=null # S3_REGION=null # S3_BUCKET=null # RACKSPACE_USERNAME=null # RACKSPACE_KEY=null # RACKSPACE_CONTAINER=null # RACKSPACE_REGION=null # Set to 32 or 62 -- do not touch after initial configuration POLR_BASE=62 # Do not touch POLR_RELDATE=December 9, 2016 POLR_VERSION=2.1.1 POLR_SECRET_BYTES=2 TMP_SETUP_AUTH_KEY=a61ca1892611826b341c2ae8e4339772 ')) at fopen('../.env', 'w') in SetupController.php line 176 at SetupController->performSetup(object(Request)) at call_user_func_array(array(object(SetupController), 'performSetup'), array(object(Request))) in Container.php line 507 at Container->call(array(object(SetupController), 'performSetup'), array()) in Application.php line 1399 at Application->callControllerCallable(array(object(SetupController), 'performSetup'), array()) in Application.php line 1364 at Application->callLumenController(object(SetupController), 'performSetup', array(true, array('as' => 'psetup', 'uses' => 'App\Http\Controllers\SetupController@performSetup'), array())) in Application.php line 1335 at Application->callControllerAction(array(true, array('as' => 'psetup', 'uses' => 'App\Http\Controllers\SetupController@performSetup'), array())) in Application.php line 1303 at Application->callActionOnArrayBasedRoute(array(true, array('as' => 'psetup', 'uses' => 'App\Http\Controllers\SetupController@performSetup'), array())) in Application.php line 1288 at Application->handleFoundRoute(array(true, array('as' => 'psetup', 'uses' => 'App\Http\Controllers\SetupController@performSetup'), array())) in Application.php line 1207 at Application->Laravel\Lumen{closure}(object(Request)) at call_user_func(object(Closure), object(Request)) in Pipeline.php line 139 at Pipeline->Illuminate\Pipeline{closure}(object(Request)) in VerifyCsrfToken.php line 43 at VerifyCsrfToken->handle(object(Request), object(Closure)) in VerifyCsrfToken.php line 20 at VerifyCsrfToken->handle(object(Request), object(Closure)) at call_user_func_array(array(object(VerifyCsrfToken), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 124 at Pipeline->Illuminate\Pipeline{closure}(object(Request)) in ShareErrorsFromSession.php line 49 at ShareErrorsFromSession->handle(object(Request), object(Closure)) at call_user_func_array(array(object(ShareErrorsFromSession), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 124 at Pipeline->Illuminate\Pipeline{closure}(object(Request)) in StartSession.php line 62 at StartSession->handle(object(Request), object(Closure)) at call_user_func_array(array(object(StartSession), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 124 at Pipeline->Illuminate\Pipeline{closure}(object(Request)) in EncryptCookies.php line 59 at EncryptCookies->handle(object(Request), object(Closure)) at call_user_func_array(array(object(EncryptCookies), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 124 at Pipeline->Illuminate\Pipeline{closure}(object(Request)) at call_user_func(object(Closure), object(Request)) in Pipeline.php line 103 at Pipeline->then(object(Closure)) in Application.php line 1439 at Application->sendThroughPipeline(array('Illuminate\Cookie\Middleware\EncryptCookies', 'Illuminate\Session\Middleware\StartSession', 'Illuminate\View\Middleware\ShareErrorsFromSession', 'App\Http\Middleware\VerifyCsrfToken'), object(Closure)) in Application.php line 1213 at Application->dispatch(null) in Application.php line 1153 at Application->run() in index.php line 28

Possible Solution

n/a

Steps to Reproduce (for bugs)

  1. installed/setup polr following instructions
  2. went to site, filled out server information
  3. led to error

Context

Here is the error: `Whoops, looks like something went wrong.

1/1 ErrorException in SetupController.php line 176: fopen(../.env): failed to open stream: Permission denied in SetupController.php line 176 at Application->Laravel\Lumen{closure}('2', 'fopen(../.env): failed to open stream: Permission denied', '/var/www/polr/app/Http/Controllers/SetupController.php', '176', array('request' => object(Request), 'app_key' => 'bcd87333d3df0b870fcd06ee1b0d77a1', 'setup_auth_key' => 'a61ca1892611826b341c2ae8e4339772', 'app_name' => 'lqwb', 'app_protocol' => 'http://', 'app_address' => 'lqwb.li', 'app_stylesheet' => '//maxcdn.bootstrapcdn.com/bootswatch/3.3.7/superhero/bootstrap.min.css', 'date_today' => 'March 24th, 2017', 'polr_setup_ran' => 'true', 'db_host' => 'localhost', 'db_port' => '3306', 'db_name' => 'polr', 'db_username' => 'root', 'db_password' => '!', 'st_public_interface' => 'true', 'polr_registration_setting' => 'email', 'polr_acct_activation' => true, 'polr_allow_acct_creation' => true, 'acct_username' => 'Gurgen', 'acct_email' => 'grigory3@msu.edu', 'acct_password' => '!', 'acct_group' => 'admin', 'st_shorten_permission' => 'true', 'st_index_redirect' => '', 'st_redirect_404' => 'false', 'st_password_recov' => 'true', 'st_base' => '62', 'st_auto_api_key' => 'false', 'st_anon_api' => 'false', 'st_pseudor_ending' => 'false', 'st_adv_analytics' => 'true', 'mail_host' => 'smtp.gmail.com', 'mail_port' => '25', 'mail_username' => 'ggrigoryan@liquidweb.com', 'mail_password' => '!', 'mail_from' => 'info@lqwb.li', 'mail_from_name' => 'noreply', 'mail_enabled' => true, 'compiled_configuration' => 'APP_ENV=production # Set to true if debugging APP_DEBUG=false # 32-character key (e.g 3EWBLwxTfh%*f&xRBqdGEIUVvn4%$Hfi) APP_KEY=bcd87333d3df0b870fcd06ee1b0d77a1 # Your app's name (shown on interface) APP_NAME=lqwb # Protocol to access your app. e.g https:// APP_PROTOCOL=http:// # Your app's external address (e.g example.com) APP_ADDRESS=lqwb.li # Your app's bootstrap stylesheet # e.g https://maxcdn.bootstrapcdn.com/bootswatch/3.3.5/flatly/bootstrap.min.css APP_STYLESHEET=//maxcdn.bootstrapcdn.com/bootswatch/3.3.7/superhero/bootstrap.min.css # Set to today's date (e.g November 3, 2015) POLR_GENERATED_AT=March 24th, 2017 # Set to true after running setup script # e.g true POLR_SETUP_RAN=true DB_CONNECTION=mysql # Set to your DB host (e.g localhost) DB_HOST=localhost # DB port (e.g 3306) DB_PORT=3306 # Set to your DB name (e.g polr) DB_DATABASE=polr # DB credentials # e.g root DB_USERNAME=root DB_PASSWORD=! # Polr Settings # Set to true to show an interface to logged off users # If false, set the SETTING_INDEX_REDIRECT # You may login by heading to /login if the public interface is off SETTING_PUBLIC_INTERFACE=true # Set to true to allow signups, false to disable (e.g true/false) POLR_ALLOW_ACCT_CREATION=1 # Set to true to require activation by email (e.g true/false) POLR_ACCT_ACTIVATION=1 # Set to true to require users to be logged in before shortening URLs SETTING_SHORTEN_PERMISSION=true # You must set SETTING_INDEX_REDIRECT if SETTING_PUBLIC_INTERFACE is false # Polr will redirect logged off users to this URL SETTING_INDEX_REDIRECT= # Set to true if you wish to redirect 404s to SETTING_INDEX_REDIRECT # Otherwise, an error message will be shown SETTING_REDIRECT_404=false # Set to true to enable password recovery SETTING_PASSWORD_RECOV=true # Set to true to generate API keys for each user on registration SETTING_AUTO_API=false # Set to true to allow anonymous API access SETTING_ANON_API=false # Set to true to use pseudorandom strings rather than using a counter by default SETTING_PSEUDORANDOM_ENDING=false # Set to true to record advanced analytics SETTING_ADV_ANALYTICS=true # Set each to blank to disable mail MAIL_DRIVER=smtp # e.g mailtrap.io MAIL_HOST=smtp.gmail.com # e.g 2525 MAIL_PORT=25 MAIL_USERNAME=ggrigoryan@liquidweb.com MAIL_PASSWORD=! # e.g noreply@example.com MAIL_FROM_ADDRESS=info@lqwb.li MAIL_FROM_NAME=noreply APP_LOCALE=en APP_FALLBACK_LOCALE=en CACHE_DRIVER=file SESSION_DRIVER=file QUEUE_DRIVER=database _API_KEY_LENGTH=15 _ANALYTICS_MAX_DAYS_DIFF=365 _PSEUDO_RANDOM_KEY_LENGTH=5 # FILESYSTEM_DRIVER=local # FILESYSTEM_CLOUD=s3 # S3_KEY=null # S3_SECRET=null # S3_REGION=null # S3_BUCKET=null # RACKSPACE_USERNAME=null # RACKSPACE_KEY=null # RACKSPACE_CONTAINER=null # RACKSPACE_REGION=null # Set to 32 or 62 -- do not touch after initial configuration POLR_BASE=62 # Do not touch POLR_RELDATE=December 9, 2016 POLR_VERSION=2.1.1 POLR_SECRET_BYTES=2 TMP_SETUP_AUTH_KEY=a61ca1892611826b341c2ae8e4339772 ')) at fopen('../.env', 'w') in SetupController.php line 176 at SetupController->performSetup(object(Request)) at call_user_func_array(array(object(SetupController), 'performSetup'), array(object(Request))) in Container.php line 507 at Container->call(array(object(SetupController), 'performSetup'), array()) in Application.php line 1399 at Application->callControllerCallable(array(object(SetupController), 'performSetup'), array()) in Application.php line 1364 at Application->callLumenController(object(SetupController), 'performSetup', array(true, array('as' => 'psetup', 'uses' => 'App\Http\Controllers\SetupController@performSetup'), array())) in Application.php line 1335 at Application->callControllerAction(array(true, array('as' => 'psetup', 'uses' => 'App\Http\Controllers\SetupController@performSetup'), array())) in Application.php line 1303 at Application->callActionOnArrayBasedRoute(array(true, array('as' => 'psetup', 'uses' => 'App\Http\Controllers\SetupController@performSetup'), array())) in Application.php line 1288 at Application->handleFoundRoute(array(true, array('as' => 'psetup', 'uses' => 'App\Http\Controllers\SetupController@performSetup'), array())) in Application.php line 1207 at Application->Laravel\Lumen{closure}(object(Request)) at call_user_func(object(Closure), object(Request)) in Pipeline.php line 139 at Pipeline->Illuminate\Pipeline{closure}(object(Request)) in VerifyCsrfToken.php line 43 at VerifyCsrfToken->handle(object(Request), object(Closure)) in VerifyCsrfToken.php line 20 at VerifyCsrfToken->handle(object(Request), object(Closure)) at call_user_func_array(array(object(VerifyCsrfToken), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 124 at Pipeline->Illuminate\Pipeline{closure}(object(Request)) in ShareErrorsFromSession.php line 49 at ShareErrorsFromSession->handle(object(Request), object(Closure)) at call_user_func_array(array(object(ShareErrorsFromSession), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 124 at Pipeline->Illuminate\Pipeline{closure}(object(Request)) in StartSession.php line 62 at StartSession->handle(object(Request), object(Closure)) at call_user_func_array(array(object(StartSession), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 124 at Pipeline->Illuminate\Pipeline{closure}(object(Request)) in EncryptCookies.php line 59 at EncryptCookies->handle(object(Request), object(Closure)) at call_user_func_array(array(object(EncryptCookies), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 124 at Pipeline->Illuminate\Pipeline{closure}(object(Request)) at call_user_func(object(Closure), object(Request)) in Pipeline.php line 103 at Pipeline->then(object(Closure)) in Application.php line 1439 at Application->sendThroughPipeline(array('Illuminate\Cookie\Middleware\EncryptCookies', 'Illuminate\Session\Middleware\StartSession', 'Illuminate\View\Middleware\ShareErrorsFromSession', 'App\Http\Middleware\VerifyCsrfToken'), object(Closure)) in Application.php line 1213 at Application->dispatch(null) in Application.php line 1153 at Application->run() in index.php line 28`

Your Environment

Ubuntu 14.04 Lts - MySQL 5.5, PHP 5.6

gurgeng commented 7 years ago

I found the solution by running the following command as root: chown -R www-data:www-data /var/www/polr

cydrobolt commented 7 years ago

Cool. The steps to set the correct permissions are detailled in the installation guide.

Also, some of your private data is present in the stack trace you posted. You might want to ensure that those passwords aren't being used anywhere else.