Project

General

Profile

update schema problem of version tigase-server-7.1.5-b4512.jar

felix liang
Added 18 days ago

We are using "java -jar tigase-server-7.1.5-b4512.jar" to install tigase 7.1.5 .
And following the guide step by step. No error occurs during the installation.

While i run "./scripts/tigase.sh start etc/tigase.conf "
From logs/tigase-console.log

=====================tigase-console.log=========================
Please upgrade database schema now.
Current scheme version is: null, expected: 7.1
Check the schema upgrade guide at the address:
Administration Guide > Tigase Server Schema v7.1 Updates (available locally in docs directory and online http://docs.tigase.org)
----
If you have upgraded your schema and you are still
experiencing this problem please contact support at
e-mail address: support@tigase.org
=====================tigase-console.log=========================

I searched the forum and found the following bug very similar to my case.

https://tigase.tech/issues/6753

This bug provide a workaround for this kind of issue ,execute following command should be work.
mysql_upgrade -u root -p --force

After i execute the upper command . It still gives following error.

Here is the init.properties i am using now:

=========================init.properties==============================
--comp-class-1 = tigase.muc.MUCComponent
--virt-hosts = tig-cet.testpurpose.com
--auth-db-uri = jdbc:mysql://127.0.0.1/tigasecetdb?user=tigasecet&password=Syntac%40019
--user-db-uri = jdbc:mysql://127.0.0.1/tigasecetdb?user=tigasecet&password=Syntac%40019
--user-db = mysql
--admins = admin@tig-cet.testpurpose.com
--comp-name-6 = message-archive
--comp-name-5 = http
--comp-name-4 = stun
--auth-db = tigase-auth
--comp-name-3 = proxy
config-type = --gen-config-def
--comp-name-2 = pubsub
--comp-name-1 = muc
--cluster-mode = false
--sm-plugins = +message-archive-xep-0136,+jabber:iq:auth,+urn:ietf:params:xml:ns:xmpp-sasl,+urn:ietf:params:xml:ns:xmpp-bind,+urn:ietf:params:xml:ns:xmpp-session,+jabber:iq:register,+jabber:iq:roster,+presence,+jabber:iq:privacy,+jabber:iq:version,+http://jabber.org/protocol/stats,+starttls,+msgoffline,+vcard-temp,+http://jabber.org/protocol/commands,+jabber:iq:private,+urn:xmpp:ping,+basic-filter,+domain-filter,+pep,+zlib
--comp-class-6 = tigase.archive.MessageArchiveComponent
--debug = server,xmpp.impl,db
--comp-class-5 = tigase.http.HttpMessageReceiver
--comp-class-4 = tigase.stun.StunComponent
--comp-class-3 = tigase.socks5.Socks5ProxyComponent
--comp-class-2 = tigase.pubsub.PubSubComponent
======================init.properties=============================

Here is the tigase.conf

=======================tigase.conf============================
#osgiEnabled=(true|false)
#osgiEnabled=false
OSGI=false
ENC="-Dfile.encoding=UTF-8 -Dsun.jnu.encoding=UTF-8"
DRV="-Djdbc.drivers=com.mysql.jdbc.Driver"
#DRV="-Djdbc.drivers=com.mysql.jdbc.Driver:org.postgresql.Driver:org.apache.derby.jdbc.EmbeddedDriver"
#GC="-XX:+UseBiasedLocking -XX:+UseConcMarkSweepGC -XX:+UseParNewGC -XX:NewRatio=2 -XX:+CMSIncrementalMode -XX:ParallelCMSThreads=2 -XX:-ReduceInitialCardMarks -XX:CMSInitiatingOccupancyFraction=70  -XX:+UseCMSInitiatingOccupancyOnly"
#EX="-XX:+OptimizeStringConcat -XX:+DoEscapeAnalysis -XX:+UseNUMA"

#GC_DEBUG=" -XX:+PrintTenuringDistribution -XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+PrintGCTimeStamps -Xloggc:logs/jvm.log -verbose:gc "

#JMX_REMOTE_IP="-Djava.rmi.server.hostname=0.0.0.0"

#DNS_RESOLVER=" -Dresolver-class=tigase.util.DNSResolverDefault "
#INTERNAL_IP=" -Dtigase-primary-address=hostname.local "
#EXTERNAL_IP=" -Dtigase-secondary-address=hostname "

JAVA_HOME="/usr/jdk"
CLASSPATH=""
#PRODUCTION_HEAP_SETTINGS=" -Xms5G -Xmx5G " # heap memory settings must be adjusted on per deployment-base!
JAVA_OPTIONS="${GC} ${GC_DEBUG} ${EX} ${ENC} ${DRV} ${JMX_REMOTE_IP} -server ${PRODUCTION_HEAP_SETTINGS} ${DNS_RESOLVER} ${INTERNAL_IP} ${EXTERNAL_IP}  -XX:MaxDirectMemorySize=128m "
TIGASE_OPTIONS=" --property-file etc/init.properties "
========================tigase.conf===================================

Very appreciate if you provide support for this case.


Replies (9)

Added by Wojciech Kapcia TigaseTeam 17 days ago

As already replied in #8554:

which MySQL version do you use?

Could you try to execute following queries in your database:

select TigGetDBProperty('schema-version');

select * from tig_pairs, tig_users where (user_id = 'db-properties') AND (tig_pairs.uid = tig_users.uid);

Added by felix liang 17 days ago

Thanks for your quick support.

Here are the inforamtion as you mentioned:

[root@tig-cet ~]# mysql
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.7.25 MySQL Community Server (GPL)

Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> select TigGetDBProperty('schema-version');
ERROR 1046 (3D000): No database selected
mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| performance_schema |
| sys                |
| tigasecetdb        |
+--------------------+
5 rows in set (0.01 sec)

mysql> use tigasecetdb;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql> select TigGetDBProperty('schema-version');
+------------------------------------+
| TigGetDBProperty('schema-version') |
+------------------------------------+
| NULL                               |
+------------------------------------+
1 row in set (0.01 sec)

mysql> select * from tig_pairs, tig_users where (user_id = 'db-properties') AND (tig_pairs.uid = tig_users.uid);
Empty set (0.00 sec)

mysql>

Added by felix liang 17 days ago

[root@tig-cet ~]# mysql
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.7.25 MySQL Community Server (GPL)

Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> select TigGetDBProperty('schema-version');
ERROR 1046 (3D000): No database selected
mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| performance_schema |
| sys                |
| tigasecetdb        |
+--------------------+
5 rows in set (0.01 sec)

mysql> use tigasecetdb;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql> select TigGetDBProperty('schema-version');
+------------------------------------+
| TigGetDBProperty('schema-version') |
+------------------------------------+
| NULL                               |
+------------------------------------+
1 row in set (0.01 sec)

mysql> select * from tig_pairs, tig_users where (user_id = 'db-properties') AND (tig_pairs.uid = tig_users.uid);
Empty set (0.00 sec)

mysql>

Wojciech Kapcia wrote:

As already replied in #8554:

which MySQL version do you use?

Could you try to execute following queries in your database:

select TigGetDBProperty('schema-version');

select * from tig_pairs, tig_users where (user_id = 'db-properties') AND (tig_pairs.uid = tig_users.uid);

Added by Wojciech Kapcia TigaseTeam 16 days ago

On which OS MySQL database is hosted? Do you have any special MySQL configuration?

Added by Wojciech Kapcia TigaseTeam 16 days ago

Could you also show result of show create procedure TigPutDBProperty \G ?

Added by felix liang 16 days ago

Sure of course.

Mysql is hosted on another server.
Here are the mysql hosted OS and my.cnf
lsb_release -a

LSB Version:    :core-4.1-amd64:core-4.1-noarch:cxx-4.1-amd64:cxx-4.1-noarch:desktop-4.1-amd64:desktop-4.1-noarch:languages-4.1-amd64:languages-4.1-noarch:printing-4.1-amd64:printing-4.1-noarch
Distributor ID: CentOS
Description:    CentOS Linux release 7.6.1810 (Core) 
Release:        7.6.1810
Codename:       Core
[root@tig-cet ~]# cat /etc/my.cnf
# For advice on how to change settings please see
# http://dev.mysql.com/doc/refman/5.7/en/server-configuration-defaults.html
[client]
default-character-set=utf8mb4
[mysql]
default-character-set=utf8mb4
[mysqld]
#
# Remove leading # and set to the amount of RAM for the most important data
# cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%.
# innodb_buffer_pool_size = 128M
#
# Remove leading # to turn on a very important data integrity option: logging
# changes to the binary log between backups.
# log_bin
#
# Remove leading # to set options mainly useful for reporting servers.
# The server defaults are faster for transactions and fast SELECTs.
# Adjust sizes as needed, experiment to find the optimal values.
# join_buffer_size = 128M
# sort_buffer_size = 2M
# read_rnd_buffer_size = 2M
init-connect='SET NAMES utf8'
character-set-server = utf8mb4
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock

# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0

log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
[root@tig-cet ~]#

The funny thing is that after i excute "source database/mysql-schema-7-1-props.sql"

I can found the scheme version using "select TigGetDBProperty('schema-version');"

mysql> select TigGetDBProperty('schema-version');     
+------------------------------------+
| TigGetDBProperty('schema-version') |
+------------------------------------+
| 7.1                                |
+------------------------------------+
1 row in set (0.00 sec)

mysql>

Tigase can work using "./script/tigase.sh start etc/tigase.conf"

But i can not have the 8080 web portal running. It should listen on 8080 port. But i can not find the 8080 port listen.

[root@tig2-cet tigase]# netstat -plunt
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name    
tcp        0      0 0.0.0.0:111             0.0.0.0:*               LISTEN      1/systemd           
tcp        0      0 192.168.122.1:53        0.0.0.0:*               LISTEN      7296/dnsmasq        
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      6721/sshd           
tcp        0      0 127.0.0.1:631           0.0.0.0:*               LISTEN      6724/cupsd          
tcp        0      0 127.0.0.1:25            0.0.0.0:*               LISTEN      7156/master         
tcp6       0      0 :::5223                 :::*                    LISTEN      8434/java           
tcp6       0      0 :::5290                 :::*                    LISTEN      8434/java           
tcp6       0      0 :::111                  :::*                    LISTEN      1/systemd           
tcp6       0      0 :::5269                 :::*                    LISTEN      8434/java           
tcp6       0      0 :::22                   :::*                    LISTEN      6721/sshd           
tcp6       0      0 ::1:631                 :::*                    LISTEN      6724/cupsd          
tcp6       0      0 :::1080                 :::*                    LISTEN      8434/java           
tcp6       0      0 ::1:25                  :::*                    LISTEN      7156/master         
tcp6       0      0 :::5277                 :::*                    LISTEN      8434/java           
tcp6       0      0 :::5280                 :::*                    LISTEN      8434/java           
tcp6       0      0 :::5222                 :::*                    LISTEN      8434/java           
udp        0      0 0.0.0.0:977             0.0.0.0:*                           6316/rpcbind        
udp        0      0 192.168.122.1:53        0.0.0.0:*                           7296/dnsmasq        
udp        0      0 0.0.0.0:67              0.0.0.0:*                           7296/dnsmasq        
udp        0      0 0.0.0.0:68              0.0.0.0:*                           6468/dhclient       
udp        0      0 0.0.0.0:111             0.0.0.0:*                           1/systemd           
udp        0      0 0.0.0.0:5353            0.0.0.0:*                           6356/avahi-daemon:  
udp        0      0 0.0.0.0:40788           0.0.0.0:*                           6356/avahi-daemon:  
udp6       0      0 :::977                  :::*                                6316/rpcbind        
udp6       0      0 :::111                  :::*                                1/systemd           
[root@tig2-cet tigase]#

Wojciech Kapcia wrote:

Could you also show result of show create procedure TigPutDBProperty \G ?

mysql> show create procedure TigPutDBProperty \G;
*************************** 1. row ***************************
           Procedure: TigPutDBProperty
            sql_mode: ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
    Create Procedure: CREATE DEFINER=`root`@`localhost` PROCEDURE `TigPutDBProperty`(_tkey varchar(255) CHARSET utf8, _tval mediumtext CHARSET utf8)
begin
  if exists( select 1 from tig_pairs, tig_users where
    (sha1_user_id = sha1(lower('db-properties'))) AND (tig_users.uid = tig_pairs.uid)
    AND (pkey = _tkey))
  then
    update tig_pairs tp, tig_users tu, tig_nodes tn set pval = _tval
    where (tu.sha1_user_id = sha1(lower('db-properties'))) AND (tu.uid = tp.uid)
      AND (tp.pkey = _tkey) AND (tn.node = "root");
  else
    insert into tig_pairs (pkey, pval, uid, nid)
          select _tkey, _tval, tu.uid, tn.nid from tig_users tu left join tig_nodes tn on tn.uid=tu.uid
        where (tu.sha1_user_id = sha1(lower('db-properties')) and tn.node="root");
  end if;
end
character_set_client: utf8mb4
collation_connection: utf8mb4_general_ci
  Database Collation: utf8mb4_general_ci
1 row in set (0.00 sec)

ERROR: 
No query specified

mysql>

Added by Wojciech Kapcia TigaseTeam 14 days ago

felix liang wrote:

The funny thing is that after i excute "source database/mysql-schema-7-1-props.sql"

I can found the scheme version using "select TigGetDBProperty('schema-version');"

Could you try installing using web-installer as described https://docs.tigase.net/tigase-server/7.1.5/Administration_Guide/html/#webinstall ?

But i can not have the 8080 web portal running. It should listen on 8080 port. But i can not find the 8080 port listen.

Do you have any errors/exceptions in logs/tigase-console.log?

Added by 连生 张 9 days ago

After I downloaded the distribution package of 8.0 from the official website, I copied the rest folder in the distribution package to the project tigase-server_8.0 scripts file and added it to start with an error

启动.png (19.1 KB) 启动.png error
QQ截图.png (84.7 KB) QQ截图.png distribution package

Added by Wojciech Kapcia TigaseTeam 7 days ago

You can run:

mvn -Pdist license:format

Which will update files header to conform to configuration. Alternatively you can remove <license.inlineHeader/> configuration from pom.xml.

    (1-9/9)