Error "Schema "information_schema" not found;" running "migrate up" on H2 database - h2

I'm testing h2 database in a ColdBox application (on Lucee) ...
I can connect to database with Quick but I'm not able to run migrations...
this is the error displayed in CommandBox after migration init and migration up
ERROR (5.2.1+00295)
Schema "information_schema" not found; SQL statement:SELECT 1 FROM "information_schema"."tables" WHERE "table_name" = ? AND "table_schema" = ? [90079-172]
MigrationService.cfc
SELECT 1 FROM "information_schema"."tables" WHERE "table_name" = 'cfmigrations' AND "table_schema" = 'testAppDB'
Both Application.cfc and box.json use ENVIRONMENT settings:
# ColdBox Name and Environment
APPNAME=tastApp
ENVIRONMENT=development
DB_BUNDLEVERSION=1.3.172
DB_PORT=
DB_USER=sa
DB_BUNDLENAME=org.h2
DB_CLASS=org.h2.Driver
DB_HOST=127.0.0.1
DB_DRIVER=org.h2.Driver
DB_SCHEMA=appDB
DB_DATABASE=appDB
DB_CONNECTIONSTRING=jdbc:h2:/Users/elena/coldbox-examples/testApp/database/appDB;MODE=MySQL;
DB_PASSWORD=
h2 was downloaded from Lucee download page and saved in /lib folder (I've added dependencies in box.json)
this is the grammar settings:
"defaultGrammar":"AutoDiscover#qb"
What am I missing?
Thank you in advance
Elena
UPDATE - May 18
Thanks to Evgenij,
now I am able to query the latest version of h2, 1.4.200, which accepts the setting (CASE_INSENSITIVE_IDENTIFIERS = TRUE) which makes all identifier names (table names, column names) case insensitive.
Unfortunately migrations with commandbox-migrations still give me error:
these are the current configurations I am using:
"cfmigrations":{
"migrationsDirectory":"resources/database/migrations",
"schema":"INFORMATION_SCHEMA",
"connectionInfo":{
"bundleName":"com.h2database",
"bundleVersion":"1.4.200",
"password":"",
"connectionString":"jdbc:h2:/Users/elena/coldbox-examples/testApp/database/appDB;MODE=MySQL;DATABASE_TO_LOWER=TRUE;CASE_INSENSITIVE_IDENTIFIERS=TRUE;",
"class":"org.h2.Driver",
"username":""
},
"defaultGrammar":"AutoDiscover#qb"
}
this is the last error:
> * > CLI v5.2.1 > 10:59 AM > ~/coldbox-examples/testApp/ > testApp (1.0.0) >
lucee 5.3.7 (running) >
> migrate up
ERROR (5.2.1+00295) Unable to resolve com.h2database [108](R 108.0): missing requirement [com.h2database [108](R 108.0)] osgi.wiring.package; (&(osgi.wiring.package=org.osgi.framework)(version>=1.5.0))
Unresolved requirements: [[com.h2database [108](R 108.0)] osgi.wiring.package; (&(osgi.wiring.package=org.osgi.framework)(version>=1.5.0))]
caused by: org.osgi.framework.BundleException
Unable to resolve com.h2database [108](R 108.0): missing requirement [com.h2database [108](R 108.0)] osgi.wiring.package; (&(osgi.wiring.package=org.osgi.framework)(version>=1.5.0)) Unresolved requirements: [[com.h2database [108](R 108.0)] osgi.wiring.package; (&(osgi.wiring.package=org.osgi.framework)(version>=1.5.0))]

H2 1.3.172 is very old and it can't properly emulate non-standard lower case INFORMATION_SCHEMA from MySQL.
You need to use a recent version of H2 (such as 1.4.200, for example) with ;MODE=MySQL;DATABASE_TO_LOWER=TRUE appended to JDBC URL, ;MODE=MySQL alone is not enough.

Related

liquibase.exception.DatabaseException: Syntax error in SQL statement " CREATE EXTENSION[*] UUID-OSSP;

Im using postgres with liquibase on cloud and h2db on my local machine. When i write sql queries for generating uuid, i get the error during build:
liquibase.exception.DatabaseException: Syntax error in SQL statement " CREATE EXTENSION[*] UUID-OSSP;
So i removed ossp extension and used gen_random_uuid() instead. And i get the below eror:
Caused by: liquibase.exception.LiquibaseException:
liquibase.exception.MigrationFailedException: Migration failed for change set db/scripts/123_Somescripts.sql::raw::includeAll:
Reason: liquibase.exception.DatabaseException: Syntax error in SQL statement "
I start getting this error during build when i include H2 DB dependency. Otherwise the build works fine.
BUT, even if build works fine, i get the error:
***************************
APPLICATION FAILED TO START
***************************
Description:
Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured.
Reason: Failed to determine a suitable driver class
Action:
Consider the following:
If you want an embedded database (H2, HSQL or Derby), please put it on the classpath.
If you have database settings to be loaded from a particular profile you may need to activate it (no profiles are currently active).
Process finished with exit code 0
I configured postgres db in appication-local.yml, and activated local profile but build still fails.

Magento 2 SQLSTATE[HY000]: General error: 1823 Failed to add the foreign key constraint

Hello guys I was getting errors with my Magento 2 Store.. Such as Failed API Requests, Swagger gives 500, Stylesheets and JS files won't load etc..
Finally I found that the best solution to create a fresh Magento installation with fresh theme files and just copy pub/media from files and go with maintenance mode to drop all tables prefixed with customers_ , catalog_ , sales_ and eav_
This step made my new store works very good but I got new kind of errors .. I can't run setup:upgrade it shows a message with:
[PDOException] SQLSTATE[HY000]: General error: 1823 Failed to add the foreign key constraint 'porosec_pororom/CAT_CTGR_PRD_CTGR_ID_CAT_CTGR_ENTT_ENTT_ID' to system tables
Error when I run php -f bin/magento setup:db-schema:upgrade
The Command which occur the pervious message
also when I run composer update it updates many of dependencies but it require to run setup:upgrade.
Swagger Error 500
{"0":"Please upgrade your database: Run \"bin/magento setup:upgrade\"
from the Magento root directory.\nThe following modules are
outdated:\nKlarna_Core data: current version - 4.1.5, required version
- 4.2.3\nKlarna_Ordermanagement data: current version - 4.1.2, required version - 4.1.3","1":"#0
/home/porosec/public_html/test/vendor/magento/framework/Interception/Interceptor.php(121):
Magento\Framework\Module\Plugin\DbStatusValidator->beforeDispatch(Object(Magento\Framework\App\FrontController\Interceptor),
Object(Magento\Framework\App\Request\Http))\n#1
/home/porosec/public_html/test/vendor/magento/module-page-cache/Model/App/FrontController/BuiltinPlugin.php(73):
Magento\Framework\App\FrontController\Interceptor->Magento\Framework\Interception\{closure}(Object(Magento\Framework\App\Request\Http))\n#2
/home/porosec/public_html/test/vendor/magento/framework/Interception/Interceptor.php(135):
Magento\PageCache\Model\App\FrontController\BuiltinPlugin->aroundDispatch(Object(Magento\Framework\App\FrontController\Interceptor),
Object(Closure), Object(Magento\Framework\App\Request\Http))\n#3
/home/porosec/public_html/test/vendor/magento/framework/Interception/Interceptor.php(153):
Magento\Framework\App\FrontController\Interceptor->Magento\Framework\Interception\{closure}(Object(Magento\Framework\App\Request\Http))\n#4
/home/porosec/public_html/test/generated/code/Magento/Framework/App/FrontController/Interceptor.php(26):
Magento\Framework\App\FrontController\Interceptor->___callPlugins('dispatch',
Array, Array)\n#5
/home/porosec/public_html/test/vendor/magento/framework/App/Http.php(135):
Magento\Framework\App\FrontController\Interceptor->dispatch(Object(Magento\Framework\App\Request\Http))\n#6
/home/porosec/public_html/test/generated/code/Magento/Framework/App/Http/Interceptor.php(24):
Magento\Framework\App\Http->launch()\n#7
/home/porosec/public_html/test/vendor/magento/framework/App/Bootstrap.php(256):
Magento\Framework\App\Http\Interceptor->launch()\n#8
/home/porosec/public_html/test/index.php(39):
Magento\Framework\App\Bootstrap->run(Object(Magento\Framework\App\Http\Interceptor))\n#9
{main}","url":"/test/swagger","script_name":"/test/index.php"}
Swagger Error log
Also here's what I got in admin dashboard
Admin Panel error
[2018-06-04 23:18:09] main.CRITICAL: Report ID: webapi-5b15c8b17792e; Message: Class "array" does not exist. Please note that namespace must be specified. {"exception":"[object] (Exception(code: 0): Report ID: webapi-5b15c8b17792e; Message: Class \"array\" does not exist. Please note that namespace must be specified. at /home/porosec/public_html/test/vendor/magento/framework/Webapi/ErrorProcessor.php:205, LogicException(code: 0): Class \"array\" does not exist. Please note that namespace must be specified. at /home/porosec/public_html/test/vendor/magento/framework/Reflection/TypeProcessor.php:139)"} []
Admin Panel error log
if you have taken the backup of same table and if foreign key constraint is same as bkp table and current table mysql will throw exception, so change the constraint name or delete the existing constraint.
constraint name should not be same.

unable to connect Sql Developer using JDBC URL

I have jdbc URL as follows.
jdbc:oracle:thin:#(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=localhost)(PORT=8888))(LOAD_BALANCE = on)(CONNECT_DATA =(SERVER=DEDICATED) (SERVICE_NAME=XXX.XXX.XXX.XXX.com)))
When I connect using this URL from sql developer getting error as follows.
error ora 00604 error occurred at recursive sql level 1 ora-01882 timezone not found
I'm using Mac. If I go to .sqldeveloper -> 4.1.x -> product.conf.
There was a suggestion to change the tz to AddVMOption -Duser.timezone=CET . But I dont find any file called "sqldeveloper.conf".
Any idea here.
Resolved it by adding timezone values in sqldeveloper in product.conf file.
The path was : /Users/username/.sqldeveloper/4.1.5/product.conf (in MACS).
Added line was:
AddVMOption -Duser.timezone=GMT

Worklight 6.2 migration tool error

I am working on migrating data from WL 5.0.6.2 to 6.2. While doing that I encountered problems running data migration tool.
Background:
Approach:
we export the WRKLGHT table from 5062 DB to an intermediate DB for data migration so the running DB is not affected.
DBs:
1. schema: proj
its storing 5062 runtime data, upgrade-worklight-506-60-oracle.sql, upgrade-worklight-60-61-oracle.sql upgrade sql are executed.
2. schema: proj6
its blank DB at first, "create-worklightadmin-oracle.sql" is executed to prepare WLADMIN tables.
WL Project existing:
1. wlProj
its the app running on 5062 WL server
2. wlProj6
its the target project running on 6.2 WL, and data will be migrated to be used by this project
Steps:
1. recreate proj6 schema
1.1 SQLPlus -> connect as SYSTEM -> "drop user proj6 cascade"
1.2. -> "create user proj6 identified by {password}" -> "grant all privileges to proj6"
2. execute "create-worklightadmin-oracle.sql" on proj6 schema
2.1 SQLDeveloper -> connect as user proj6
2.2 run #"{ WL server install dir}/databases/create-worklightadmin-oracle.sql";
2.3 commit
3. Open cmd and run the following command
java -cp ojdbc6.jar;worklight-ant-deployer.jar com.ibm.worklight.config.dbmigration62.MigrationTool -p /wlProj -sourceurl jdbc:oracle:thin:#//192.168.0.**:1521/xe -sourcedriver oracle.jdbc.driver.OracleDriver -sourceuser proj -sourcepassword *** -targeturl jdbc:oracle:thin:#//192.168.0.***:1521/xe -targetdriver oracle.jdbc.driver.OracleDriver -targetuser proj6 -targetpassword *** 2>out.txt
'migrating wlProj-{ios,android}' & 'migrating access data record for wlProj-.....' are shown in cmd.
And in out.txt, the following error is shown.
15 WorklightManagementPU-oracle INFO [main] openjpa.Runtime - Starting OpenJPA 1.2.2
15 WorklightManagementPU-oracle INFO [main] openjpa.jdbc.JDBC - Using dictionary class "org.apache.openjpa.jdbc.sql.OracleDictionary".
com.ibm.worklight.config.dbmigration62.exceptions.MigrationException: FWLSE3406E: The applications migration failed with error The field "description" of instance "ApplicationEntity[id=51, name=wlProj, displayName=, description=null, thumbnail=null, platformVersion=null]" contained a null value; the metadata for this field specifies that nulls are illegal..
at com.ibm.worklight.config.dbmigration62.MigrationTool.run(MigrationTool.java:195)
at com.ibm.worklight.config.dbmigration62.MigrationTool.main(MigrationTool.java:128)
Caused by: <openjpa-1.2.2-r422266:898935 fatal user error> org.apache.openjpa.persistence.InvalidStateException: The field "description" of instance "ApplicationEntity[id=51, name=wlProj, displayName=, description=null, thumbnail=null, platformVersion=null]" contained a null value; the metadata for this field specifies that nulls are illegal.
at org.apache.openjpa.kernel.SingleFieldManager.preFlush(SingleFieldManager.java:540)
at org.apache.openjpa.kernel.SingleFieldManager.preFlush(SingleFieldManager.java:478)
at org.apache.openjpa.kernel.StateManagerImpl.preFlush(StateManagerImpl.java:2829)
at org.apache.openjpa.kernel.PNewState.beforeFlush(PNewState.java:39)
at org.apache.openjpa.kernel.StateManagerImpl.beforeFlush(StateManagerImpl.java:960)
at org.apache.openjpa.kernel.BrokerImpl.flush(BrokerImpl.java:1967)
at org.apache.openjpa.kernel.BrokerImpl.flushSafe(BrokerImpl.java:1927)
at org.apache.openjpa.kernel.BrokerImpl.beforeCompletion(BrokerImpl.java:1845)
at org.apache.openjpa.kernel.LocalManagedRuntime.commit(LocalManagedRuntime.java:81)
at org.apache.openjpa.kernel.BrokerImpl.commit(BrokerImpl.java:1369)
at org.apache.openjpa.kernel.DelegatingBroker.commit(DelegatingBroker.java:877)
at org.apache.openjpa.persistence.EntityManagerImpl.commit(EntityManagerImpl.java:512)
at com.ibm.worklight.config.dbmigration62.ApplicationMigration.migrateApplication(ApplicationMigration.java:138)
at com.ibm.worklight.config.dbmigration62.ApplicationMigration.migrate(ApplicationMigration.java:63)
at com.ibm.worklight.config.dbmigration62.AbstractMigration.run(AbstractMigration.java:66)
at com.ibm.worklight.config.dbmigration62.MigrationTool.run(MigrationTool.java:183)
... 1 more
ERROR 20 : FWLSE3406E: The applications migration failed with error The field "description" of instance "ApplicationEntity[id=51, name=wlProj, displayName=, description=null, thumbnail=null, platformVersion=null]" contained a null value; the metadata for this field specifies that nulls are illegal..
This is recorded as IBM PMR #77138,999,738, and was identified as a defect that is currently being worked on.
There is no local fix to do other than wait for a fix via the support ticket.

Custom Spring roo addon fail

I have a custom spring roo addon for extjs, I put it into bundle directory and deleted cache directory but when I initiate the console by msdos I'm having the next messange just in the entrance:
ERROR: Bundle com.xxx.xxx.addons.extjs [7] Error starting file:/K:/Software/springsource32/springsource/spring-roo-1.2.2.RELEASE/bundle/com.xxx.xxx.addons.extjs-2.0.2.jar (org.osgi.framework.BundleException: Unresolved constraint in bundle com.xxx.xxx.addons.extjs [7]: Unable to resolve 7.0:
missing requirement [7.0] package; (&(package=org.apache.commons.io)(version>=1.4.0)(!(version>=2.0.0))))
org.osgi.framework.BundleException: Unresolved constraint in bundle com.xxx.xxx.addons.extjs [7]: Unable to resolve 7.0: missing requirement [7.0] pack
age; (&(package=org.apache.commons.io)(version>=1.4.0)(!(version>=2.0.0)))
at org.apache.felix.framework.Felix.resolveBundle(Felix.java:3564)
at org.apache.felix.framework.Felix.startBundle(Felix.java:1797)
at org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1192)
at org.apache.felix.framework.StartLevelImpl.run(StartLevelImpl.java:266)
at java.lang.Thread.run(Thread.java:722)
I don't know why this happend and don't know what to check, can anybody help me?

Resources