Magento 1.9 site where "SQL ERROR: SQLSTATE[42S22]" keeps showing up after daily reindex (and in other instances) - sql

I own a Magento CE 1.7 based website where we keep getting variations of the following error, usually after the daily morning site reindex:
"SQL ERROR: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'main_table.data' in 'field list'
SQL QUERY: SELECT DISTINCT main_table.data, main_table.lifetime, main_table.expire, main_table.priority, additional_table.*, IFNULL(al.value, main_table.frontend_label) AS store_label FROM eav_attribute AS main_table
INNER JOIN catalog_eav_attribute AS additional_table ON additional_table.attribute_id = main_table.attribute_id
LEFT JOIN eav_attribute_label AS al ON al.attribute_id = main_table.attribute_id AND al.store_id = 1 WHERE (main_table.entity_type_id (...)"
I have a website down detector set up so that I can know immediately when the site is unavailable. However it obviously doesn't detect whenever the site is unusable due to errors such as “SQL ERROR: SQLSTATE[42S22]”. That means that my team must be constantly manually (!!!) monitoring if the site is indeed working properly (by clicking on product and category links)!
Usually we surpass the error by just cleaning the cache or performing a new reindex.
My questions are the following:
1 - Is there a way of automatically perform a detection of this type of errors in Magento so that - if it happens - a cache cleaning (or a site reindex) is immediately run and an alert is sent to the webmaster?
2 – If such an error is detected, is there a way of it not be shown to the person accessing the site? That is, if the error is detected, is it possible to immediately display a message (“We’ll be back soon”) while the cache is being cleaned or the site reindexed?
I will be grateful for any help you can provide.
Thank you!

Related

Datastream Troubleshoot: "An unknown error occurred. Please try again. If the error persists, contact Google support"

We are trying to replicate data from AlloyDB to Bigquery using Datastream.
We Get "An unknown error occurred. Please try again. If the error persists, contact Google support."
In the Datastream console --> objects list, we see all source tables with Object Status "Failed" and Backfill status "Completed".
In Bigquery we see only a subset of the tables (not all the "Completed" objects were synced).
In the Logs Explorer I can see this error on BQ:
I also see this error: error: {
code: 11
message: "Unsupported primary key column either does not exist or is a pseudocolumn at [1:401]"
}
The column referred in the error is of type enum.
The desired situation is having all the AlloyDB tables replicated into Bigquery.
The error message is not very informative...
What does it mean?
What would be the best way to go about troubleshooting this?
We're actively working on making these error messages be more informative, and improvements are continuously being rolled out as we identify more edge cases. Assuming you followed all the steps in the documentation, then you may need to open a ticket with support for further investigation. If a support ticket isn't an option, you can still report the issue using the public issue tracker
I just had this same issue but connecting to a PostgreSQL in AWS RDS:
Beginning with Postgres 10, passwords are encrypted using SCRAM-SHA-256 in PostgreSQL. Google DataStream still expects MD5 password encryption, or it will generate an "unknown error" in the logs and fail the backfills.
You'll need to update your postgresql.conf (or RDS Cluster Parameter Group if you're using AWS like me):
password_encryption = 'MD5'
Restart the database and make sure the parameter has changed with:
SHOW password_encryption;
Reset the password of your users:
ALTER USER "{username}" with password '{password}';
More info from the PostgreSQL docs: https://www.postgresql.org/docs/current/auth-password.html

Unknown Exception with Code: 13

I have created a new project, then went to VM Instances. It says "enabling compute engine". After some time, it throws the following error:
Unknown Exception with Code: 13.
Why am I receiving this error? Do I have to set up permissions or anything else?
In some cases that error occurs because your project doesn't have a billing account assigned. You can check if this is your problem in the left menu Billing -> Manage Billing Accounts from drop down box.

X-Cart - SQL error notification (Error code : 1030)

