mediawiki transfer database in sqlite - sqlite

I've established new mediawiki environment but I am getting the following error while migrating the sqlite db to the new environment. Also I upgraded to version of mediawiki 1.22 to 1.32. Is there Anybody has any idea about that situation or new steps to establish sqlite from older one.
Turning off Content Handler DB fields for this part of upgrade.
...have ss_active_users field in site_stats table.
An error occurred:
A database query error has occurred. Did you forget to run your application's database schema
updater after upgrading?
Query: UPDATE site_stats SET ss_active_users = '0' WHERE ss_row_id = '1'
Function: DatabaseUpdater::doActiveUsersInit
Error: 8 attempt to write a readonly database
Purging caches...<!DOCTYPE html>
<html><head><title>Dahili hata - MediaWiki</title><style>body { font-family: sans-serif;
margin: 0; padding: 0.5em 2em; }</style></head><body>
<div class="errorbox mw-content-ltr"><p>[Y#YbH#8tt-A18niaaU7SwQAAANQ] /mediawiki/mw-
config/index.php?page=Upgrade Wikimedia\Rdbms\DBQueryError from line 1506 of
/var/www/html/mediawiki/includes/libs/rdbms/database/Database.php: A database query error has
occurred. Did you forget to run your application's database schema updater after upgrading?
<br />
Query: DELETE FROM objectcache<br />
Function: DatabaseUpdater::purgeCache<br />
Error: 8 attempt to write a readonly database<br />
</p><p>Backtrace:</p><p>#0
/var/www/html/mediawiki/includes/libs/rdbms/database/Database.php(1476):
Wikimedia\Rdbms\Database->makeQueryException(string, integer, string, string)<br />
#1 /var/www/html/mediawiki/includes/libs/rdbms/database/Database.php(1236):
Wikimedia\Rdbms\Database->reportQueryError(string, integer, string, string, boolean)<br />
#2 /var/www/html/mediawiki/includes/libs/rdbms/database/Database.php(2964):
Wikimedia\Rdbms\Database->query(string, string)<br />
#3 /var/www/html/mediawiki/includes/installer/DatabaseUpdater.php(1071):
Wikimedia\Rdbms\Database->delete(string, string, string)<br />
#4 /var/www/html/mediawiki/includes/installer/DatabaseInstaller.php(396): DatabaseUpdater-
>purgeCache()<br />
#5 /var/www/html/mediawiki/includes/installer/WebInstallerUpgrade.php(65): DatabaseInstaller-
>doUpgrade()<br />
#6 /var/www/html/mediawiki/includes/installer/WebInstaller.php(272): WebInstallerUpgrade-
>execute()<br />
#7 /var/www/html/mediawiki/mw-config/index.php(79): WebInstaller->execute(array)<br />
#8 /var/www/html/mediawiki/mw-config/index.php(38): wfInstallerMain()<br />
#9 {main}</p></div>
</body></html>

I resolved problem myself, I've shared steps with some guys who want to migrate the mediawiki with sqlite.
sqlite3 my_wiki.sqlite .dump > backup_sqlite.sqlite
The file which has been created by above should be migrate to new sqlite location and than run the that commands for migration old data.
sqlite3 mediawiki.sqlite < backup_sqlite.sqlite

Related

Flyway migration blocked by null version_rank

I'm using PostgreSQL 9.5 and flyway 5.0.7
Everything worked fine for the previous 6 migrations but now it blocks for the latest
I have the following error :
22:27:45.230 [INFO ] o.f.c.i.u.l.slf4j.Slf4jLog - Flyway Community Edition 5.0.7 by Boxfuse
22:27:45.408 [INFO ] o.f.c.i.u.l.slf4j.Slf4jLog - Database: jdbc:postgresql://localhost:32767/my_db (PostgreSQL 9.5)
22:27:45.566 [INFO ] o.f.c.i.u.l.slf4j.Slf4jLog - Successfully validated 7 migrations (execution time 00:00.061s)
22:27:45.658 [INFO ] o.f.c.i.u.l.slf4j.Slf4jLog - Current version of schema "public": 6
22:27:45.733 [INFO ] o.f.c.i.u.l.slf4j.Slf4jLog - Migrating schema "public" to version 7 - update
Exception in thread "main" org.flywaydb.core.internal.exception.FlywaySqlException:
Unable to insert row for version '7' in Schema History table "public"."flyway_schema_history"
---------------------------------------------------------------------------------------------
SQL State : 23502
Error Code : 0
Message : ERROR: null value in column "version_rank" violates not-null constraint
Détail : Failing row contains (null, 7, 7, update, SQL, V7__update.sql, -1303600795, postgres, 2018-02-25 22:28:00.536556, 158, t).
at org.flywaydb.core.internal.schemahistory.JdbcTableSchemaHistory.doAddAppliedMigration(JdbcTableSchemaHistory.java:171)
at org.flywaydb.core.internal.schemahistory.SchemaHistory.addAppliedMigration(SchemaHistory.java:146)
at org.flywaydb.core.internal.command.DbMigrate.doMigrateGroup(DbMigrate.java:378)
at org.flywaydb.core.internal.command.DbMigrate.access$400(DbMigrate.java:52)
at org.flywaydb.core.internal.command.DbMigrate$5.call(DbMigrate.java:297)
at org.flywaydb.core.internal.util.jdbc.TransactionTemplate.execute(TransactionTemplate.java:75)
at org.flywaydb.core.internal.command.DbMigrate.applyMigrations(DbMigrate.java:294)
at org.flywaydb.core.internal.command.DbMigrate.migrateGroup(DbMigrate.java:259)
at org.flywaydb.core.internal.command.DbMigrate.access$300(DbMigrate.java:52)
at org.flywaydb.core.internal.command.DbMigrate$4.call(DbMigrate.java:179)
at org.flywaydb.core.internal.command.DbMigrate$4.call(DbMigrate.java:176)
at org.flywaydb.core.internal.database.postgresql.PostgreSQLAdvisoryLockTemplate.execute(PostgreSQLAdvisoryLockTemplate.java:71)
at org.flywaydb.core.internal.database.postgresql.PostgreSQLConnection.lock(PostgreSQLConnection.java:110)
at org.flywaydb.core.internal.schemahistory.JdbcTableSchemaHistory.lock(JdbcTableSchemaHistory.java:148)
at org.flywaydb.core.internal.command.DbMigrate.migrateAll(DbMigrate.java:176)
at org.flywaydb.core.internal.command.DbMigrate.migrate(DbMigrate.java:145)
at org.flywaydb.core.Flyway$1.execute(Flyway.java:1206)
at org.flywaydb.core.Flyway$1.execute(Flyway.java:1168)
at org.flywaydb.core.Flyway.execute(Flyway.java:1655)
at org.flywaydb.core.Flyway.migrate(Flyway.java:1168)
at com.test.MyApplication.main(MainApplication.java:47)
Caused by: org.postgresql.util.PSQLException: ERROR: null value in column "version_rank" violates not-null constraint
Détail : Failing row contains (null, 7, 7, update, SQL, V7__update.sql, -1303600795, postgres, 2018-02-25 22:28:00.536556, 158, t).
at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2422)
at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2167)
at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:306)
at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:441)
at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:365)
at org.postgresql.jdbc.PgPreparedStatement.executeWithFlags(PgPreparedStatement.java:155)
at org.postgresql.jdbc.PgPreparedStatement.executeUpdate(PgPreparedStatement.java:132)
at org.flywaydb.core.internal.util.jdbc.JdbcTemplate.update(JdbcTemplate.java:334)
at org.flywaydb.core.internal.schemahistory.JdbcTableSchemaHistory.doAddAppliedMigration(JdbcTableSchemaHistory.java:165)
... 20 more
Any idea why this column "version_rank" is not generated or not initialized ?
Thanks in advance for your help
You upgraded from Flyway 3.x to 5.x, skipping 4.x. This is not possible as written in the release notes: https://flywaydb.org/documentation/releaseNotes#5.0.0
Upgrade to 4.2.0 first before upgrading to 5.x and everything will work as expected.
Also please take a minute to check the release notes next time you upgrade a major version.
Here's the commit with the metadata table changes if you need to apply the changes manually. I've linked to the version for postgres - search for the version of upgradeMetaDataTable.sql in the folder matching the required dialect.
Fortunately you can apply the changes as a standard flyway migration, as the metadata tables are not used until the end of each script.
E.G. create a migration V999.00__FlywayFix.sql to correct a flyway version table called flyway_table as follows:
DROP INDEX "flyway_table_vr_idx";
DROP INDEX "flyway_table_ir_idx";
ALTER TABLE "flyway_table" DROP COLUMN "version_rank";
ALTER TABLE "flyway_table" DROP CONSTRAINT "flyway_table_pk";
ALTER TABLE "flyway_table" ALTER COLUMN "version" DROP NOT NULL;
ALTER TABLE "flyway_table" ADD CONSTRAINT "flyway_table_pk" PRIMARY KEY ("installed_rank");
UPDATE "flyway_table" SET "type"='BASELINE' WHERE "type"='INIT';
it's worked for me for Postgres
CREATE TABLE flyway_schema_history (
installed_rank INTEGER NOT NULL,
version varchar(50) DEFAULT NULL,
description varchar(200) NOT NULL,
type varchar(20) NOT NULL,
script varchar(1000) NOT NULL,
checksum INTEGER DEFAULT NULL,
installed_by varchar(100) NOT NULL,
installed_on timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
execution_time INTEGER NOT NULL,
success BOOLEAN NOT NULL,
PRIMARY KEY (installed_rank)
);
INSERT INTO flyway_schema_history (installed_rank, version, description, type, script, checksum, installed_by, installed_on, execution_time, success)
SELECT installed_rank, version, description, type, script, checksum, installed_by, installed_on, execution_time, success
FROM schema_version;
ALTER TABLE schema_version RENAME TO bak_schema_version;

