Custom module stuck while upgrading in odoo - postgresql

I am upgrading custom module in ODOO and on production server, I updated code and restarted odoo server. But when I try to upgrade custom module then its stucks on
creating or updating database tables
On local server it's work fine.
Here is log of server:
loading 1 modules...
1 modules loaded in 0.02s, 0 queries
loading 54 modules...
INFO openerp.models: Missing many2one field definition for _inherits reference "content_id" in "iris.series", using default one.
INFO openerp.models: Missing many2one field definition for _inherits reference "video_id" in "iris.ad_video", using default one.
INFO openerp.models: Missing many2one field definition for _inherits reference "content_id" in "iris.video", using default one.
WARNING openerp.models: Field definition for _inherits reference "user_id" in "iris.advertiser" must be marked as "required" with ondelete="cascade" or "restrict", forcing it to required + cascade.
INFO openerp.models: Missing many2one field definition for _inherits reference "stats_id" in "iris.store_playback_stats", using default one.
WARNING openerp.models: Field definition for _inherits reference "user_id" in "iris.store_owner" must be marked as "required" with ondelete="cascade" or "restrict", forcing it to required + cascade.
INFO openerp.models: Missing many2one field definition for _inherits reference "category_id" in "iris.business_category", using default one.
INFO openerp.models: Missing many2one field definition for _inherits reference "video_id" in "iris.partner_video", using default one.
INFO openerp.models: Missing many2one field definition for _inherits reference "category_id" in "iris.content_category", using default one.
WARNING openerp.models: Field definition for _inherits reference "user_id" in "iris.content_partner" must be marked as "required" with ondelete="cascade" or "restrict", forcing it to required + cascade.
WARNING openerp.models: Field definition for _inherits reference "user_id" in "iris.subtitler" must be marked as "required" with ondelete="cascade" or "restrict", forcing it to required + cascade.
INFO openerp.modules.module: module module_name: creating or updating database tables
I am getting these WARNING messages since beginning of module installation but module was upgraded. But now its stuck on creating or updating database tables on production server not on local server.
Database is postgresql on production and local servers.
What can be issue? I had research on it but did not got anything relevant.
Edit 1
user_id = fields.Many2one('res.users')
Edit 2
I have installed a custom module which also use base modules of odoo. I made XML and .py changes and upgraded custom module and some time server stuck at same point and then restart server then it does not stuck. Now I also added model in .py and updated XML and whenever I upgrade my custom module it stucks at same point. Even I can't install any new module.

As you said above, having issue while upgrading and installation of the module it takes time. You can debug the process by logging in to the database and fire this query so here you need to check the locks which are running on Postgres will tell you about how your module taking a lot of time to updating.
Query:
select psa.query from pg_locks as pg left join pg_stat_activity as psa on pg.pid=psa.pid where psa.datname='database_name';

Related

Liquibase Validation Failed Exception - change sets check sum

After launch the application, I get an error:
Caused by: liquibase.exception.ValidationFailedException: Validation Failed: 1 change sets checksum was: 8:2b2936713e8d9aea052c3122fd81faec but now it is:
8:ed8f7550fdd9809f4f6bf0f2d83dbbd8
The error points to such a table:
create table car (
id bigint not null auto_increment PRIMARY KEY,
name varchar(255) not null,
category varchar(255) not null
);
I read about this error and it was pointed out to use the mvn liquibase:clearCheckSums command but in the terminal I get the error: Error: -classpath requires class path specification (I run the command in the project folder)
The error indicates that a changelog that already run now is running with some changes. If you change something on an already run changelog then the checksum changes and this error is completely normal.
Check your databasechangelog table for the mentioned checksum to verify the changelog that crashes. The solutions are usually not to change the checksum of an already run changelog. If you can drop this changelog from the database and run it again will work fine. Sometimes the same changelog crashes without changing anything. This happening to me all the time because of the line seperator. For example, on IntleliJ you can change it from here:
Check what line separator do you need by testing :)

