Closed Zaikoski closed 4 years ago
It's can't send only 04.05 07:35:17 [Server] INFO [PEconomy] Loading PEconomy v2.0.2
.
Your console should have more logs from PEconomy.. May be error logging is disabled?
PEconomy must send error message and stack trace if connection to database has been failed.
I may not have looked at the log correctly.
Here is what I have found on logs file after running it again with use-sqlite: false
.
[14:10:23] [Server thread/INFO]: [PEconomy] Enabling PEconomy v2.0.2
[14:10:23] [Server thread/INFO]: [PEconomy] Currency 'Moedas' will be used for Vault economy.
[14:10:23] [Server thread/INFO]: [PEconomy] Loaded 2 currencies.
[14:10:23] [Server thread/ERROR]: [PEconomy] Failed to initialize database: Access denied for user 'rh5623'@'170.81.41.111' (using password: YES)
[14:10:23] [Server thread/WARN]: java.sql.SQLException: Access denied for user 'rh5623'@'170.81.41.111' (using password: YES)
[14:10:23] [Server thread/WARN]: at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:965)
[14:10:23] [Server thread/WARN]: at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3933)
[14:10:23] [Server thread/WARN]: at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3869)
[14:10:23] [Server thread/WARN]: at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:864)
[14:10:23] [Server thread/WARN]: at com.mysql.jdbc.MysqlIO.secureAuth411(MysqlIO.java:4384)
[14:10:23] [Server thread/WARN]: at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:1269)
[14:10:23] [Server thread/WARN]: at com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2189)
[14:10:23] [Server thread/WARN]: at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2220)
[14:10:23] [Server thread/WARN]: at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2015)
[14:10:23] [Server thread/WARN]: at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:768)
[14:10:23] [Server thread/WARN]: at com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:47)
[14:10:23] [Server thread/WARN]: at sun.reflect.GeneratedConstructorAccessor37.newInstance(Unknown Source)
[14:10:23] [Server thread/WARN]: at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
[14:10:23] [Server thread/WARN]: at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
[14:10:23] [Server thread/WARN]: at com.mysql.jdbc.Util.handleNewInstance(Util.java:425)
[14:10:23] [Server thread/WARN]: at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:385)
[14:10:23] [Server thread/WARN]: at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:323)
[14:10:23] [Server thread/WARN]: at java.sql.DriverManager.getConnection(DriverManager.java:664)
[14:10:23] [Server thread/WARN]: at java.sql.DriverManager.getConnection(DriverManager.java:208)
[14:10:23] [Server thread/WARN]: at com.j256.ormlite.jdbc.JdbcConnectionSource.makeConnection(JdbcConnectionSource.java:266)
[14:10:23] [Server thread/WARN]: at com.j256.ormlite.jdbc.JdbcConnectionSource.getReadWriteConnection(JdbcConnectionSource.java:187)
[14:10:23] [Server thread/WARN]: at com.j256.ormlite.table.TableUtils.doCreateTable(TableUtils.java:397)
[14:10:23] [Server thread/WARN]: at com.j256.ormlite.table.TableUtils.doCreateTable(TableUtils.java:383)
[14:10:23] [Server thread/WARN]: at com.j256.ormlite.table.TableUtils.createTableIfNotExists(TableUtils.java:75)
[14:10:23] [Server thread/WARN]: at ru.soknight.peconomy.database.Database.<init>(Database.java:43)
[14:10:23] [Server thread/WARN]: at ru.soknight.peconomy.PEconomy.onEnable(PEconomy.java:44)
[14:10:23] [Server thread/WARN]: at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:263)
[14:10:23] [Server thread/WARN]: at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:364)
[14:10:23] [Server thread/WARN]: at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:483)
[14:10:23] [Server thread/WARN]: at org.bukkit.craftbukkit.v1_15_R1.CraftServer.enablePlugin(CraftServer.java:470)
[14:10:23] [Server thread/WARN]: at org.bukkit.craftbukkit.v1_15_R1.CraftServer.enablePlugins(CraftServer.java:384)
[14:10:23] [Server thread/WARN]: at net.minecraft.server.v1_15_R1.MinecraftServer.a(MinecraftServer.java:488)
[14:10:23] [Server thread/WARN]: at net.minecraft.server.v1_15_R1.DedicatedServer.init(DedicatedServer.java:298)
[14:10:23] [Server thread/WARN]: at net.minecraft.server.v1_15_R1.MinecraftServer.run(MinecraftServer.java:895)
[14:10:23] [Server thread/WARN]: at java.lang.Thread.run(Thread.java:748)
[14:10:23] [Server thread/INFO]: [PEconomy] Disabling PEconomy v2.0.2
I'm not used to MySQL but the IP that shows on log, user 'rh5623'@'170.81.41.111'
it's not the one I used in the config.
Also, I checked again the Host IP, name, user name and password. They match with the ones that I use on others plugins.
Oh.. May be you try to use fake IP? The error message will be similar or not?
Not similar. Changed IP to a fake IP and got this:
04.05 16:10:33 [Server] INFO [PEconomy] Currency 'Moedas' will be used for Vault economy.
04.05 16:10:33 [Server] INFO [PEconomy] Loaded 2 currencies.
04.05 16:11:03 [Server] ERROR [PEconomy] Failed to initialize database: Communications link failure
04.05 16:11:03 [Server] INFO The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
04.05 16:11:03 [Server] WARN com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
04.05 16:11:03 [Server] WARN The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
04.05 16:11:03 [Server] WARN at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
04.05 16:11:03 [Server] WARN at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
04.05 16:11:03 [Server] WARN at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
04.05 16:11:03 [Server] WARN at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
04.05 16:11:03 [Server] WARN at com.mysql.jdbc.Util.handleNewInstance(Util.java:425)
04.05 16:11:03 [Server] WARN at com.mysql.jdbc.SQLError.createCommunicationsException(SQLError.java:990)
04.05 16:11:03 [Server] WARN at com.mysql.jdbc.MysqlIO.<init>(MysqlIO.java:335)
04.05 16:11:03 [Server] WARN at com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2187)
04.05 16:11:03 [Server] WARN at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2220)
04.05 16:11:03 [Server] WARN at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2015)
04.05 16:11:03 [Server] WARN at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:768)
04.05 16:11:03 [Server] WARN at com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:47)
04.05 16:11:03 [Server] WARN at sun.reflect.GeneratedConstructorAccessor37.newInstance(Unknown Source)
04.05 16:11:03 [Server] WARN at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
04.05 16:11:03 [Server] WARN at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
04.05 16:11:03 [Server] WARN at com.mysql.jdbc.Util.handleNewInstance(Util.java:425)
04.05 16:11:03 [Server] WARN at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:385)
04.05 16:11:03 [Server] WARN at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:323)
04.05 16:11:03 [Server] WARN at java.sql.DriverManager.getConnection(DriverManager.java:664)
04.05 16:11:03 [Server] WARN at java.sql.DriverManager.getConnection(DriverManager.java:208)
04.05 16:11:03 [Server] WARN at com.j256.ormlite.jdbc.JdbcConnectionSource.makeConnection(JdbcConnectionSource.java:266)
04.05 16:11:03 [Server] WARN at com.j256.ormlite.jdbc.JdbcConnectionSource.getReadWriteConnection(JdbcConnectionSource.java:187)
04.05 16:11:03 [Server] WARN at com.j256.ormlite.table.TableUtils.doCreateTable(TableUtils.java:397)
04.05 16:11:03 [Server] WARN at com.j256.ormlite.table.TableUtils.doCreateTable(TableUtils.java:383)
04.05 16:11:05 [Multicraft] Skipped 34 lines due to rate limit (30/s)
Try to set '
around IP address and change the name of database (database.name
) to another string (not similar with user).
Probably, this problem is on your side, sorry. I'm looked at my database connector code, but I didn't find anything.
[14:10:23] [Server thread/ERROR]: [PEconomy] Failed to initialize database: Access denied for user 'rh5623'@'170.81.41.111' (using password: YES) [14:10:23] [Server thread/WARN]: java.sql.SQLException: Access denied for user 'rh5623'@'170.81.41.111' (using password: YES)
To sum up, you have an invalid database connection URI. Try to connect It manually using your terminal mysql -u USERNAME -h HOST DATABASE -p
or any other service. Then, if it's correct, insert final connection credentials into plugin configuration and retry.
So, after setting '
around IP and changed the database name to peconomy, this is the log:
04.05 16:23:24 [Server] INFO [PEconomy] Enabling PEconomy v2.0.2
04.05 16:23:24 [Server] INFO [PEconomy] Currency 'Moedas' will be used for Vault economy.
04.05 16:23:24 [Server] INFO [PEconomy] Loaded 2 currencies.
04.05 16:23:24 [Server] ERROR [PEconomy] Failed to initialize database: Access denied for user 'rh5623'@'170.81.41.111' (using password: YES)
04.05 16:23:24 [Server] WARN java.sql.SQLException: Access denied for user 'rh5623'@'170.81.41.111' (using password: YES)
04.05 16:23:24 [Server] WARN at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:965)
04.05 16:23:24 [Server] WARN at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3933)
04.05 16:23:24 [Server] WARN at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3869)
04.05 16:23:25 [Multicraft] Skipped 38 lines due to rate limit (30/s)
The strangest (oddest?) part to me is that nLogin and CoreProtect are connected and working with MySQL.
To sum up, you have an invalid database connection URI. Try to connect It manually using your terminal mysql -u USERNAME -h HOST DATABASE -p or any other service. Then, if it's correct, insert final connection credentials into plugin configuration and retry.
I'll try to figure out how to do this, as I have no clues. As soon I get it done, or not, I'll be back here.
So! I discovered how to connect to the MySQL, and made a SELECT just to test it.
It went all good. Still not able to connect from PEconomy thought.
I Would like to address one more thing. I finished installing another plugin that uses MySQL (Statz). And it's working properly as far as I can see.
So, maybe it's a problem with permissions from my side, because I don't have full permissions in MySQL. But, probably, there's a workaround. Besides that, I experienced other Servers Host Providers that are almost the same, not allowing full control over the Databases.
You connected to 170.81.41.76
, not a 111
... May be you should set this correct address into PEconomy config file?
I've just tried to install the plugin with MySQL (MariaDB locally) by myself and it works perfectly, so I suppose these are troubles on your side. Recheck your MySQL credentials and user permissions.
I have a local MariaDB service with user 'test'@'localhost' with no password and full access to the 'test' database, so my configuration section looks like this:
database:
use-sqlite: false
host: localhost
port: 3306
name: test
user: test
password: ''
file: database.db
You connected to 170.81.41.
76
, not a111
... May be you should set this correct address into PEconomy config file?
Actually, I've set the PEconomy config file since from the begging to connect to 170.81.41.76
database:
# Should plugin use MySQL database as data storage?
# Specify 'true' to use SQLite or 'false' to use MySQL
use-sqlite: false
# MySQL configuration
host: 170.81.41.76
port: 3306
name: rh5623
user: rh5623
password: **********
So I went all the way from the beginning, fresh started the server. The plugin seems to work fine until switched to MySQL. Still unable to connect.
[PEconomy] Enabling PEconomy v2.0.2
05.05 16:49:36 [Server] INFO [PEconomy] Loaded 2 currencies.
05.05 16:49:36 [Server] ERROR [PEconomy] Failed to initialize database: Access denied for user 'rh5623'@'170.81.41.111' (using password: YES)
05.05 16:49:36 [Server] WARN java.sql.SQLException: Access denied for user 'rh5623'@'170.81.41.111' (using password: YES)
I also started a ticket with my server provider, they're completely useless. Good to know that though. I'm making all the configs from the server and problably will change my provider as for production.
Just to add, I've tried to connect direclty througth MySQL WorkBench 8.0 and was unable also. The only way was using MySQL Query Browser due to a bad handshake error. Solution for direct connect..
I'll stick to using SQLite by now, until trying again in another host.
By the way, is your database named 'rh5623' in MySQL? Just I've noticed that the database.name
yaml path is a bit misleading.
At this point, you can contact me on SpigotMC (I have the same nickname on there) and I'll create a database for you on my German host (at least for this month) (totally free :D)
By the way, is your database named 'rh5623' in MySQL?
Yes, it is!
This Host "REISHOST" is a popular provider here in Brazil. They use the same "key" of the user account for almost anything they need. So my account is rh5623. The database name is the same, the user name is the same. Kinda weird.
I have only privileges creating tables inside this database. It's messy all the tables mixed.
At this point, you can contact me on SpigotMC (I have the same nickname on there) and I'll create a database for you on my German host (at least for this month) (totally free :D)
OMG! This is really kind! Thank you! I'll be in touch if needed. Thanks again!
Okay. I think that I should to close this issue. If the problem persists, continue in the new issue. Good luck!
So, I have tried to connect to MySQL and runeed into some problem.
The plugin start initialization and never get done.
This is the config file.
Host IP and password omitted.
In the Console (Multicraft) this is the only message:
04.05 07:35:17 [Server] INFO [PEconomy] Loading PEconomy v2.0.2
And then, when trying to run /peco help, I get this:
When I switch back to
use-sqlite: true
it runs properly.By reference, I have two other plugins connected to MySQL (CoreProtect and nLogin).
(My English is a work in progress, also, first time reporting something in GitHub. Sorry for any mistakes).