Apktool decompiling/decoding exception

I want to recompile adidas app. When I use Apktool in Windows CLI, the exception is raised:
C:\Apktool>apktool d adidasConfirmed.apk
I: Using Apktool 2.2.2 on adidasConfirmed.apk
I: Loading resource table...
Exception in thread "main" brut.androlib.AndrolibException: Multiple resources: spec=0x7f090000 string/abc_act
ion_bar_home_description, config=-sr
at brut.androlib.res.data.ResType.addResource(ResType.java:66)
at brut.androlib.res.data.ResType.addResource(ResType.java:55)
at brut.androlib.res.decoder.ARSCDecoder.readEntry(ARSCDecoder.java:270)
at brut.androlib.res.decoder.ARSCDecoder.readTableType(ARSCDecoder.java:226)
at brut.androlib.res.decoder.ARSCDecoder.readTableTypeSpec(ARSCDecoder.java:156)
at brut.androlib.res.decoder.ARSCDecoder.readTablePackage(ARSCDecoder.java:118)
at brut.androlib.res.decoder.ARSCDecoder.readTableHeader(ARSCDecoder.java:80)
at brut.androlib.res.decoder.ARSCDecoder.decode(ARSCDecoder.java:47)
at brut.androlib.res.AndrolibResources.getResPackagesFromApk(AndrolibResources.java:559)
at brut.androlib.res.AndrolibResources.loadMainPkg(AndrolibResources.java:72)
at brut.androlib.res.AndrolibResources.getResTable(AndrolibResources.java:64)
at brut.androlib.Androlib.getResTable(Androlib.java:67)
at brut.androlib.ApkDecoder.setTargetSdkVersion(ApkDecoder.java:193)
at brut.androlib.ApkDecoder.decode(ApkDecoder.java:102)
at brut.apktool.Main.cmdDecode(Main.java:166)
at brut.apktool.Main.main(Main.java:81)
What's wrong?
P.S. I've gotten this app from here.
Try this
apktool d adidasConfirmed.apk --keep-broken-res

