Flyway 7.7.3 seems to ignore my "callback" - flyway

I am upgrading from Flyway 5.4 to 7.7.3 and ran into some issue.
flyway -teams -url=jdbc:oracle:thin:#localhost:1521/XE "-user=xxx as SYSDBA" -password=xxx -table=flyway_schema_history_app -encoding=utf-8 -baselineOnMigrate=true migrate
(I have the teams edition license)
Flyway gives me the following error message:
**
ERROR: Unable to parse statement in /flyway/sql/incremental/Build_302_Baseline/V302_106__fosprd_INSERT_Master_eg_pocqueue.sql at line 117 col 1. See https://flywaydb.org/documentation/knownparserlimitations for more information: No value provided for variable substitution: &R. Check your configuration. If this is not a SQLPLus variable intended to be substituted (eg. in a string literal), then you will need to add SET DEFINE OFF in the script beforehand.
Caused by: No value provided for variable substitution: &R. Check your configuration. If this is not a SQLPLus variable intended to be substituted (eg. in a string literal), then you will need to add SET DEFINE OFF in the script beforehand.
**
This is caused by a special character "&" in the SQL statement, however, I have made sure the SQL file is using UTF-8 encoding as well as Unix return (LF).
Also, I keep my callbacks under:
bash-5.0$ pwd
/flyway/sql/callbacks
bash-5.0$ ls
afterBaseline.sql afterEachUndo.sql afterMigrateError.sql afterUndo.sql beforeEachUndo.sql
afterBaselineError.sql afterEachUndoError.sql afterRepair.sql afterUndoError.sql beforeMigrate.sql
afterEachMigrate.sql afterMigrate.sql afterRepairError.sql beforeEachMigrate.sql beforeUndo.sql
This used to be able to run on 5.4 with no issue. But it's giving me this error on 7.7.3, anyone can point me to the right direction?
Thanks

This is due to the changes between versions of flyway's SQLPlus support and the fat you have a teams license.
As indicated in the message, this is related to SQLPlus's variable substitution:
https://flywaydb.org/documentation/database/oracle#variable-substitution
If you are not using SQLPlus features, you could try disabling them:
https://flywaydb.org/documentation/configuration/parameters/oracleSqlPlus
but the recommended solution is to place SET DEFINE OFF in the SQL script before the offending ampersand (with the option of reverting that afterwards)

Related

default_time_zone not recognised by MariaDB

I'm trying to set the GLOBAL time of my MariaDB database to UTC. I've followed the recommendations of their official documentation and default_time_zone="+00:00" in the my.cnf file, however it does NOT work and I get the following error when I start it in the shell: mysql: unknown variable 'default_time_zone=+00:00'.
Does anyone have an idea?
Thanks
Remove the quotes
As the error message states command line client (mysql) complains about unknown variable, since default_time_zone is a server but not a client variable. So you added it in wrong section. Move the entry to the server section:
[server]
default_time_zone=+00:00

Why does R source() sometimes work and sometimes gives an error

I have the API credentials in one separate R script to keep it out of Git. I want to run this script in the beginning of the scripts that actually interact with the different servers. I have successfully used the same strategy for all my global functions.
setwd("G:/script")
source("API_credentials.R") # gives always an error
# > source("API_credentials.R")
# Error: '\s' is an unrecognized escape in character string starting ""g:\s"
source("ProVeg_functions.R") # runs fine
Problem:
Why does the first source() not work, while the second one does? The error message does not make any sense to me.
Solutions tried:
I have tried different escape chars \.
I have tried writing full path & file names.
I have tried putting the file name in as a variable, which gets its
content from a dir() search, to make sure that the file exists and
the name is correctly written.
Order of source() does not change situation.
Isolating the piece of code with error, and restarting R.
upgraded all my packages and R to version 4.0.2.
The API_credentials.r script works fine when run on its own. the Sys.setenv() works fine and I can read the API keys with Sys.getenv().
I am not sure if it is related to my problem, but if I do usethis::edit_r_environ() I can not see my API keys.
Setup
Windows 10, R-Studio 1.3.1093, R version 4.0.2 (2020-06-22)
I mistakenly assumed that the error message was related to the script calling the API_credentials.R, but it actually was an error message indicating an error in the API_credentials.R script. Fixed a typo and all is good.

Cannot proceed alfresco installation because of encoding mismatch

I am new to Alfresco and I am trying to install alfresco in my debian server(via ssh access) following the installation guide. However, the installation stops and shows me this error :
Error: There has been an error.
initdb.bin: encoding mismatch
The encoding you selected (UTF8) and the encoding that the selected
locale uses (LATIN1) do not match. This would lead to misbehavior in
various character string processing functions. Rerun initdb.bin and either
do not specify an encoding explicitly, or choose a matching combination.
I tried updating the locales of the server but still the issue exists. How do I fix this?
I have successfully installed it by doing the following steps:
Commented out the Send_ENV in /etc/ssh/ssh_config variable in the local machine and Accept_ENV in /etc/ssh/sshd_config variable in the server.
Edited /etc/locale.gen to uncomment en_US.UTF-8.
Ran locale-gen
Edited /etc/locale.conf and added LANG=en_US.UTF-8.
Successfully installed alfresco.

