when i use cursor.getCount() or cursor.moveToFirst() and no records are fetched from the db
android.database.sqlite.SQLiteDatabaseCorruptException: database disk image is malformed
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2596)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2621)
at android.app.ActivityThread.access$2200(ActivityThread.java:126)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1932)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:123)
at android.app.ActivityThread.main(ActivityThread.java:4595)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:521)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
at dalvik.system.NativeStart.main(Native Method) Caused by: android.database.sqlite.SQLiteDatabaseCorruptException: database disk image is malformed
at android.database.sqlite.SQLiteQuery.native_fill_window(Native Method)
at android.database.sqlite.SQLiteQuery.fillWindow(SQLiteQuery.java:75)
at android.database.sqlite.SQLiteCursor.fillWindow(SQLiteCursor.java:295)
at android.database.sqlite.SQLiteCursor.getCount(SQLiteCursor.java:276)
at android.database.AbstractCursor.moveToPosition(AbstractCursor.java:171)
at android.database.AbstractCursor.moveToFirst(AbstractCursor.java:248)
Someone suggest that Using multiple instances of SQLiteDatabase could be causing my problem if i have two instances updating the same database file at the same time.So for that i have checked each and every instance of db connection but nothing helps. :(
I just want to handle the exception before deleting the db.
So guys pls suggest something which resolve my problem.
if the DB gets corrupted you just replace the database with a backup. You can use simple file copy paste methods to maintain a backup each day.
Related
I'm trying to setup Redmine on the following products
redmine-4.0.7
Rails 5.2.4.2
Phusion Passenger 6.0.7
Apache/2.4.6
mysql Ver 14.14
I expected there will be initializing page however, I got `Internal Error' from http://mydomain/redmine/
I can see the following messages in log/prduction.log
Completed 500 Internal Server Error in 21ms (ActiveRecord: 1.5ms)
ActiveRecord::StatementInvalid (Mysql2::Error: Can't find file: './redmine/settings.frm' (errno: 13 - Permission denied): SHOW FULL FIELDS FROM `settings`):
It seems I need ./redmine/settings.frm but there isn't.
Does anyone know how to place ./redmine/settings.frm and what content should be in?
The error is thrown by your database server (i.e. MySQL). It seems that MySQL does not have the required permission to access the files where it stores the table data.
Usually, those files are handled (i.e. created, updated, and eventually deleted) entirely by MySQL which requires specific access patterns to ensure consistent data. Because of that, you should strongly avoid to manually change any files under control of MySQL. Instead, you should only use SQL commands to update table structures and table data.
o fix this issue now, you need to fix the permissions of your MySQL data files so that MySQL can properly access them. What exactly is required here is unfortunately not simply explained since there can be various causes. If you have jsut setup your MySQL server, it might be best start entirely new.
WSO2 ESB goes into error state on startup.
During startup, the following H2 database error is thrown.
org.h2.jdbc.JdbcSQLException: Row not found when trying to delete from
index
Due to some data corruption, the following error occurs. Restarts didnt help.
We need more information... ¿What do you need? , restart and recover all the resources in your install or just restart and keep working.
1.- Make a backup copy of all databases files in $CARBON_HOME/databases/ folder
2.- Restart a clean instances removing the corrupted database, remove all the H2 files in $CARBON_HOME/databases/ folder. If you have all your artifacts in $CARBON_HOME/deployment it should rebuild all.
WSO2 products has an inbuilt H2 database. Though its sufficient for DEV environments, Its not recommended for production.
For the above error, the H2 DB has been corrupted. To fix, rename the existing
$CARBON_HOME/databases/ folder and create an empty databases folder.
Start the server, with -Dsetup option as ./wso2server.sh -Dsetup
This will recreate a new DB setup and populate the required data.
I've set up a RedshiftCopy activity in AWS Data Pipeline, but it keeps failing with the following error:
java.lang.RuntimeException: java.sql.SQLException: No suitable driver found for <REDACTED> at private.com.google.common.base.Throwables.propagate(Unknown Source) at amazonaws.datapipeline.database.ConnectionFactory.getConnection(ConnectionFactory.java:145) at amazonaws.datapipeline.database.ConnectionFactory.getRedshiftDatabaseConnection(ConnectionFactory.java:80) at amazonaws.datapipeline.database.ConnectionFactory.getConnection(ConnectionFactory.java:47) at amazonaws.datapipeline.database.ConnectionFactory.getConnectionWithCredentials(ConnectionFactory.java:230) at amazonaws.datapipeline.redshift.RedshiftActivityRunnerFactory$RedshiftActivityRunner.<init>(RedshiftActivityRunnerFactory.java:29) at amazonaws.datapipeline.redshift.RedshiftActivityRunnerFactory.create(RedshiftActivityRunnerFactory.java:48) at amazonaws.datapipeline.activity.RedshiftCopyActivity.runActivity(RedshiftCopyActivity.java:49) at amazona
..etc
The "runsOn" EC2 instance is a Data Pipeline-managed resource, so I'm confused by the error, because I assumed that any instance that gets spun up by Data Pipeline, will have all the necessary resources installed.
Has anyone encountered this error before? What, if anything, did you do to fix it?
Thanks in advance.
Apparently, this is a known issue with AWS Data Pipeline. The suggested workaround for now is to use the Postgres JDBC driver instead of the Redshift one.
(Just change the "jdbc://redshift..." in the pipeline configuration to "jdbc://postgresql..." keeping everything else the same.)
We currently have two ColdFusion 10 dedicated servers which we are migrating to a single VPS server. We have many scheduled tasks on each. I have taken each of the neo-cron.xml files and copied the var XML elements, from within the struct type='coldfusion.server.ConfigMap' XML element, and pasted them within that element in the neo-cron.xml file on the new server. Afterward I restarted the ColdFusion service, log into cf admin, and the tasks all show as expected.
My problem is, when I try to update any of the tasks I get the following error when saving:
An error occured scheduling the task. Unable to store Job :
'SERVERSCHEDULETASK#$%^DEFAULT.job_MAKE CATALOGS (SITE CONTROL)',
because one already exists with this identification
Also, when I try to delete a task it tells me a task with that name does not exist. So it seems to me that the task information must also be stored elsewhere. So there when I try to update a task, the record doesn't exist in the secondary location so it tries to add it new to the neo-cron.xml file, which causes an error because it already exists. And when trying to delete, it doesn't exist in the secondary location so it says a task with that name does not exist. That is just a guess though.
Any ideas how I can get this to work without manually re-creating dozens of tasks? From what I've read this should work, but I need to be able to edit the tasks.
Thank you.
After a lot of hair-pulling I was able to figure out the problem. It all boiled down to having parentheses in the scheduled task names. This was causing both the "Unable to store Job : 'SERVERSCHEDULETASK#$%^DEFAULT.job_MAKE CATALOGS (SITE CONTROL)', because one already exists with this identification" error and also causing me to be unable to delete jobs. I believe it has something to do with encoding the parentheses because the actual neo-cron.xml name attribute of the var element encodes the name like so:
serverscheduletask#$%^default#$%^MAKE CATALOGS (SITE CONTROL)
Note that this anomaly did not exist on ColdFusion 10, Update 10, but does exist on Update 13. I'm not sure which update broke it, but there you go.
You will have to copy the neo-cron.xml from C:\ColdFusion10\\lib of one server to another. After that restart the server to make the changes effective. Login to the CF Admin and check the functionality.
This should work.
Note:- Please take a backup of the existing neo-cron.xml, before making the changes.
I am trying to load my data using a separate query to the server after the records get dirty in the store. The updated values are sent to the server and relevant actions are performed using a custom ajax call and handled at the server side to update all the related records. But when the data is loaded again I get the above mentioned error.
The possible reason could be, since the records are dirty in the store, and without committing the store I am trying to load the data again, it is giving me the error. So, I tried to do an "Application.defaultTransaction.rollback()". It removes those records from the updated bucket, but the "key" in the updated bucket (the object type) still exists and I still get the error. Can anyone help me with this?
In short: is there a way to force clean the store or move all the objects in created/updated/inflight buckets to clean bucket?
Application.store.get('defaultTransaction').rollback() will remove any dirty objects in the store and take it to the initial state.
There is an open issue for store.rollback() too which might be an alternative when merged to master.
https://github.com/emberjs/data/pull/350#issuecomment-9578563