1 (edited by JimmyC 08/12/2018 05:11:39 am)

Topic: Does SQL_Trail accurately show errors?

I just made a new FA install Version 2.4.4 Build 12.04.2018 on a 1and1 hosted server with all system diagnostics showing OK.  After setting up the Company, System and General GL Setup and US COA for a nonprofit company, I turned on $show_sql, $sql_trail, and $debug to test Quick Entries that I created for Utility Bill payments.

Examining the SQL_Trail in the DB showed constantly occurring errors of failed db writes, failed commits but there were no errors showing on the bottom of active pages!  Just normal SQL showing where data was read and written.

Here is a list of the first page of $sql_trail errors:

-   could not update last visit date for user  (only once at the beginning but happens every time you start)
-   could not start a transaction
-   order Cannot be Added
-   order Details Cannot be Added
-   order Details Cannot be Added
-   order Details Cannot be Added
-   Cannot add audit info
-   Cannot update audit gl_seq
-   The debtor transaction detail could not be written
-   The parent document detail record could not be upd...
-   Concurrent editing conflict while sales order upda...
-   The debtor transaction record could not be inserte...
-   Cannot add audit info
-   Cannot update audit gl_seq
-   The debtor transaction detail could not be written
-   The parent document detail record could not be upd...
-   The stock movement record cannot be inserted
-   The debtor transaction detail could not be written
-   The GL transaction could not be inserted
-   Cannot insert a GL transaction for the debtors acc...
-   he bank transaction could not be inserted
-   could not add comments transaction entry
-   could not update reference entry
-   The next transaction ref for 12 could not be updat..
-   A customer allocation could not be added to the da...
-   could not commit a transaction


On and on and on it repeats.

Can anyone shed any light on this for me.  I am worried that after entering years of accounting data, the DB will not be valid because of missing tidbits of data.

Please let me know if you need any more specifics about the installation to properly address my concerns.

