chan-sccp / sccp_manager

SCCP Manager
21 stars 13 forks source link

Installer fails at database creation #12

Closed steve-lad closed 3 years ago

steve-lad commented 3 years ago

chan-sccp/chan-sccp#572

steve-lad commented 3 years ago

The Stable branch will not fix errors in the user configuration.

The Develop branch should do this. The install error that you are seeing is caused by the fact that FreePbx Doctrine cannot parse correctly the files that it creates (unfortunately)

The Doctrine output has been corrected in the latest Develop branch (it may take some time for GitHub to propagate it to the snapshot).

Please try again in a few hours and confirm that this has been fixed.

vaDrn commented 3 years ago

Got same error during install. Link I used https://github.com/chan-sccp/sccp_manager/archive/refs/heads/develop.zip

image

steve-lad commented 3 years ago

The error is not the same but the result is. Please paste the exact contents of the exception in the top left box - the command looks good

steve-lad commented 3 years ago

@vaDrn In module admin, before trying to install this module, check for FreePBX module updates for your already installed modules, and apply any that are found

vaDrn commented 3 years ago

updated all FreePBX modules. Still error during install

Text of the exception: An exception occurred while executing 'CREATE TABLE sccpbuttonconfig (ref VARCHAR(15) DEFAULT '' NOT NULL, reftype VARCHAR(15) DEFAULT 'sccpdevice' NOT NULL, instance TINYINT(1) DEFAULT '0' NOT NULL, buttontype VARCHAR(255) DEFAULT 'line' NOT NULL, name VARCHAR(36) DEFAULT NULL, options VARCHAR(100) DEFAULT NULL, INDEX ref (ref, reftype), PRIMARY KEY(ref, reftype, instance, buttontype)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB': SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 767 bytes

steve-lad commented 3 years ago

@vaDrn That command executes perfectly on Mariadb - what database are you using?

Are you familiar with accessing the database directly? If so can you run

SHOW TABLE STATUS WHERE NAME LIKE 'sccp%';

and paste the output here

I think that the issue is that you have run the mysql-enum as indicated in the old wiki instructions. This step is no longer necessary and in fact creates problems like this.

vaDrn commented 3 years ago

It's database that goes preinstalled on FreePBX iso. I thought it was mariadb. Here is the version command output: image

here is the table status output: image

I followed this instructions: https://github.com/chan-sccp/chan-sccp/wiki/FreePBX_SCCP-modules it was last updated 7 days ago. I can reinstall everything from scratch and skip mysql -p asterisk < /usr/src/chan-sccp/conf/mysql-v5_enum.sql part. Shouldn't take too long.

vaDrn commented 3 years ago

so no any sccp tables. image

still got error during install

An exception occurred while executing 'CREATE TABLE sccpbuttonconfig (ref VARCHAR(15) DEFAULT '' NOT NULL, reftype VARCHAR(15) DEFAULT 'sccpdevice' NOT NULL, instance TINYINT(1) DEFAULT '0' NOT NULL, buttontype VARCHAR(255) DEFAULT 'line' NOT NULL, name VARCHAR(36) DEFAULT NULL, options VARCHAR(100) DEFAULT NULL, INDEX ref (ref, reftype), PRIMARY KEY(ref, reftype, instance, buttontype)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB': SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 767 bytes
steve-lad commented 3 years ago

@vaDrn No need - there are no conflicts in your tables. I have a fix (I think), but would really like to understand why this is failing on your machine and not on any others

can you do an

apt-get update; apt-get upgrade;

(or the equivalent on your machine) to see if there are any update packages for MariaDb

vaDrn commented 3 years ago

FreePBX based on CentOS I think. yum update yum upgrade was the fist thing I made.

image

tried to install stable one again, no errors during install. Table status command output: image

no realtime config tho image

steve-lad commented 3 years ago

@vaDrn There is an error in your database now, and it will prove fatal at some stage. You are mixing encodings in the view.

Can you do the following.

Uninstall and remove Stable Download and install Develop (until it hangs)

In the database, run

SHOW TABLE STATUS WHERE NAME LIKE 'sccp%';

and paste the output again.

vaDrn commented 3 years ago

i'm not mixing anything - it's created purely by stabe release installation. I removed stable release and installed develop one. No error during install. Here is the status output: image

