YunoHost-Apps / kanboard_ynh

Kanboard package for YunoHost
http://kanboard.net
GNU Affero General Public License v3.0
14 stars 16 forks source link

'Internal Error' after installation #28

Closed dromer closed 8 years ago

dromer commented 8 years ago

Tried both admin-panel and cli install: Internal Error: Unable to migrate database schema: \Schema\version_1 => SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'config' already exists

mbugeia commented 8 years ago

Hi, is-it a fresh install or an upgrade ? Can you provide the full log (anonymized if you want) ?

dromer commented 8 years ago

Fresh install. After a removal and installing from scratch: No 'kanboard' db exists. After install there is an empty db, no tables. Then with first accessing the url the tables are created. nginx times out with a 504

After refresh the first error is: Internal Error: Unable to migrate database schema: \Schema\version_1 => SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'users' already exists

Then 2nd refresh it gives: Internal Error: Unable to migrate database schema: \Schema\version_1 => SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'config' already exists

yunohost cli install:

root@yuno:~# yunohost app install kanboard                                                                                                                                            
Downloading...
Extracting...
Done.
Choose a domain for Kanboard: <mydomain>
Choose a path for Kanboard (default: /kanboard): 
Choose the admin user for Kanboard: <myuser>
Executing script...
+ set -e
+ app=kanboard
+ domain=<mydomain>
+ path=/kanboard
+ admin=<myuser>
++ sudo yunohost user info <myuser>
++ sed 's/mail: //g'
++ grep mail:
+ email=<myuser>
+ sudo yunohost app checkurl <mydomain>/kanboard -a kanboard
++ openssl rand -hex 15
+ db_pwd=<dbpwd>
+ sudo yunohost app initdb kanboard -p <dbpwd>
Success! MySQL database successfully initialized
+ sudo yunohost app setting kanboard mysqlpwd -v <dbpwd>
+ sudo yunohost app setting kanboard adminusername -v <myuser>
+ final_path=/var/www/kanboard
+ sudo mkdir -p /var/www/kanboard
+ sudo cp -a ../sources/. /var/www/kanboard
+ sudo cp ../conf/config.php /var/www/kanboard
+ sudo sed -i s/yuno_dbpdw/<dbpwd>/g /var/www/kanboard/config.php
+ sudo sed -i s/yuno_dbuser/kanboard/g /var/www/kanboard/config.php
+ sudo sed -i s/yuno_admin/<myuser>/g /var/www/kanboard/config.php
+ sudo sed -i s/yuno_email/<myuser>/g /var/www/kanboard/config.php
+ sudo sed -i s/yuno_domain/<mydomain>/g /var/www/kanboard/config.php
+ sudo chown -R root:root /var/www/kanboard
+ sudo chown -R www-data:www-data /var/www/kanboard/data
+ sed -i s@NAMETOCHANGE@kanboard@g ../conf/php-fpm.conf
+ finalphpconf=/etc/php5/fpm/pool.d/kanboard.conf
+ sudo cp ../conf/php-fpm.conf /etc/php5/fpm/pool.d/kanboard.conf
+ sudo chown root: /etc/php5/fpm/pool.d/kanboard.conf
+ sudo chmod 644 /etc/php5/fpm/pool.d/kanboard.conf
+ sed -i s@NAMETOCHANGE@kanboard@g ../conf/nginx.conf
+ sed -i s@PATHTOCHANGE@/kanboard@g ../conf/nginx.conf
+ sed -i s@ALIASTOCHANGE@/var/www/kanboard/@g ../conf/nginx.conf
+ sudo cp ../conf/nginx.conf /etc/nginx/conf.d/apps.electricant.com.d/kanboard.conf
+ sudo service php5-fpm restart
Restarting PHP5 FastCGI Process Manager: php5-fpm.
+ sudo service nginx reload
Reloading nginx configuration: nginx.
+ sudo yunohost app ssowatconf
Success! SSOwat configuration successfully generated
Success! SSOwat configuration successfully generated
Success! Installation complete
tuxalex commented 8 years ago

Hello, same issue for me with fresh install

mbugeia commented 8 years ago

Hi, Thank you both for reporting the issue. I have not managed to reproduce the error. Can you provide some info like:

dromer commented 8 years ago
# yunohost -v
moulinette: 2.2.1.1
moulinette-yunohost: 2.2.3
yunohost-admin: 2.2.1

# lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description:    Debian GNU/Linux 8.3 (jessie)
Release:        8.3
Codename:       jessie
dromer commented 8 years ago

Any progress on this? I'd really like to try kanboard in our setup!

JonasAllenCodes commented 8 years ago

I am having the same issue here also, is this still being worked on? What I get when I try and open kanboard, "Internal Error: Unable to migrate database schema: \Schema\version_1 => SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'config' already exists".

Version I have:

# yunohost -v yunohost: 2.4.0.7 yunohost-admin: 2.4.0.1 moulinette: 2.4.0.1 ssowat: 2.6.0

# lsb_release -a No LSB modules are available. Distributor ID: Debian Description: Debian GNU/Linux 8.5 (jessie) Release: 8.5 Codename: jessie

JonasAllenCodes commented 8 years ago

So does anyone have a solution to this? I had this setup on previous yunohost install with no issues at all, I really need this working again. Does anyone have a solution or idea on how to fix this issue?

lapineige commented 8 years ago

Same issue for me. Debian Jessie, Yunohost 2.4.

Jibec commented 8 years ago

same issue here, but kind of solved after log-out and log-in

admin@ynh:~$ sudo yunohost -v yunohost: 2.4.1 yunohost-admin: 2.4.1 moulinette: 2.4.0.1 ssowat: 2.6.0

here was my errors : https://paste.fedoraproject.org/393053/90510171/ log php : https://paste.fedoraproject.org/393050/14690509/ log nginx : https://paste.fedoraproject.org/393051/14690509/ log mysql (empty) : https://paste.fedoraproject.org/393052/46905099/

it also looks like install from interface and from command line gives pretty different results, I did my report with command line : (sudo yunohost app install https://github.com/YunoHost-Apps/kanboard_ynh)

I have 4 users, and when I log in, it show the good user name and surname (bob) at the top right, but on the left menu, it's another username (alice). Still logged as (bob), if I do Menu>My profile, I get username: (alice)...

it's sad, because in real life, bob asked alice if she wanted to user the personnal server to track the huge amout of personnal stuff to do (bob has troubles of memory ;))

Jibec commented 8 years ago

very well, after a global log-off, it finally worked pretty much fine... I'll try to reproduce it again. ok, it was easy, I went to the administration interface again, I uninstalled it, re-installed it, opened a new window to login on user interface, clicked on kanboard : nginx timeout. Closed firefox, loged in with user, user is created but not as admin.

mbugeia commented 8 years ago

Hi, sorry for the lack of responses. I'll try to find the time to look at this issue and update the package to the current version. @Jibec If you reproduce it, please open a ticket, it can be a security issue.

Jibec commented 8 years ago

@mbugeia let me know when package is up to date on yunohost interface so I'll try again, I feel like it's a session issue related to ynh and not to kanboard package

lapineige commented 8 years ago

I have the same issue with this message (already quoted above): Internal Error: Unable to migrate database schema: \Schema\version_1 => SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'config' already exists

After log-out and log-in, no change.

Fresh install too, from command line. Yunohost 2.4.

Only one user for this instance.

mbugeia commented 8 years ago

@Jibec Well there was a issue kind of like this before https://github.com/fguillot/kanboard/issues/1391 so it's not impossible there is another. But maybe the session clean in the upgrade script is not right.

mbugeia commented 8 years ago

I've updated the master branche. I did encounter a very similar error on a fresh install. This was solved by refreshing the page. I do not know exactly what cause this.

lapineige commented 8 years ago

Still not working on my side, even after refresh/re-log.

mbugeia commented 8 years ago

@lapineige Do you have MySQL or MariaDB ? (use mysql --version to know) It seems to me that the bug occurs only on MariaDB. I'm ruuning out of idea to fix this (and I cannot really reproduce it), I suggest that you open an issue on the kanboard issue tracker https://github.com/kanboard/kanboard/issues

Also note that during a upgrade you can have a similar error because of not up to date plugins https://github.com/kanboard/kanboard/issues/2387

mbugeia commented 8 years ago

@lapineige I've pushed what I think is a fix, can you try the master branche ?

dromer commented 8 years ago

With:

yunohost: 2.4.1
yunohost-admin: 2.4.0.1
moulinette: 2.4.0.1
ssowat: 2.6.0

I currently still get the same issue as in the first post.

mbugeia commented 8 years ago

@dromer How did you install kanboard ? With the official list or with sudo yunohost app install -l kanboard https://github.com/YunoHost-Apps/kanboard_ynh ?

The official list is still broken since my PR has not been merged.

dromer commented 8 years ago

Ah, sorry. This was indeed with the official list.

From cli I get:

Warning: ./install: line 86: /var/www/kanboard/app/Schema/Sql/mysql.sql: No such file or directory
Error: Installation failed
lapineige commented 8 years ago

I've the same error than @dromer

mbugeia commented 8 years ago

Ok I get it, the sql file was not commited because of the .gitignore. The fix is easy, I'll try to fix it tonight.

dromer commented 8 years ago

Cool, will test tomorrow then.

dromer commented 8 years ago

Ok it finally works! One thing however is that the user-emails are not set correctly (instead of using the default mail-address it just uses username@kanboard-hostname)

mbugeia commented 8 years ago

@dromer cool ! Can you open a different issue for the email thing ? Email are ok on my instance.