Odoo-sh Upgrade : How to disable a view / uninstall a module during upgrade process (v13 to v15)? - postgresql

During the upgrade process on odoo.sh on branch BrStaging, there are errors in the log panel. Some obsolete custom Modules or Views are the cause of these errors. To disable or uninstall them, we have to use SQL queries because we cannot enter odoo which cannot start:
My Try: using in Odoo-sh> SHELL-Tab, the shell command : psql:
To disable a view
UPDATE public.ir_ui_view SET active = false WHERE id = 10381;
To disable/uninstall a module
UPDATE ir_module_module set state='to remove'
WHERE name in ('my_custom_module') and state='installed';
...have tried that request too:
UPDATE ir_module_module set state='uninstallable'
WHERE name in ('my_custom_module') and state='installed';
...But it does t work: after a commit or restart (command: odoosh-restart) the related error still remains!
How to disable a view and uninstall a module during the upgrade process from v13 to v15 ??

The solution, I have found is using a pre-migrate.py file into one of my custom module : my_custom_module/migrations/15.0.0.0.0/pre-migrate.py
which contain the Sql query that i need to execute, to correct the upgrade-log-Error:
def migrate(cr, version):
# TO CORRECT UPGRADE ERROR 1 : Element '<xpath expr="//xxxx">' cannot be located in parent view
cr.execute("""
update ir_ui_view v
set inherit_id = NULL, mode='primary', active = false
where
v.id in (10563,10539)
""")

Related

Problem upon Installing PostgreSQL 12.1 Win8.1: “the database cluster initialisation failed”

I'm getting an error at the end of installing PostgreSQL 12.1 which is "the database cluster initialisation failed"
I have been searching all the day, so here what I tried:
1- Run the installation file as Administrator: didn't work.
2- Change the directory of "Data" to different place other than C:: didn't work.
3- Changed the whole installation directory to C:\Postgre or F:.... : didn't work
4- Turned off the KasperSky antivires: didn't work
5- Checked if there is an old Postgre user: not found
I checked the log file and I found the following :
Script output:
WScript.Shell Initialized...
Scripting.FileSystemObject initialized...
Called CreateDirectory(F:\PostgersSql\data)...
Called CreateDirectory(F:\PostgersSql)...
Called ClearAcl (F:\PostgersSql\data)...
Executing batch file 'rad712E9.bat'...
Called Die(Failed to reset the ACL (F:\PostgersSql\data))...
Failed to reset the ACL (F:\PostgersSql\data)
Any one can tell me what is causing this error?

CREATE EXTENSION pljava failed on PostgreSql 9.6

I try to install pljava for postgesql 9.6 in Ubuntu 16.04, but it fails with error.
A gradlew script makes an installation, but it fails with the following error"
Failed to execute: CREATE EXTENSION pljava; because: ERROR: could not access file "pljava-so-1.5.1-BETA1": No such file or directory
A gradlew source:
Sql sql = establishConnection()
try {
sql.execute("SET pljava.libjvm_location TO '${javaNative}';")
sql.execute("SET pljava.vmoptions TO '-Xshare:on -XX:+DisableAttachMechanism';")
sql.execute("ALTER DATABASE postgres SET pljava.libjvm_location FROM CURRENT;")
sql.execute("ALTER DATABASE postgres SET pljava.vmoptions FROM CURRENT;")
sql.execute("CREATE EXTENSION pljava;")
} finally {
sql.close()
}
As i understand, it fails during a creation of extension pljava, commands above was executed without any errors.
According to #ChapmanFlack advice:
I have no any mentions about pljava-so-1.5.1-BETA1 file at pg_config --libdir directory. Also i didn't find that file at pg_config --sharedir
grep LOAD pljava--1.5.1-BETA1.sql output following:
touched off by the LOAD command, making possible a decent installation
LOAD command, but finds the CREATE EXTENSION command instead). So,
temporarily LOAD 'pljava-so-1.5.1-BETA1'; Ok, the LOAD succeeded, so
everything happened ... unless ... the same PostgreSQL turns LOAD into
a (successful) no-op in that case, meaning To fail fast in that case,
expect that the LOAD actions should have
I think PL/Java builds from a prebuilt, because of that line at gradlew:
commandLine 'java', '-jar', '../installer/build/dependencies/pljava-pg9.6.jar'
I would be appreciate for any advice

Error while installing Moodle 29