I am working on xcart website for my company. Right now, I always get the error messages from my website http://mothersenvogue.com.kh/ as below:
[24-May-2015 08:50:51] (shop: 24-May-2015 15:50:51) SQL error:
Site : https://mothersenvogue.com.kh
Remote IP : 176.9.29.209
Logged as :
SQL query : SHOW FIELDS FROM xcart_session_history
Error code : 103
Description : Got error 28 from storage engine
Request URI: /secure_login.php?xid=025530538a738ddc86617a9aa81bc990
Backtrace:
/home/www/mothersenvogue.com.kh/include/func/func.db.php:189
/home/www/mothersenvogue.com.kh/include/func/func.db.php:115
/home/www/mothersenvogue.com.kh/include/func/func.db.php:384
/home/www/mothersenvogue.com.kh/include/func/func.db.php:630
/home/www/mothersenvogue.com.kh/include/func/func.db.php:458
/home/www/mothersenvogue.com.kh/include/sessions.php:161
/home/www/mothersenvogue.com.kh/init.php:524
/home/www/mothersenvogue.com.kh/preauth.php:51
/home/www/mothersenvogue.com.kh/auth.php:45
/home/www/mothersenvogue.com.kh/secure_login.php:37
-------------------------------------------------
Many error messages are from func.db.php, init.php, preauth.php, auth.php all at the same line number, and on the same SQL Query "SHOW" statement.
I tried to check all the above files at their given line number but I could not find anything wrong.
Pleasse kindly help advise me what is wrong with it? is it something wrong inside these files as I got many error messages sent to me by email with the similar content like above.
I was refered to here from my previous question in xcart forum, and here is my question there:
https://bt.x-cart.com/view.php?id=44717
Many thanks.
In most cases the file storage (the drive where your files are located on the hosting server, where you checked the free space) is physically located on a different virtual / physical server / drive. Most hosting companies use an optimized dedicated servers for MySQL.
Thus you see enough space in your account, but MySQL still reports that there is no space left on the drive (where MySQL server is currently running).
Thus the best way is to contact the hosting provider and find out what's the situation with the disk space on that very machine, where MySQL is running.

Invalid operation result set is closed errorcode 4470 sqlstate null - DB2 data extract