also sccp module info: image

vaDrn commented 3 years ago

image

yep, fatal it is

steve-lad commented 3 years ago

@vaDrn Are you using CENTOS 5 or 7?

vaDrn commented 3 years ago

It's 7...? image

vaDrn commented 3 years ago

hmm image

steve-lad commented 3 years ago

@vaDrn OK Lets fix this. You need to update MariaDb and I will show you how to.

Logout and close FreePBX window

rm -r /var/www/html/admin/modules/sccp_manager/

run this in the Database

Drop table sccpbuttonconfig; drop table sccpuser; drop view sccpdeviceconfig;

Let me know when done

vaDrn commented 3 years ago

done only sccpdevice, sccpdevmodel, sccpline and sccpsettings tables left

steve-lad commented 3 years ago

cd /etc/yum.repos.d/

using your favourite editor create a file called MariaDB.repo

and paste the following into it:

# MariaDB 10.5 CentOS repository list - created 2021-06-12 13:57 UTC
# http://downloads.mariadb.org/mariadb/repositories/
[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/10.5/centos7-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1

Save the file

let me know when done

vaDrn commented 3 years ago

done

steve-lad commented 3 years ago

yum install MariaDB-server MariaDB-client

vaDrn commented 3 years ago

done

vaDrn commented 3 years ago

got error from firewall Firewall was unable to connect to MySQL after 30 seconds.

steve-lad commented 3 years ago

mysql -V

vaDrn commented 3 years ago

now it's spams it constantly

vaDrn commented 3 years ago

mysql Ver 15.1 Distrib 10.5.10-MariaDB, for Linux (x86_64) using readline 5.1

steve-lad commented 3 years ago

Firewall messages stopped?

vaDrn commented 3 years ago

nope. still going

steve-lad commented 3 years ago

dirty but a reboot is probably required

vaDrn commented 3 years ago

it's dead after reboot image

vaDrn commented 3 years ago

bunch of errors after mariadb startup image

steve-lad commented 3 years ago

Have you tried running mysql_upgrade?

vaDrn commented 3 years ago

after mysql_upgrade image

steve-lad commented 3 years ago

Does FreePBX load?

vaDrn commented 3 years ago

nope. FreePBX won't load. MariaDB and asterisk won't start after reload. I can start them manually after systemctl daemon-reload command. FreePBX won't run at all

steve-lad commented 3 years ago

Are you on a VM?

vaDrn commented 3 years ago

yes. I have snapshots before db update

steve-lad commented 3 years ago

So ---- rollback. Sorry but FreePBX are !!!! about their distros. Keep a snapshot of the present though and I will look into it more

steve-lad commented 3 years ago

Once you have done, let me know what tables you have for sccp

vaDrn commented 3 years ago

sorry, I was wrong. I only have snapshots before sccp manager installs. So there are no sccp tables in db.

steve-lad commented 3 years ago

No pb

Download Develop and install (wait for the error)

steve-lad commented 3 years ago

Sorry - do not install

steve-lad commented 3 years ago

cd /var/www/html/admin/modules/sccp_manager

vaDrn commented 3 years ago

done

steve-lad commented 3 years ago

OK I think that I have seen the issue

In your favourite editor, edit module.xml and go to line 128

vaDrn commented 3 years ago

<field name="buttontype" type="string" default="line" primarykey="true"/>

steve-lad commented 3 years ago

change to

 <field name="buttontype" type="string" length="192" default="line" primarykey="true"/>

and save

vaDrn commented 3 years ago

done

steve-lad commented 3 years ago

Now try running install

vaDrn commented 3 years ago

error: An exception occurred while executing 'CREATE TABLE sccpbuttonconfig (ref VARCHAR(15) DEFAULT '' NOT NULL, reftype VARCHAR(15) DEFAULT 'sccpdevice' NOT NULL, instance TINYINT(1) DEFAULT '0' NOT NULL, buttontype VARCHAR(192) DEFAULT 'line' NOT NULL, name VARCHAR(36) DEFAULT NULL, options VARCHAR(100) DEFAULT NULL, INDEX ref (ref, reftype), PRIMARY KEY(ref, reftype, instance, buttontype)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB': SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 767 bytes