[url=https://vgruk.com/]buy here[/url]

Re: Does SQL_Trail accurately show errors?

There are two possibilities.

    1. The Database user many not have Insert.Update Permissions to perform operations.
    2. The Given database corrupted the columns. or it might be corrupted database like missing some tables.

Check these facts and if you still face the same issue comment it back.

Subscription service based on FA
HRM CRM POS batch Themes

Re: Does SQL_Trail accurately show errors?

@kvvaradha - Thank you for such a quick reply!  So, to try to answer your questions, I will list below what and how I started this database:

1.  I am the System Administrator of the 1and1.com MySQL databases version 5.5.60-0+deb7u1-log, PHP version 7.1.20, Http server type Apache, Server system Linux. The database was created new and empty online through the 1and1.com Dashboard MySQL Database control panel.  Setup username and password and initialized at 1024 of 1024 MB available.

2. I then created at my root access of the hosting site a directory named xxyyzz and unzipped the tar file to it.   Using a Chrome browser on my Windows10 x64 pc, went to the url of my site: https://mycompany.co/xxyyzz which immediately went into the FA installation wizard.  The wizard completed with absolutely no warnings or errors including the input of me, jimmyc, as Administrator, setting up my password and DB location/password, etc.

3.  Logging into FA the first time I chose to use the US COA for a nonprofit company for the initial opening and immediately went into the Setup tab => Access Setup => System Administrator and enabled every single item in the list.  But, I noticed when I am in FA, the top left corner shows "MycompanyName | mycompany.co | Administrator", not "System Administrator".

4.  So before I began this post, I logged into my FA on my website and captured the sql_trail just for this login.  It is attached in the csv format and it shows that FA "could not get validate user login for jimmyc".

Finally, I wish to point out that the install and creation of this MySQL DB was done within about one hours time yesterday.  This was to narrow down why I am getting these errors.  I have a "similar" installation done March 28, 2018 with thousands of records already entered and the sql_trail of that database is where I had first noticed these problems.

I hope you can help me solve my problem, which I am beginning to think it is caused by "could not get validate user login for jimmyc".  Please note that in my attached file, I did change the password string to "xxxxxxxxxxxx".

[url=https://vgruk.com/]buy here[/url]

Re: Does SQL_Trail accurately show errors?

OOPS ! ! !   I forgot the csv attachment....but I don't know how to attach a file.  So I'll paste a few lines in.

274    SELECT * FROM 0_users WHERE user_id = 'jimmyc' AND password='xxxxxxxxxxxxxxxxxxxxxx'    
            1    could not get validate user login for jimmyc
275    SELECT * FROM 0_users WHERE user_id='jimmyc'    1    could not get user jimmyc
276    SELECT * FROM 0_security_roles WHERE id=2    1    could not retrieve security roles
277    "UPDATE 0_users SET last_visit_date='2018-08-12 08:57:02'
        WHERE user_id='jimmyc'"    1    could not update last visit date for user jimmyc
278    SET sql_mode = ''    1

[url=https://vgruk.com/]buy here[/url]

Re: Does SQL_Trail accurately show errors?

The first user is "admin". The second user is "jimmyc". Try logging in with "admin".
It is possible that the Chart of Accounts you used may not be updated to the schema for the default Charts.

Try a fresh install with the sql/en_US-new.sql chart.

Re: Does SQL_Trail accurately show errors?

Brand new install. 
Used the new USA 4-digit COA - ONLY!
Used the default "admin" account with a new password.
Setup => Access setup => System Administrator and enabled everything,
Brand new Bank account created (1066).

Still produced "some" of the same errors and I pasted them below.

Dumping data for table 0_sql_trail
1    SET sql_mode = ''    1   
2    UPDATE 0_users SET last_visit_date='2018-08-12 17:16:24' WHERE user_id='admin'    1    could not update last visit date for user admin
3    SET sql_mode = ''    1   
4    SET sql_mode = ''    1   
5    UPDATE 0_users SET last_visit_date='2018-08-12 17:17:08' WHERE user_id='admin'    1    could not update last visit date for user admin
6    SET sql_mode = ''    1   
7    SET sql_mode = ''    1   
8    SET sql_mode = ''    1   
9    SET sql_mode = ''    1   
10    SET sql_mode = ''    1   
11    SET sql_mode = ''    1   
12    INSERT INTO 0_chart_master (account_code, account_code2, account_name, account_type) VALUES ('1066', '', 'Undeposited Donations', '1')    1   
13    SET sql_mode = ''    1   
14    SET sql_mode = ''    1   
15    SET sql_mode = ''    1   
16    INSERT INTO 0_bank_accounts (account_code, account_type, bank_account_name, bank_name, bank_account_number, bank_address, bank_curr_code, dflt_curr_act, bank_charge_act) VALUES ('1066', '3', 'Undeposited Donations', 'Treasurer', '','', 'USD', '0', '5690')    1    could not add a bank account for 1066
17    SET sql_mode = ''    1   


I still can't figure out why.

[url=https://vgruk.com/]buy here[/url]

Re: Does SQL_Trail accurately show errors?

@JimmyC - It looks like the server is not responding you for all ur queries. If you need me to check your server contact me, we can check in either TV or Anydesk.

Subscription service based on FA
HRM CRM POS batch Themes

Re: Does SQL_Trail accurately show errors?

Replace each instance of

'

with an apostrophe (single quote) and then execute the SQLs in order in some MySQL client like phpMyAdmin, SQLyog, etc.

Chances are that the db user you created does not have sufficient write permissions.

9 (edited by JimmyC 08/14/2018 02:53:28 am)

Re: Does SQL_Trail accurately show errors?

@apmuthu; Thank you for your reply.  I'm not sure if I do have sufficient rights or not because I don't know how to check and see if I had entered the correct user with the correct password.  I tried to look through the PHP files on the server install directory of my FA.  I do have multiple MySQL databases for different programs that we use.  But, as far as I know, there is only one database username & password for each database and with any error in either the name or password there will be no connection possible to that database.  Also, this user has full rights to only this one database.

@kvvaradha has offered to help me diagnose the DB setup and trouble shoot what may be causing my errors and hopefully I will learn.

But, I still don't know how to change the DB, username or password in FA.  Could you point me where to look?

[url=https://vgruk.com/]buy here[/url]

Re: Does SQL_Trail accurately show errors?

@apmuthu; I just realized one point that I haven't made is that even though sql_trail shows the errors I have listed, all but one or two out of the hundreds listed did complete correctly to the database.  For instance, for the following error:

INSERT INTO 0_bank_accounts (account_code, account_type, bank_account_name, bank_name, bank_account_number, bank_address, bank_curr_code, dflt_curr_act, bank_charge_act) VALUES ('1066', '3', 'Undeposited Donations', 'Treasurer', '','', 'USD', '0', '5690')    1    could not add a bank account for 1066
17    SET sql_mode = ''


The database still made the Bank account of 1066 with all of the field values listed.  I apologize for not pointing this out earlier because this may turn out to be a hand-shaking timing error.   I am also saying that all of the above errors that I listed in the previous posts except for "Concurrent editing conflict while sales order upda..." completed correctly without throwing an exception to the users form.  The errors only showed up in the sql_trail table in the database.

If this post raises any more unanswered questions, please ask and I will respond.

[url=https://vgruk.com/]buy here[/url]

Re: Does SQL_Trail accurately show errors?

JimmyC wrote:

@kvvaradha has offered to help me diagnose the DB setup and trouble shoot what may be causing my errors and hopefully I will learn.

But, I still don't know how to change the DB, username or password in FA.  Could you point me where to look?

You can do it through config_db.php

Probably. try to install some other framework or cms like wordpress. and use it there. if the server has problem you can experience the same problem there.

Subscription service based on FA
HRM CRM POS batch Themes

Re: Does SQL_Trail accurately show errors?

@kvvaradha, On the same server that hosts FA, I also run two other packages (HumHub which is written in YII and Mantis) for the last 21 months.  MySQL has not ever given either of those two packages any problems.  FA is the first application that we have experienced any time of DB read access or write problems.

I am still at a loss of why because I just do not know PHP hardly at all and it has been ten years since I worked with HTML web pages.  So I am of no help trying to figure out where in the FA code are the routines that actually control selecting and putting data. 

I will welcome your thoughts and any direction that you could offer me to try to figure out what is going on.

[url=https://vgruk.com/]buy here[/url]

13 (edited by JimmyC 08/14/2018 05:57:58 am)

Re: Does SQL_Trail accurately show errors?

@kvvaradha, pertaining to config_db.php and the DB user, everything looks good except the line: collation' => utf8_xx.  I'm not sure what that really tells MySQL to use.   When I remember that when I setup that DB, it did ask what UTF setting to use.

Not knowing what "collation' => 'utf8_xx" means, I  don't know how to compare this to our setting. 

Thank you for pointing me to the config_db.php file.  I had skipped right over it after looking in the config.php file.

[url=https://vgruk.com/]buy here[/url]

Re: Does SQL_Trail accurately show errors?

I forgot to say, the current DB collation is utf8_unicode_ci

[url=https://vgruk.com/]buy here[/url]

Re: Does SQL_Trail accurately show errors?

Can i get credentials to check there.?

Subscription service based on FA
HRM CRM POS batch Themes

Re: Does SQL_Trail accurately show errors?

@apmuthu; I have PM'd kvvaradha with credentials he requested along with 1N1.COM's suggested PHP script to connect to the MySQL DB for the FA link.

Let me know if you need any links/credentials to help.

[url=https://vgruk.com/]buy here[/url]

17 (edited by kvvaradha 08/14/2018 02:08:40 pm)

Re: Does SQL_Trail accurately show errors?

@JimmyC - I just checked your message and replied it. Anyway i post the answer here.


I read it. i dont think you have problem.  Some php versions has conflicting problem. sometimes a certain module is prohibited to use.. Like that some functions of FA is prohibited to run there.   

Example when i open the purchase invoice,, it shows the below error

There are no suppliers defined in the system.
/homepages/36/d687707890/htdocs/rrbc/includes/ui/ui_msgs.inc:14:    trigger_error('There are no suppliers defined in the system.','256')
/homepages/36/d687707890/htdocs/rrbc/includes/data_checks.inc:245:    display_error('There are no suppliers defined in the system.','1')
/homepages/36/d687707890/htdocs/rrbc/purchasing/po_entry_items.php:73:    check_db_has_suppliers('There are no suppliers defined in the system.')

For this error, you dont need to worry, it has to show "There are no suppliers defined in the system."

trigger_error - function was failed to work in your server.  may be the error reporting functions are affected badly due to their 1and1 firwall. so its connected few functions affected. display_error, check_db_has_supplier

function display_error($msg, $center=true)
{
    trigger_error($msg, E_USER_ERROR);
}

function display_notification($msg, $center=true)
{
    trigger_error($msg, E_USER_NOTICE);
}

function display_warning($msg, $center=true)
{
    trigger_error($msg, E_USER_WARNING);
}
Subscription service based on FA
HRM CRM POS batch Themes

Re: Does SQL_Trail accurately show errors?

@kvvaradha - Thank you for a quick reply again.   To paraphrase how I understand what you are saying is that  sometimes there are "warnings" triggered quick and presented in the sql_trail but after a very short time through the process of the DB firewall, the operation does complete despite the warning.

I did get in the habit of checking through FA user queries like "Sales order inquiry" and "GL inquiry" to verify the page operations (Direct Invoice, Bank Payment, etc.) completed properly.  So far, since the start of this total posting, all DB operations have completed properly when I checked inside the actual MySql DB even though the SQL_Trail reports problems.

Unless I can find an actual time DB operations do not complete (which has only occurred once in the hundreds of operations I've inspected), I will consider this post resolved.

Thank you again for your help (and apmuthu) and I will delete the connections I sent you in a couple of weeks if nothing else has happened.

[url=https://vgruk.com/]buy here[/url]

Re: Does SQL_Trail accurately show errors?

Hope it will be fixed and incase of error reporting issue,  you can check with 1and1 for more details.

Subscription service based on FA
HRM CRM POS batch Themes