'/azerothcore/data/sql/updates/db_world/2023_01_14_00.sql': Column 'guid' cannot be null - azerothcore

Using Docker installation
When I attach to the image (as notated in the install instructions https://www.azerothcore.org/wiki/install-with-docker )
docker attach azerothcore-wotlk_ac-worldserver_1
(which is incorrect BTW, the real image should be azerothcore-wotlk-ac-worldserver-1 notice there is no underscores)
I now get this error
Updating World database...
>> Applying update "2023_01_14_00.sql" '4092727'...
ERROR 1048 (23000) at line 170 in file: '/azerothcore/data/sql/updates/db_world/2023_01_14_00.sql': Column 'guid' cannot be null

Related

openstack stack update: No images matching

I wanted to update my stack to just change its flavor. I use the same template and just changes the name of the flavor in the environment file:
openstack stack update myStack -t heat/server_base.tpl.yaml -e heat/dev/redis_server.env.yaml
Tried also like this:
openstack stack update myStack --existing --parameter flavor=a1-ram2-disk20-perf1
Both gives me the same error:
"resource_status_reason": "resources.db_instance_group: Property error: resources[0].properties.image: Error validating value 'Debian 11.5 bullseye': No images matching {'name': 'Debian 11.5 bullseye'}."
I already done this on multiple other stacks without any problems, any ideas ?

How to refer tests to source/test files in utPLSQL?

I could use a little hand with utPLSQL.
I am trying to produce the test results so that Sonar would pick it up and scan them. so far, Sonar is picking up the report file, but the test executions are ignored because they are not referencing to the appropriate source files.
I am trying to make a reference to the source and test files when running ut.run(ut_sonar_test_reporter()); and our Jenkins does not have utPLSQL-cli installed. Short version: They said they will not install it.
To get a result for a single test, I tried the following:
spool sonar_results.xml;
exec ut.run('test_get_something');
exec ut.run(ut_sonar_test_reporter(), a_source_file_mapping => ut_file_mappings(ut_file_mapping(file_name => 'this_dir/get_something.fnc', object_owner=> 'GET_SOMETHING_OWNER', object_name=> 'GET_SOMETHING', object_type=>'FUNCTION'));
spool off;
And got the following error message:
Error starting at line : 4 in command -
BEGIN ut.run(ut_sonar_test_reporter(), a_source_file_mapping => ut_file_mappings(ut_file_mapping(file_name => 'this_dir/get_something.fnc', object_owner=> 'GET_SOMETHING_OWNER', object_name=> 'GET_SOMETHING', object_type=>'FUNCTION'));
Error report -
ORA-06550: line 1, column 219:
PLS-00306: wrong number or types of arguments to call to 'RUN'
ORA-06550: line 1, column 219
PL/SQL: Statement ignored
utPLSQL's documentation doesn't provide anything about referencing parameters like a_source_file_mapping or a_test_file_mapping.
I am a little stumped.

Intershop 7 - Problem adding a new index into database

I am trying to run a DatabaseIndexesPreparer through DBMigrate.bat and everytime it fails, therefore I have tried running needed SQL directly through Oracle SQLDeveloper and it also fails there with the same message.
This is the snippet I am trying to run:
EXEC staging_ddl.create_index('HWDB_ID_INDEX', 'PRODUCT', 'HWDBID', 'IS_INDX', 'NONUNIQUE', 0);
This is the result/message I receive:
ORA-00906: missing left parenthesis
ORA-06512: at "INTERSHOP.SQL_UTIL", line 149
ORA-06512: at "INTERSHOP.SQL_UTIL", line 49
ORA-06512: at "INTERSHOP.DDL", line 354
ORA-01403: no data found
ORA-06512: at "INTERSHOP.STAGING_DDL", line 235
ORA-06512: at line 1
00906. 00000 - "missing left parenthesis"
Additional info
All of this is done on Intershop 7.10.
HWDBID is a direct custom attribute (DCA) added successfully through DBMigrate following this cookbook:
https://support.intershop.com/kb/index.php/Display/L24707
The SQL snippet is also based on section 4 which deals with adding database index
Try this:
EXEC staging_ddl.create_index('HWDB_ID_INDEX', 'PRODUCT', '(HWDBID)', 'IS_INDX', 'NONUNIQUE', 0);
It seems like you always need to wrap the columns in parenthesis. From the example i found in 7.9 and 7.10 it is done like this.

ERROR: Attribute '' cannot be parsed: Cannot read property 'dataType' of undefined

I was creating document_types table using following cli command
sequelize model:create --name User --attributes name:string, username:string, email:string, password:string
Solution: remove the space after comma between different attributes to avoid the error, correct command would be:
sequelize model:create --name User --attributes name:string,username:string,email:string,password:string

Use AWK to safely search and replace URLs in Wordpress SQL-Dump

I am working on a webtool to mirror a Wordpress installation into a development system.
The aim is to have a Live system for production and a development system for testing. The webtool then offers a one-click-sync between those systems.
Each of the systems is standalone, with its own webroot, database and url.
I am having a trouble with the database dump in which I have to search all the references to the source and replace them with the URL of the destination (e.g.: "www.example.com" -> "www-dev.example.com").
What I need to do is:
Find all occurences of the URL and replace it with the new one.
IF the match also matches the format of a serialized string it should set the Field-Seperator, and reload the match, so that the actual length can be set in the array.
In a first attempt I tried to solve this with a 'sed' command looking as follows: sed -i.orig 's/360\.example\.com/360-dev\.my\.example\.dev/g'.
This didn't work because there are serialized arrays contained in the dump, containing the url. The sed command is no good for updating the string-length-indicator of the serialized arrays.
My latest attempt is to use an awk as suggested here, because it's capable of arithmetic operations.
My awk script looks like this:
/360[.]example[.]com/ {
sub("360.example.com", "360-dev.my.example.dev");
if ($0 ~ /s:[[:digit:]]+:["](http[s]?:\/\/)?360[.]example[.]com["]/){
FS="\"";
$0=$0;
n=length($2)-1;
sub(/:[[:digit:]]+:/, ":" n ":");
}
} 1
There seem to be some errors in my script, which I can't find. It does not replace all of the occurrences of the url and completely skips the length-indicator-update.
How can I fix my script to achieve what I want to do?
EDIT: (Added Input/Output samples)
Databasedump consists of the whole wordpress-database with CREATE TABLE IF NOT EXISTS and INSERT statements for each table and record.
Normal (unserialized) occurence:
(36, 'home', 'http://360.example.com/blogname', 'yes'),
should result in:
(36, 'home', 'http://360-dev.my.example.dev/blogname', 'yes'),
Serialized occurence:
(404, 'wp-maintenance-mode', 'a:21:{s:6:"active";i:1;s:4:"time";i:0;s:4:"link";i:1;s:7:"support";i:0;s:10:"admin_link";i:1;s:7:"rewrite";s:0:"";s:6:"notice";i:1;s:4:"unit";i:1;s:5:"theme";i:0;s:8:"styleurl";s:69:"http://360.example.com/wp-content/themes/blogname/css/maintenance.css";s:5:"index";i:0;s:5:"title";s:0:"";s:6:"header";s:0:"";s:7:"heading";s:0:"";s:4:"text";s:12:"Example Text";s:7:"exclude";a:1:{i:0;s:0:"";}s:6:"bypass";i:0;s:4:"role";a:1:{i:0;s:13:"administrator";}s:13:"role_frontend";a:1:{i:0;s:13:"administrator";}s:5:"radio";i:0;s:4:"date";s:0:"";}', 'yes'),
Should result in:
(404, 'wp-maintenance-mode', 'a:21:{s:6:"active";i:1;s:4:"time";i:0;s:4:"link";i:1;s:7:"support";i:0;s:10:"admin_link";i:1;s:7:"rewrite";s:0:"";s:6:"notice";i:1;s:4:"unit";i:1;s:5:"theme";i:0;s:8:"styleurl";s:76:"http://360-dev.my.example.dev/wp-content/themes/blogname/css/maintenance.css";s:5:"index";i:0;s:5:"title";s:0:"";s:6:"header";s:0:"";s:7:"heading";s:0:"";s:4:"text";s:12:"Example Text";s:7:"exclude";a:1:{i:0;s:0:"";}s:6:"bypass";i:0;s:4:"role";a:1:{i:0;s:13:"administrator";}s:13:"role_frontend";a:1:{i:0;s:13:"administrator";}s:5:"radio";i:0;s:4:"date";s:0:"";}', 'yes'),
EDIT 2:
Now using wp-cli to do the task of search & replace.
I've got a multisite setup with blogs numbered (2,3,9).
Executing wp search-replace --url=360.example.com '360.example.com' '360-dev.my.example.dev' results in an error, telling me that the Single-Site tables (wp_redirection_items and wp_redirection_groups) cannot be found.
This is true, because they really do not exist, but rather for each blog (e.g: wp_2_redirection_items and so on). This error results in over 9000 missed occurences in s&r. It's possible to replace everything with wp search-replace --url=360.example.com '360.example.com' '360-dev.my.example.com' wp_*. But it still throws the error.
As suggested by #archimiro the task now is done by wp-cli.
But as I am also having a multisite setup, which lead to some errors I had to figure out the command for a full database search-replace task.
The final command:
wp search-replace --url=360.example.com '360.example.com' '360-dev.my.example.dev' wp_*.
Without explicitly telling wp-cli to search&replace in ALL (wp_*) tables it would stop by the time a "table not found" error is thrown.
Also not awk or wpcli but this is a php function I wrote that seems to work well.
function snr($search, $replace, $inputfile, $outputfile){
$sql = file_get_contents($inputfile);
$sql1 = str_replace($search,$replace,$sql);
file_put_contents($outputfile,$sql1);
$serstrings = preg_split("/(?<=[{;])s:/",$sql1);
foreach($serstrings as $i=>$serstring) {
if (!!strpos($serstring, $replace)){
$justString = str_replace("\\","",str_replace("\\\\","j",explode('\\";',explode(':\\"',$serstring)[1])[0]));
$correct = strlen($justString);
$serstrings[$i] = preg_replace('/^\d+/',$correct, $serstrings[$i]);
}
}
file_put_contents($outputfile,implode("s:",$serstrings));
}
I've used this in past with success:
sed 's|360\.example\.com|360-dev\.my\.example\.dev|g' com.sql > local.sql
Edit: sorry not awk, but neither is wp-cli.

Resources