Error passing uiautomator dump in viewclient.py

I am getting below exection when running viewclient. I am running this on Emulator using android-17 api.
viewclient = ViewClient(device, serialno)
File "/Users/dpbuild/Jenkins/workspace/AndroidViewer-FeatureBranch-UIAutomation/siamang/src/dtmilano/android/viewclient.py", line 948, in __init__
self.dump()
File "/Users/dpbuild/Jenkins/workspace/AndroidViewer-FeatureBranch-UIAutomation/siamang/src/dtmilano/android/viewclient.py", line 1478, in dump
self.setViewsFromUiAutomatorDump(received)
File "/Users/dpbuild/Jenkins/workspace/AndroidViewer-FeatureBranch-UIAutomation/siamang/src/dtmilano/android/viewclient.py", line 1251, in setViewsFromUiAutomatorDump
self.__parseTreeFromUiAutomatorDump(received)
File "/Users/dpbuild/Jenkins/workspace/AndroidViewer-FeatureBranch-UIAutomation/siamang/src/dtmilano/android/viewclient.py", line 1405, in _ViewClient__parseTreeFromUiAutomatorDump
self.root = parser.Parse(receivedXml)
File "/Users/dpbuild/Jenkins/workspace/AndroidViewer-FeatureBranch-UIAutomation/siamang/src/dtmilano/android/viewclient.py", line 832, in Parse
parserStatus = parser.Parse(uiautomatorxml, 1) ##UnusedVariable
File "/Tools/android-sdk-macosx/tools/lib/jython.jar/Lib/xml/parsers/expat.py", line 212, in Parse
xml.parsers.expat.ExpatError: XML document structures must start and end within the same entity.
Looking at the uiautomatorxml, by adding a print statement as below:
def Parse(self, uiautomatorxml):
# Create an Expat parser
parser = xml.parsers.expat.ParserCreate()
# Set the Expat event handlers to our methods
parser.StartElementHandler = self.StartElement
parser.EndElementHandler = self.EndElement
parser.CharacterDataHandler = self.CharacterData
# Parse the XML File
**print "DEBUG: " + uiautomatorxml**
parserStatus = parser.Parse(uiautomatorxml, 1) ##UnusedVariable
return self.root
I got,
DEBUG: (XML file starts in a normal fashion, below is tail end of the log that was printed)
<node index="1" text="" class="android.view.View" package="com.android.launcher" content-desc="" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" scrollable="true" long-clickable="false" password="false" selected="false" bounds="[0,25][800,1232]"><node index="2" text="" class="android.view.View" package="com.android.launcher" content-desc="Home screen 3" checkable="false" checked="false" clickable="true" enabled="true" focusable="false" focus
130515 19:41:07.014:S [MainThread] [com.android.monkeyrunner.MonkeyRunnerOptions] Script terminated due to an exception
Clearly, XML is not fully formed. I was wondering if you had any ideas on why this could be happening and how to resolve this.
I guess its because UIAutomation return contents is too long.Because I got the same message with you,but when I tern to one little view page and run and I fount that ViewClient is work well .. so I guess is something wrong with the sockets message didn't end with the complete oparate...
For me this was linked to performance of the machine where I was running emulator. I was able to resolve this issue by enabling hardware acceleration and having a machine with 1GB graphics card.
Steps for enabling hardware acceleration:
Check "use host gpu" in simulator.
Download and install Intel
HAXM.

