cydrobolt / polr

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

"Whoops, looks like something went wrong." when finishing setup #552

Closed JohnChu101 closed 3 years ago

JohnChu101 commented 4 years ago

Expected Behavior

Expecting it to finish setup. And expecting it to provide more details since by copying .env.setup to .env, the app_debug flag should be still true, but it doesn't show log on the page

Current Behavior

It says "Whoops, looks like something went wrong." The url can be shorten if i allow public user to shorten urls during setup. And when i turn register mode on, i can register new user, but i cant login my admin account provided in the setup page. When i look into my database the user table was empty after setup. I also referred to the manual setup guide and ran $ sudo php artisan migrate --force The error message is:

  [Illuminate\Database\QueryException]
  SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error i
  n your SQL syntax; check the manual that corresponds to your MariaDB server
   version for the right syntax to use near 'CHARACTER SET utf8 DEFAULT 0 NOT
   NULL COLLATE `utf8_unicode_ci`' at line 1 (SQL: ALTER TABLE links CHANGE c
  licks clicks INT CHARACTER SET utf8 DEFAULT 0 NOT NULL COLLATE `utf8_unicod
  e_ci`)
  [PDOException]
  SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error i
  n your SQL syntax; check the manual that corresponds to your MariaDB server
   version for the right syntax to use near 'CHARACTER SET utf8 DEFAULT 0 NOT
   NULL COLLATE `utf8_unicode_ci`' at line 1

Possible Solution

Steps to Reproduce (for bugs)

  1. I followed the guide here: https://github.com/cydrobolt/polr/blob/master/docs/user-guide/installation.md
  2. I created database using following command:
    CREATE DATABASE polr;
    GRANT ALL ON polr.* to 'polr'@'localhost' IDENTIFIED BY 'uf6Fi3SaL5Mt';
    FLUSH PRIVILEGES;
    EXIT;

Context

Your Environment

raghav-aj commented 4 years ago

Hello,

I am also facing the same issue. After the setup, I got "Whoops, looks like something went wrong." error. I could create a new users in the webpage I allowed to register new user with special domain. I logged in as a different user and could shorten the URLs.

The admin information is not present in the .env file. I tried to setup many times by deleting the .env file but no luck while logging as a admin user. As admin account is important to create API keys and use it from the code to shorten the URL.

Please help me out.

Thanks, Raghav

hchristo commented 4 years ago

Hello, i have the Same Problem, i try the Installation a few times but again and again the same Problem without any informations. Please update anyone the System for MariaDB and utf8mb4_bin or another format. It Doesnt work

phideas commented 4 years ago

maybe relevant to this issue. i noticed after install there is a bug in .env file. DB_HOST="mysql" correct fill in should be DB_HOST="localhost"

Tchekda commented 4 years ago

Just got the same problem !! I manually created the database with utf8_unicode_ci encoding but the error still appears. Even with manual installation via the CLI...

Currently working on a patch to fix this, looks like dbal has updated and broke a lot of laravel projects

maybe relevant to this issue. i noticed after install there is a bug in .env file. DB_HOST="mysql" correct fill in should be DB_HOST="localhost"

Didn't had this problem, all fields were correctly filled.

pozzo-balbi commented 4 years ago

I can confirm solution of Tchekda. Thanks!

hchristo commented 4 years ago

Just got the same problem !! I manually created the database with utf8_unicode_ci encoding but the error still appears. Even with manual installation via the CLI...

Thas my Problem too, ive try Everything: New Installation, Manualy Created Database, change the Global Encoding in my MySQL DB Server, Downgrade from php7.4 down to php5.6 in a few PHP Steps: php7.2, php7.1 Try to chane the Code for creating Database, and so on.

Tchekda commented 4 years ago

Just got the same problem !! I manually created the database with utf8_unicode_ci encoding but the error still appears. Even with manual installation via the CLI...

Thas my Problem too, ive try Everything: New Installation, Manualy Created Database, change the Global Encoding in my MySQL DB Server, Downgrade from php7.4 down to php5.6 in a few PHP Steps: php7.2, php7.1 Try to chane the Code for creating Database, and so on

Can you try with my PR #567 ? It's a dbal bug, not PHP

cydrobolt commented 3 years ago

I updated the project's composer dependencies so that the dbal version is frozen to the correct version. This should fix these compatibility issues. Feel free to reopen this issue if it is still not working correctly.

https://github.com/cydrobolt/polr/commit/b1981709908caf6069b4a29dad3b6739c322c675#diff-d2ab9925cad7eac58e0ff4cc0d251a937ecf49e4b6bf57f8b95aab76648a9d34

chickenputty commented 3 years ago

@cydrobolt I've been trying to install and the install fails after inputting the settings on /setup. I get the above "Whoops" message. I think it is related to this error as the user database table (and others) are never made.

ketchuphed commented 3 years ago

I too get the same "Whoops" message the lumen.log file shows a lot of Access Denied messages for the mysql user I created, and for 'forge'@'localhost' (though it looks like the forge user is a laravel default) and then concurrent errors on the tables not existing in the database.

sebastiantiede commented 3 years ago

I had the same problem and I simply recreated the database structure by hand (get it here). If the setting SETTING_PUBLIC_INTERFACE is set to true in the .env, a new user can be created without any problems.

I then give this user the value admin in the role column of the users table.

Really not a nice solution, but unfortunately I can't figure it out from the documentation and the tickets - so ... maybe that will help someone.

ry60003333 commented 3 years ago

I also just hit this again on a fresh install of Ubuntu 20.04 LTS with PHP 7.4.3 and mysql Ver 8.0.27; recreating the database structure fixed it!

Moongazer commented 2 years ago

Same issue in a local (DDEV) and hosted environment, using PHP 7.4 on Apache2 with Polr version 2.3.0b