magento 1 to magento 2 issue migration

run command
bin/magento migrate:data -a app/code/Vendor/Migration/etc/opensource-to-opensource/1.9.4.0/config.xml
Error migration magento 1.9.4.0 to magento2 2.3.5
Base table or view not found: 1146 Table 'magento1.customer_entity_static' doesn't exist
Find a module that you are installing that is using customer_entity_static table, disable it and try again.
Please check if You have custom attribute with backend_type == static in your eav_attribute table. Problem is in vendor/magento/data-migration-tool/src/Migration/Step/Customer/Model/AttributesDataToCustomerEntityRecords.php file in fetchAttributesData method. It gets $attributeIdsByType and based on type magento refers to table (e.g. it refers to table customer_entity_ + backend_type (in my, and your case it is type static).

Database failure. Please refer to sugarcrm.log for details. sugarcrm

I am new sugarcrm developer i will configure sugarcrm in my localhost.
I have install successfully but some existing module builder
configuration not working
error "Database failure.Please refer to sugarcrm.log for details".
In sugarcrm.log there was this message:
Tue Aug 22 06:43:09 2017 [4546][1][FATAL] Query Failed: SELECT contacts_users_1contacts_ida id FROM contacts_users_1_c WHERE contacts_users_1_c.contacts_users_1users_idb = '1' AND contacts_users_1_c.deleted=0: MySQL error 1146: Table 'sugarcrm.contacts_users_1_c' doesn't exist
How to resolve that issue?
search your custom code where you wrote this query because this is not default table of SugarCRM. You have created it via customization therefore just comment out that query and then execute quick repair and rebuild. Execute any database mismatch query at the end of repair and rebuild page. Which might generate query for the creation of table with required schema.
Once table is created then uncomment your code and try again.

MongoDB 2.2.5 upgrade issue with special character in db name

I just upgraded to 2.2.5 version. My old data with 2.0.2 had database name with special character : in the name.
After upgrade, when I am fetching data from that db, I am getting following error
assertion 16256 Invalid ns [bcxb:queryTest.system.namespaces] ns:bcxb:queryTest.system.namespaces
This is happening for all m database name having special character :
Please help.

Bad value for type timestamp on production server

I'm working with: seam 2.2.2 + hibernate + richfaces + jboss 5.1 + postgreSQL
I have an module which needs to load some data from the database. Easy. The problem is, on development it works fine, 100%, but when I deploy on my production server and try to get the data, an error rise:
could not read column value from result set: fechahor9_504_; Bad value for type timestamp : [C#122e5cf
SQL Error: 0, SQLState: 22007
Bad value for type timestamp : [C#122e5cf
javax.persistence.PersistenceException: org.hibernate.exception.DataException: could not execute query
[more errors]
Caused by: org.postgresql.util.PSQLException: Bad value for type timestamp : [C#122e5cf
at org.postgresql.jdbc2.TimestampUtils.loadCalendar(TimestampUtils.java:232)
[more errors]
Caused by: java.lang.NumberFormatException: Trailing junk on timestamp: ''
at org.postgresql.jdbc2.TimestampUtils.loadCalendar(TimestampUtils.java:226)
I can't understand why it works on my machine (development) and why not on production. Any clues? Anyone gone through the same problem? Is exactly the same compilation
Stefano Travelli was right. I was checking the jBoss on production and there was an old jdbc driver on [jboss_dir]/common/lib from an old jwebstart application (not developed by me). Deleted that jdbc and it works fine. I should check if the old application is still needed and if so, check if it still works without the jdbc being there or with an upgraded version.
Not sure what the driver story is ..
but the problem for me show up when JDBC tries to parse bigint from the DB to
myOjbect.setDate(Date date){...}
the other "JDBC friendly" is ignorred for some reason .
myOjbect.setDate(long date){...}
So .. removing the Date setter and leaving a long one resolves the problem.
This is a Big workaround .. but may help someone out there :)