"XMLCommand.initialize failed: java.lang.NullPointerException" when using dataset-proxy in a workflow databroker

I'm creating a workflow databroker, and in the pre-workflow I am using a dataset-proxy to iterate over the populate-dataset. However I get the following error when I compile:
XMLCommand.initialize failed: java.lang.NullPointerException
at nz.co.aviarc.xml.command.dataset.DatasetProxy.initialize(DatasetProxy.java:35)
at com.aviarc.framework.xml.command.XMLCommandElementImpl.finalize(XMLCommandElementImpl.java:90)
at com.aviarc.framework.xml.compilation.XMLSAXHandler.endElement(XMLSAXHandler.java:336)
at net.sf.saxon.event.ContentHandlerProxy.endElement(ContentHandlerProxy.java:391)
at net.sf.saxon.event.NamespaceReducer.endElement(NamespaceReducer.java:213)
at net.sf.saxon.event.ReceivingContentHandler.endElement(ReceivingContentHandler.java:443)
at org.apache.xerces.parsers.AbstractSAXParser.endElement(AbstractSAXParser.java:598)
at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanEndElement(XMLNSDocumentScannerImpl.java:673)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(XMLDocumentFragmentScannerImpl.java:1645)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:324)
at org.apache.xerces.parsers.XML11Configuration.parse(XML11Configuration.java:875)
at org.apache.xerces.parsers.XML11Configuration.parse(XML11Configuration.java:798)
at org.apache.xerces.parsers.XMLParser.parse(XMLParser.java:108)
at org.apache.xerces.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1198)
at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:564)
at net.sf.saxon.event.Sender.sendSAXSource(Sender.java:404)
at net.sf.saxon.event.Sender.send(Sender.java:193)
at net.sf.saxon.IdentityTransformer.transform(IdentityTransformer.java:30)
at com.aviarc.framework.xml.compilation.AviarcXMLResourceCompiler.compile(AviarcXMLResourceCompiler.java:137)
...
I get exactly the same error even when I use the code example straight out of the documentation (com.aviarc.dataset:1.1.0):
<workflow xmlns:ds="urn:aviarc:xmlcommand:com.aviarc.dataset">
<ds:dataset-proxy dataset="ds" proxyname="dsproxy">
<set-current-row dataset="dsproxy" position="2" />
<set-field field="dsproxy.email" value="test#test.com" />
</ds:dataset-proxy>
</workflow>
Turns out that the documentation is wrong, as proxyname is not a valid attribute on dataset-proxy. I didn't see it at first (because of the huge stack trace) but I was also getting this warning:
Unknown attribute 'proxyname'
The correct attribute is name, not proxyname. Changing this resolved the error.