I am running a very simple query and trying to extract the results to a text file. The entire query is essentially what is below, I am selecting everything from one single table with one piece of where criteria which is limiting the data to one month's worth. After it has extracted around 1.2 gig this error shows up. Is there any way that I can work around this other than extracting smaller date ranges? I am trying to pull a couple of years worth of data so if I can only get it a few days at a time it will take a lot of manual work.
I am currently using the free trial of a DB2 query tool - Razor SQL if that makes a difference, I can probably purchase different software if it would help. I am trying to get IBM's tool but for some reason it freezes during the download so I am still working on that. I have searched about this error but everything I see seems much more complex than what I am doing and I can't tell if it applies or not. Thanks in advance.
select *
from MyTable
where date_col between date '2014-01-01' and date '2014-01-31'
I stumbled at this error too, found out it is related to db2jcc.jar (type 4) driver.
Excerpt: If there are no items in the result set left (or to begin with), the Result set is closed automatically and therefore the Exception. Suggestion is to handle it in the application, perhaps in my case, I started checking if(rs.next()) but otherwise, there is a work around. Check out the source link below for how you can set some properties to Data source and avoid exception.
Source :
"Invalid operation: result set is closed" error with Data Server Driver for JDBC
In my case, i missed some properties in WAS, after add allowNextOnExhaustedResultSet the issue is fixed.
1.Log in to the WebSphere Application Server administration console.
2.Select Resources > JDBC > Data sources > Application Center DataSource name > Custom properties and click New.
3.In the Name field, enter allowNextOnExhaustedResultSet.
4.In the Value field, type 1.
5.Change the type to java.lang.Integer.
6.Click OK.
Sometimes you need also check whether resultSetHoldability properties exists. Details refer to here.
I encountered this failure also when ugrading from JDBC Type 2 driver (db2java.zip) JDBC type 4 driver (db2jcc4.jar)
Statement statement = results.getStatement();
if (statement != null)
{
connection = statement.getConnection(); // ** failed here
statement.close();
}
Solution was to check if the statement is closed or not as follows.
Changed to:
Statement statement = results.getStatement();
if (statement != null && !statement.isClosed()) {
{
connection = statement.getConnection();
statement.close();
}
Creating property bellow with type Integer it's worked for me:
allowNextOnExhaustedResultSet:
I had the same issue on WAS 7 so i had to add and change few this on Admin Console.
This TeamWorksRuntimeException exception should be fixed by applying APAR JR50863 which is available on top of BPM V8.5.5 or included on BPM V8.5 refresh pack 6.
For the case that the APAR does not solve the problem, try following workaround:
Log in to the WebSphere Application Server admin console
Select Resources > JDBC > Data sources > DataSource name (TeamWorksDB) > Custom properties and click New
In the Name field, enter downgradeHoldCursorsUnderXa
In the Value field, type true
Change the type to java.lang.Boolean
Click OK to save your changes
Select custom property resultSetHoldability
In the Value field, type 1
Click OK to save your changes
Source of the Answer : https://developer.ibm.com/answers/questions/194821/invalid-operation-result-set-is-closed-errorcode-4/
Restarting the app may fix the problem if connection pool lost session to Db2. If using Tomcat then connection pool property of 'testonBorrow' may reestablish the connection to Db2.

Determine actual errors from a load job

Using the Java SDK I am creating a load job for just a single record with a fairly complicated schema. When monitoring the status of the load job, it takes a surprisingly long time (but perhaps this is due to working out the schema), but then says:
11:21:06.975 [main] INFO xxx.GoogleBigQuery - Job status (21694ms) create_scans_1384744805079_172221126: DONE
11:24:50.618 [main] ERROR xxx.GoogleBigQuery - Job create_scans_1384744805079_172221126 caused error (invalid) with message
Too many errors encountered. Limit is: 0.
11:24:50.810 [main] ERROR xxx.GoogleBigQuery - {
"message" : "Too many errors encountered. Limit is: 0.",
"reason" : "invalid"
?}
BTW - how do I tell the job that it can have more than zero errors using Java?
This load job does not appear in the list of recent jobs in the console, and as far as I can see, none of the Java objects contains any more details about the actual errors encountered. So how can I pro-grammatically find out what is going wrong? All I can find is:
if (err != null) {
log.error("Job {} caused error ({}) with message\n{}", jobID, err.getReason(), err.getMessage());
try {
log.error(err.toPrettyString());
}
...
In general I am having a difficult time finding good documentation for some of these things and am working it out by trial and error and short snippets of code found on here and older groups. If there is a better source of information than the getting started guides, then I would appreciate any pointers to that information. The Javadoc does not really help and I cannot find any complete examples of loading, querying, testing for errors, cataloging errors and so on.
This job is submitted via a NEWLINE_DELIMITIED_JSON record, supplied to the job via:
InputStream dummy = getClass().getResourceAsStream("/googlebigquery/xxx.record");
final InputStreamContent jsonIn = new InputStreamContent("application/octet-stream", dummy);
createTableJob = bigQuery.jobs().insert(projectId, loadJob, jsonIn).execute();
My authentication and so on seems to work correctly as separate Java code to list the projects, and the datasets in the project all works correctly. So I just need help in working what the actual error is - does it not like the schema (I have records nested within records for instance), or does it think that there is an error in the data I am submitting.
Thanks in advance for any help. The job number cited above is an actual failed load job if that helps any Google staffers who might read this.
It sounds like you have a couple of questions, so I'll try to address them all.
First, the way to get the status of the job that failed is to call jobs().get(jobId), which returns a job object that has an errorResult object that has the error that caused the job to fail (e.g. "too many errors"). The errorStream list is a lost of all of the errors on the job, which should tell you which lines hit errors.
Note if you have the job id, it may be easier to use bq to lookup the job -- you can run bq show <job_id> to get the job error information. If you add the --format=prettyjson it will print out all of the information in the job.
A hint you also might want to consider is to supply your own job id when you create the job -- then even if there is an error starting the job (i.e. the insert() call fails, perhaps due to a network error) you can look up the job to see what actually happened.
To tell BigQuery that some errors are allowed during import, you can use the maxBadResults setting in the load job. See https://developers.google.com/resources/api-libraries/documentation/bigquery/v2/java/latest/com/google/api/services/bigquery/model/JobConfigurationLoad.html#getMaxBadRecords().