Does it support AWS - Amazon captcha ?
SQL - Module for working with SQL databases
-
@tecnewb, the module executes the request as soon as you call its action, if the connection has already been completed, if the connection has not yet been completed, then the connection is performed first, and then the request. If an error occurs while connecting to the database, then most likely the problem is in your database.
-
problem is NOT the DB. promised
3 examples:
1. bot with nodejs mysql2 function
can run 2000 writes per second no problem. no errors
all values are corrrectly inserted
insert into log (id,timestamp,botname,comment) values ([[ID]],CURRENT_TIMESTAMP,[[BOTNAME]],[[COMMENT]]);
--> insert into log (id,timestamp,botname,comment) values (123,CURRENT_TIMESTAMP,'test','test');2. Bot with your SQL and "Execute query" function
can run 2000 writes per second no problem. no errors
all values are corrrectly inserted
insert into log (id,timestamp,botname,comment) values ([[ID]],CURRENT_TIMESTAMP,[[BOTNAME]],[[COMMENT]]);
--> insert into log (id,timestamp,botname,comment) values (123,CURRENT_TIMESTAMP,'test','test');3. Bot with your SQL and "Insert Row" function
First run after new start:
insert into log (id,timestamp,botname,comment) values ([[ID]],CURRENT_TIMESTAMP,[[BOTNAME]],[[COMMENT]]);
--> insert into log (id,timestamp,botname,comment) values (NULL,NULL,NULL,NULL);
NO VALUES !!!!!4. Bot with your SQL and "Insert Row" function
second run, can run 2000 writes per second no problem. no errors
insert into log (id,timestamp,botname,comment) values ([[ID]],CURRENT_TIMESTAMP,[[BOTNAME]],[[COMMENT]]);
--> insert into log (id,timestamp,botname,comment) values (123,CURRENT_TIMESTAMP,'test','test');
all values are corrrectly insertedit is always ONLY on 1. run
is there something i can check locally? DB connection is fine and everything else works fine as well, just not sequelize
-
Please see this video for screen recording
-
Table:
CREATE TABLE `z_log` ( `action_id` int NOT NULL AUTO_INCREMENT, `time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, `error` tinyint(1) NOT NULL DEFAULT '0', `vm_id` int NOT NULL, `run_id` varchar(45) NOT NULL, `botname` varchar(45) NOT NULL, `message` varchar(500) NOT NULL, PRIMARY KEY (`action_id`) ) ENGINE=InnoDB AUTO_INCREMENT=467 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;This file has to be put in "C:/Sync/vm.csv" it contains the settings for the bot: VM_ID, DB Host IP ([[DB_IP]]), DB User, DB Password
Variable "ACC_ID" is not set in the file but also not used in the script
Please note this file is TAB Seperated and that the DB Name is hardcoded in the "DB Setup" Function in "start"
--> vm.csvhere is a sample project file from the video
--> AAA_new_bot_template.xmlTest Data to be inserted to DB is generated live by the script
Funny sidenote:
when the "Insert records" is in the "Main" function, then "execute query" fails with the error of empty VM_ID
when you delete "insert records" everything works
this happens only AFTER "Insert records" is triggered
--> https://streamable.com/k77vu6 -
@GhostZ okay i disabled the modules and nodejs, but it is still the same
but when it is not there for you, do you have any additional runtimes/libraries installed on your PC?
On my VM i only installed Visual C++ redist 2019 x64did you use mysql or sqlite?
maybe sequelize mysql implementation is just broken -
@tecnewb, Sqlite, but it doesn't matter which dialect is used, because the module itself works with all dialects in the same way, and if there was an error in the module, it would be with any dialect. If the error is repeated with Node.js 8.6.0 disabled, then most likely the error is really in the sequelize implementation. But I previously checked all actions with mysql and there were no errors. Check if you have an error with this project SQLtester.xml.
-
[424058906] [22:28:30] Thread #1 : Executing (default): SELECT 1+1 AS result [424058906] [22:28:30] Thread #1 : Executing (default): SELECT 2+3 AS result [424058906] [22:28:30] Thread #1 : Result: [{"result":5}] [424058906] [22:28:30] Thread #1 : Executing (default): SELECT 1+1 AS result [989962290] [22:28:31] Thread #1 : Query | Function completed successfully [66240405] [22:28:31] Thread #1 : Executing (default): DROP TABLE IF EXISTS CountRecords [953171962] [22:28:31] Thread #1 : CountRecords | An error occured (66240405): SequelizeDatabaseError: DROP command denied to user 'bot'@'10.0.0.143' for table 'CountRecords' [66240405] [22:28:32] Thread #1 : Executing (default): DROP TABLE IF EXISTS InsertRecords_SelectRecords [953171962] [22:28:32] Thread #1 : InsertRecords_SelectRecords | An error occured (66240405): SequelizeDatabaseError: DROP command denied to user 'bot'@'10.0.0.143' for table 'InsertRecords_SelectRecords' [66240405] [22:28:33] Thread #1 : Executing (default): DROP TABLE IF EXISTS DeleteRecords [953171962] [22:28:33] Thread #1 : DeleteRecords | An error occured (66240405): SequelizeDatabaseError: DROP command denied to user 'bot'@'10.0.0.143' for table 'DeleteRecords' [66240405] [22:28:34] Thread #1 : Executing (default): DROP TABLE IF EXISTS UpdateRecords [953171962] [22:28:34] Thread #1 : UpdateRecords | An error occured (66240405): SequelizeDatabaseError: DROP command denied to user 'bot'@'10.0.0.143' for table 'UpdateRecords' [989962290] [22:28:35] Thread #1 : Close | Function completed successfullyMessages: 1 - SequelizeDatabaseError: DROP command denied to user 'bot'@'10.0.0.143' for table 'InsertRecords_SelectRecords' 1 - SequelizeDatabaseError: DROP command denied to user 'bot'@'10.0.0.143' for table 'DeleteRecords' 1 - SequelizeDatabaseError: DROP command denied to user 'bot'@'10.0.0.143' for table 'UpdateRecords' 1 - SequelizeDatabaseError: DROP command denied to user 'bot'@'10.0.0.143' for table 'CountRecords'
-
ok i created a new schema and gave it full rights
this happened[424058906] [22:38:47] Thread #1 : Executing (default): SELECT 1+1 AS result [424058906] [22:38:47] Thread #1 : Executing (default): SELECT 2+3 AS result [424058906] [22:38:47] Thread #1 : Result: [{"result":5}] [424058906] [22:38:47] Thread #1 : Executing (default): SELECT 1+1 AS result [989962290] [22:38:47] Thread #1 : Query | Function completed successfully [66240405] [22:38:48] Thread #1 : Executing (default): DROP TABLE IF EXISTS CountRecords [66240405] [22:38:48] Thread #1 : Result: [{"fieldCount":0,"affectedRows":0,"insertId":0,"info":"","serverStatus":2,"warningStatus":1},{"fieldCount":0,"affectedRows":0,"insertId":0,"info":"","serverStatus":2,"warningStatus":1}] [683197981] [22:38:48] Thread #1 : Executing (default): CREATE TABLE IF NOT EXISTS CountRecords ( id INTEGER PRIMARY KEY, test TEXT NOT NULL ); [683197981] [22:38:48] Thread #1 : Result: [{"fieldCount":0,"affectedRows":0,"insertId":0,"info":"","serverStatus":2,"warningStatus":0},{"fieldCount":0,"affectedRows":0,"insertId":0,"info":"","serverStatus":2,"warningStatus":0}] [560627700] [22:38:48] Thread #1 : Result: {"id":{"type":"INT","allowNull":false,"defaultValue":null,"primaryKey":true,"autoIncrement":false,"comment":null},"test":{"type":"TEXT","allowNull":false,"defaultValue":null,"primaryKey":false,"autoIncrement":false,"comment":null}} [953171962] [22:38:49] Thread #1 : CountRecords | An error occured (560627700): SequelizeDatabaseError: Invalid default value for 'id' [66240405] [22:38:49] Thread #1 : Executing (default): DROP TABLE IF EXISTS InsertRecords_SelectRecords [66240405] [22:38:49] Thread #1 : Result: [{"fieldCount":0,"affectedRows":0,"insertId":0,"info":"","serverStatus":2,"warningStatus":1},{"fieldCount":0,"affectedRows":0,"insertId":0,"info":"","serverStatus":2,"warningStatus":1}] [953171962] [22:38:49] Thread #1 : InsertRecords_SelectRecords | An error occured (66240405): SequelizeDatabaseError: Invalid default value for 'id' [66240405] [22:38:50] Thread #1 : Executing (default): DROP TABLE IF EXISTS DeleteRecords [66240405] [22:38:50] Thread #1 : Result: [{"fieldCount":0,"affectedRows":0,"insertId":0,"info":"","serverStatus":2,"warningStatus":1},{"fieldCount":0,"affectedRows":0,"insertId":0,"info":"","serverStatus":2,"warningStatus":1}] [953171962] [22:38:50] Thread #1 : DeleteRecords | An error occured (66240405): SequelizeDatabaseError: Invalid default value for 'id' [66240405] [22:38:51] Thread #1 : Executing (default): DROP TABLE IF EXISTS UpdateRecords [66240405] [22:38:51] Thread #1 : Result: [{"fieldCount":0,"affectedRows":0,"insertId":0,"info":"","serverStatus":2,"warningStatus":1},{"fieldCount":0,"affectedRows":0,"insertId":0,"info":"","serverStatus":2,"warningStatus":1}] [953171962] [22:38:51] Thread #1 : UpdateRecords | An error occured (66240405): SequelizeDatabaseError: Invalid default value for 'id' [989962290] [22:38:52] Thread #1 : Close | Function completed successfullythe table in the DB is empty
-
Bro thanks for your time, but i will just use the Execute Query function.
except you have a definitive clue now, i think the searching will be endless ;)
it's not worth our both time as it could be anything somewhere in my server setup to windows to sequelize -
@tecnewb, try this script again SQLtester.xml
-
[424058906] [23:14:15] Thread #1 : Executing (default): SELECT 1+1 AS result [424058906] [23:14:15] Thread #1 : Executing (default): SELECT 2+3 AS result [424058906] [23:14:15] Thread #1 : Result: [{"result":5}] [424058906] [23:14:15] Thread #1 : Executing (default): SELECT 1+1 AS result [989962290] [23:14:16] Thread #1 : Query | Function completed successfully [66240405] [23:14:16] Thread #1 : Executing (default): DROP TABLE IF EXISTS CountRecords [66240405] [23:14:16] Thread #1 : Result: [{"fieldCount":0,"affectedRows":0,"insertId":0,"info":"","serverStatus":2,"warningStatus":1},{"fieldCount":0,"affectedRows":0,"insertId":0,"info":"","serverStatus":2,"warningStatus":1}] [683197981] [23:14:16] Thread #1 : Executing (default): CREATE TABLE IF NOT EXISTS CountRecords ( id INTEGER PRIMARY KEY NOT NULL DEFAULT 0, test TEXT NOT NULL ); [683197981] [23:14:16] Thread #1 : Result: [{"fieldCount":0,"affectedRows":0,"insertId":0,"info":"","serverStatus":2,"warningStatus":0},{"fieldCount":0,"affectedRows":0,"insertId":0,"info":"","serverStatus":2,"warningStatus":0}] [560627700] [23:14:17] Thread #1 : Result: {"id":{"type":"INT","allowNull":false,"defaultValue":"0","primaryKey":true,"autoIncrement":false,"comment":null},"test":{"type":"TEXT","allowNull":false,"defaultValue":null,"primaryKey":false,"autoIncrement":false,"comment":null}} [560627700] [23:14:17] Thread #1 : Executing (default): INSERT INTO `CountRecords` (`test`) VALUES ('test1'),('test2'),('test3'),('test21'); [953171962] [23:14:17] Thread #1 : CountRecords | An error occured (560627700): SequelizeUniqueConstraintError: Validation error [66240405] [23:14:18] Thread #1 : Executing (default): DROP TABLE IF EXISTS InsertRecords_SelectRecords [66240405] [23:14:18] Thread #1 : Result: [{"fieldCount":0,"affectedRows":0,"insertId":0,"info":"","serverStatus":2,"warningStatus":1},{"fieldCount":0,"affectedRows":0,"insertId":0,"info":"","serverStatus":2,"warningStatus":1}] [954873799] [23:14:18] Thread #1 : Executing (default): CREATE TABLE IF NOT EXISTS InsertRecords_SelectRecords ( id INTEGER PRIMARY KEY NOT NULL DEFAULT 0, text TEXT NOT NULL, num INTEGER NOT NULL, active BOOLEAN NOT NULL, null_or_not TEXT ); [954873799] [23:14:18] Thread #1 : Result: [{"fieldCount":0,"affectedRows":0,"insertId":0,"info":"","serverStatus":2,"warningStatus":0},{"fieldCount":0,"affectedRows":0,"insertId":0,"info":"","serverStatus":2,"warningStatus":0}] [355848310] [23:14:18] Thread #1 : Result: {"id":{"type":"INT","allowNull":false,"defaultValue":"0","primaryKey":true,"autoIncrement":false,"comment":null},"text":{"type":"TEXT","allowNull":false,"defaultValue":null,"primaryKey":false,"autoIncrement":false,"comment":null},"num":{"type":"INT","allowNull":false,"defaultValue":null,"primaryKey":false,"autoIncrement":false,"comment":null},"active":{"type":"TINYINT(1)","allowNull":false,"defaultValue":null,"primaryKey":false,"autoIncrement":false,"comment":null},"null_or_not":{"type":"TEXT","allowNull":true,"defaultValue":null,"primaryKey":false,"autoIncrement":false,"comment":null}} [953171962] [23:14:18] Thread #1 : InsertRecords_SelectRecords | An error occured (355848310): SequelizeDatabaseError: Invalid default value for 'num' [66240405] [23:14:19] Thread #1 : Executing (default): DROP TABLE IF EXISTS DeleteRecords [66240405] [23:14:19] Thread #1 : Result: [{"fieldCount":0,"affectedRows":0,"insertId":0,"info":"","serverStatus":2,"warningStatus":1},{"fieldCount":0,"affectedRows":0,"insertId":0,"info":"","serverStatus":2,"warningStatus":1}] [953171962] [23:14:19] Thread #1 : DeleteRecords | An error occured (66240405): SequelizeDatabaseError: Invalid default value for 'num' [66240405] [23:14:20] Thread #1 : Executing (default): DROP TABLE IF EXISTS UpdateRecords [66240405] [23:14:20] Thread #1 : Result: [{"fieldCount":0,"affectedRows":0,"insertId":0,"info":"","serverStatus":2,"warningStatus":1},{"fieldCount":0,"affectedRows":0,"insertId":0,"info":"","serverStatus":2,"warningStatus":1}] [953171962] [23:14:20] Thread #1 : UpdateRecords | An error occured (66240405): SequelizeDatabaseError: Invalid default value for 'num' [989962290] [23:14:21] Thread #1 : Close | Function completed successfully -
@tecnewb, ok, I understood the reason for the "Invalid default value for" error, I fixed it in the test project, updated the project in the message above and now I will fix it in the module code and post the updated version. But the reason for the "can not be empty" error is not yet known.