I have place moodle files: C:\xampp\htdocs\moodle, E:\moodledata and in mysql created database "moodle".I m getting this error message on the webpage when opening moodle
"Config table does not contain version, can not continue, sorry.
More information about this error
It is usually not possible to recover from errors triggered during installation, you may need to create a new database or use a different database prefix if you want to retry the installation."
Setting in config.php
<?php // Moodle configuration file
unset($CFG);
global $CFG;
$CFG = new stdClass();
$CFG->dbtype = 'mysqli';
$CFG->dblibrary = 'native';
$CFG->dbhost = 'localhost';
$CFG->dbname = 'moodle';
$CFG->dbuser = 'root';
$CFG->dbpass = '';
$CFG->prefix = 'lms_';
$CFG->dboptions = array (
'dbpersist' => 0,
'dbport' => '',
'dbsocket' => '',
);
$CFG->wwwroot = 'http://'.$_SERVER['HTTP_HOST'].'/moodle';
$CFG->dataroot = 'E:\\moodledata';
$CFG->admin = 'admin';
$CFG->directorypermissions = 0777;
require_once(dirname(__FILE__) . '/lib/setup.php');
// There is no php closing tag in this file,
// it is intentional because it prevents trailing whitespace problems!
It looks like it got interrupted during install and now the database is incomplete. You can try two things: insert the missing version number into the config table, for example by using phpMyAdmin, or delete the database, create a new one and try to install again.
To insert the version number:
open the file version.php to find the version number.
in your database manager, go to the table mdl_config
insert a new record with the values: name='version' and value='the version number you looked up in the version.php file'
this can happen if the install process is not perfect.
You haven't told us the version or anything about the 'local server'
so we can not see the specifics of your problem.
check the release notes for the version you are using and make sure 100% that your server meets the requirements.

error in tables while ugprading database

Recently I tried to upgrade my tiki-wiki installation from 12.2 directly to 13.1 (that's a 3 step upgrade) and got errors in 5 tables. The way I did it was
export my working db;
import it in a new -empty- one;
connect with the 13.1 installation.
In the final stage of db connection I got 5 errors and when I started my 13.1 installation I was unable to edit any page (the edit window opens blank, buttons are invisible, cursor can't be placed anywhere). I really don't know if this problem has to do with these 5 errors (yes, I have asked tiki-wiki forum, still searching there).
Then, I went back, upgraded from 12.2 to 12.3 (one step upgrade) and everything was fine (no errors during db upgrade, editing pages possible).
Are these errors (see below) really important? Could they have anything to do with new installation not working properly? Any advise that could help me resolve the issue?
The errors:
20131218_stored_queries_tiki, create table 'tiki_search_queries etc.
20140109_query_unique_name_tiki (...) Duplicate column name 'description'
20140117_monitor_tiki, create table 'tiki_user_monitors' etc
20140206_add_parser_column_tiki (...) Table'tiki_output' already exists
20140214_goals_tiki, create table 'tiki_goals' etc.
The errors like duplicate column and table already exist are safe to be ignored while upgrading Tiki. You can mark them in the installer using the checkboxes. I don’t think they have anything to do with your blank page issue. Check your server log for fatal errors. Most common reason for blank page is low memory limit. But can be something else too.
Please make sure that the ownership and permissions of the upgraded files match what was there originally. Use:
chown -R name.name *
to change the file ownership where [name] matches what was there before and set file permissions with:
Directories:
find . -type d -exec chmod 755 {} \;
Files:
find . -type f -exec chmod 644 {} \;
some servers use 775 and 664.

Install4J Install into different directory selected but ignored on install

On windows using Install4j 5.1.12,
This is the scenario:
1). Successfully Install version 1 of app1 in directory v1
2). Try install of version 2 of app1 ( same APPid as above) but check 'No, install into a different directory'.
so that, version 1 remain where it is installed. But, version2 goes to a new directory 'v2'.
Expected : after step 2, I was expecting a new directory called 'v2' created and version2 of the app installed in the new dir 'v2'.
Actual: After step 2, version2 installed on top of version1 in dir 'v1' and no dir 'v2' created.
This used to work in old versions of our app installer. I compared it to the sample apps 'hello' of Install4j 5.1.12. Installer/update options has 'Regular Installer'/ Detect previous installation dir selected in the same way as the 'sample' apps.
Wondering what else to check .
Thanks , let me know if you need some more info.
Thanks Ingo, yes there was a condition the was using a wrong context setting ,
instead of :
context.getBooleanVariable("sys.confirmedUpdateInstallation") == true
it was :
context.isUpdateInstallation() == true
Thanks for the hint and further support.
-G