Issue while installing the weblogic 12 jar at windows

C:\Program Files\weblogic>"C:\Program Files\Java\jdk1.8.0_102\bin\java" -jar fmw_12.2.1.1.0_wls_quick.jar
Launcher log file is C:\Users\kb\AppData\Local\Temp\OraInstall2016-10-05_10-23-23PM\launcher2016-10-05_10-23-23PM.log.
Extracting the installer . . . . . . . . Done
Checking if CPU speed is above 300 MHz. Actual 2594 Passed
Checking swap space: must be greater than 512 MB Passed
Checking if this platform requires a 64-bit JVM. Actual 64 Passed (64-bit not required)
Checking temp space: must be greater than 300 MB. Actual 825693 MB Passed
Preparing to launch the Oracle Universal Installer from C:\Users\kb\AppData\Local\Temp\OraInstall2016-10-05_10-23-23PM
Log: C:\Users\kb\AppData\Local\Temp\OraInstall2016-10-05_10-23-23PM\install2016-10-05_10-23-23PM.log
*****************************************************
Distribution Name : Oracle Fusion Middleware 12c WebLogic and Coherence Developer
Distribution Version : 12.2.1.1.0
Oracle Home : C:\Program Files\weblogic\wls12210
Java Home : C:\Program Files\Java\jdk1.8.0_102
Note: Oracle Home not supplied (defaulted to <present working dir>\wls12210)
*****************************************************
Copyright (c) 1996, 2016, Oracle and/or its affiliates. All rights reserved.
Skipping Software Updates
Starting check : CertifiedVersions
Expected result: One of 6.1,6.2,6.3,10.0
Actual Result: 10.0
Check complete. The overall result of this check is: Passed
CertifiedVersions Check: Success.
Starting check : CheckJDKVersion
Problem: This JDK version was not certified at the time it was made generally available. It may have been certified following general availability.
Recommendation: Check the Supported System Configurations Guide (http://www.oracle.com/technetwork/middleware/ias/downloads/fusion-certification-100350.html) for further details. Press "Next" if you wish to continue.
Expected result: 1.8.0_77
Actual result: 1.8.0_102
Warning: Check:CheckJDKVersion completed with warnings.
Validations are enabled for this session.
Verifying data
[VALIDATION] [ERROR]:INST-07004: Oracle Home location contains one or more invalid characters
[VALIDATION] [SUGGESTION]:The directory name may only contain alphanumeric, underscore (_), hyphen (-) , or dot (.) characters, and it must begin with an alphanumeric character. Provide a different directory name.
installation Failed. Exiting installation due to data validation failure.
The log(s) can be found here: C:\Users\kb\AppData\Local\Temp\OraInstall2016-10-05_10-23-23PM.
Press Enter to exit
I tried SET ORACLE_HOME="C:\Program Files\weblogic"
executing from C:\Program Files\weblogic
How to solve this problem? Or is there any other weblogic jar files needs to be used?
Set the ORACLE_HOME argument when executing the Java command at the command-line:
i.e.:
C:\Program Files\Java\jdk1.8.0_144\bin>java -jar C:\WebLogicDownloads\fmw_12.2.1.2.0_wls_quick.jar ORACLE_HOME=C:\WebLogicServer
The issue is solved. I changed the JDK location to C driver "C:\" from "C:\program files".
Thanks!
Apparently the following error is important:
INST-07004: Oracle Home location contains one or more invalid characters
[VALIDATION] [SUGGESTION]:The directory name may only contain alphanumeric,
underscore (_), hyphen (-) , or dot (.) characters, and it must begin with
an alphanumeric character. Provide a different directory name. installation
Failed. Exiting installation due to data validation failure.
The problem is the space in the middle of "Program Files". Do to the limitations on the name you can't even use the 8-character abbreviated name for Program Files (usually PROGRA~1). I suggest you install WebLogic directly into the root of your C: drive, so try using C:\weblogic.
Best of luck.
Your folder name with setup is invalid or you are installing from rar directly then this problem arises. Check the software information path to see if it is invalid.

Oracle Exception Detail

I'm using Flyway 3.0 within ANT and I would like to know if the stack when an Oracle error occur could be more detailed.
Example: if my migration script contain this statement:
DROP TABLE FOO$;
And this table doesn't exist, I expect:
ORA-00942 : table or view does not exist
But I got:
Flyway Error: org.flywaydb.core.internal.dbsupport.FlywaySqlScriptException: Error executing statement at line 4: DROP TABLE FOO$
Not optimal for root cause analysis...
Any idea for better verbosity ?
You can use Ant's standard -d switch to reveal more info. If you feel the standard info should be improved, please file a bug report in the issue tracker.
Adding the -X option to the flyway command line will print debug output.

Resources