segmentation fault pro*c code for database connection

I wrote simple pro*c program to check database connectivity. The code is :
int main()
{
char *conn_string = "IDA/IDA#DBISPSS";
int x = 10;
printf("value of x is before db connection %d\n",x);
printf(" conn_string %s \n",conn_string);
EXEC SQL CONNECT :conn_string;
EXEC SQL SELECT 1 INTO :x FROM DUAL;
printf("value of x is %d\n",x);
return 0;
}
Following commands I executed to create exectuable (test_connection) of pro*c code
proc test_connection.pc
cc -I${ORACLE_HOME}/precomp/public -c test_connection.c
cc test_connection.o -o test_connection -L$ORACLE_HOME/lib -lclntsh
and when I executed test_connection exe,the output is
value of x is before db connection 10
conn_string IDA/IDA#DBISPSS
Segmentation fault
But the same code workes well in another linux machine and solaris machine.
Why segmentation fault is thrown?
I tested in HPUX 11.11/Oracle 11 and work ok. I don't see any problem, but try some changes:
Declare 'x' into a DECLARE SECTION:
EXEC SQL BEGIN DECLARE SECTION;
int x = 0;
EXEC SQL END DECLARE SECTION;
Try this connection command:
EXEC SQL BEGIN DECLARE SECTION;
char *user = "abc", *password = "123", *database="base";
EXEC SQL END DECLARE SECTION;
EXEC SQL DECLARE BASE_HANDLE DATABASE;
...
EXEC SQL CONNECT :user IDENTIFIED BY :password AT BASE_HANDLE USING :database;
...
EXEC SQL AT BASE_HANDLE SELECT 1...
Insert a printf("here 1"); between EXEC SQL CONNECT... and EXEC SQL SELECT ... to see where SEGFAULT is thrown.
I had that problem and no amount of fiddling with my source made any difference. What finally worked was when I reinitialized all (ALL) my libraries to make sure that Oracle only had access to the 32 bit versions of the library. It seems Oracle was somehow getting connected to a 64 bit library. Only by removing all references to any libraries or executables except the 32 bit versions worked. This included running a 32 bit version of Pro*C.

Resources