CMDBuild Forum

Error processing patch (openmaint-2.0-3.2.1)

Hello, I need help with this error that occurs after deploying openmaint in tomcat (I have been looking for a solution for more than 5 days)

84716786-bac9b780-af39-11ea-8653-94e677528151

org.cmdbuild.dao.DaoException: error processing patch = Patch{version=3.3.0-02_etl_gate_upgrade, category=core, applied=false}, caused by: org.cmdbuild.dao.DaoException: error processing patch = core-3.3.0-02_etl_gate_upgrade (etl gate tables upgrade), caused by: org.springframework.jdbc.BadSqlGrammarException: StatementCallback; bad SQL grammar [ SET SESSION cmdbuild.ignore_tenant_policies = ‘true’; SET SESSION cmdbuild.user_tenants = ‘{}’; DO $$ BEGIN RAISE NOTICE ‘apply cmdbuild patch %’, ‘core-3.3.0-02_etl_gate_upgrade’; END $$ LANGUAGE PLPGSQL; – etl gate tables upgrade SELECT _cm3_attribute_create(‘OWNER: _EtlGate|NAME: Handlers|TYPE: jsonb|DEFAULT: ‘’[]’’::jsonb’); DO $$ DECLARE _record record; _handlers jsonb; _templates varchar; BEGIN PERFORM _cm3_class_triggers_disable(’"_EtlGate"’); FOR _record IN SELECT * FROM “_EtlGate” LOOP _handlers = ‘[]’::jsonb; SELECT string_agg(_template, ‘,’) FROM unnest(_record.“Templates”) _template INTO _templates; IF _cm3_utils_is_not_blank(_record.“Script”) THEN _handlers = _handlers || jsonb_build_object(‘type’, ‘script’, ‘script’, _record.“Script”, ‘templates’, _templates); END IF; IF _record.“Handler” = ‘default’ THEN IF _cm3_utils_is_not_blank(_templates) THEN _handlers = _handlers || jsonb_build_object(‘type’, ‘template’, ‘templates’, _templates); END IF; ELSE _handlers = _handlers || jsonb_build_object(‘type’, _record.“Handler”, ‘templates’, _templates); END IF; UPDATE “_EtlGate” SET “Handlers” = _handlers WHERE “Id” = _record.“Id”; END LOOP; PERFORM _cm3_class_triggers_enable(’"_EtlGate"’); END $$ LANGUAGE PLPGSQL; ALTER TABLE “_EtlGate” DROP COLUMN “Script”; ALTER TABLE “_EtlGate” DROP COLUMN “Templates”; ALTER TABLE “_EtlGate” DROP COLUMN “Handler”; ALTER TABLE “_EtlGate” ADD CONSTRAINT “_cm3_Handlers_check” CHECK ( “Status” <> ‘A’ OR _cm3_etl_handlers_check(“Handlers”) ); DO $$ BEGIN RAISE NOTICE ‘applied cmdbuild patch %’, ‘core-3.3.0-02_etl_gate_upgrade’; END $$ LANGUAGE PLPGSQL; ]; nested exception is org.postgresql.util.PSQLException: ERROR: no existe la columna pg_attrdef.adsrc Where: función SQL «_cm3_attribute_default_get», durante expansión en línea sentencia SQL: «SELECT _cm3_attribute_default_get(_class, _attr)» función PL/pgSQL _cm3_attribute_default_set(regclass,character varying,character varying,boolean) en la línea 11 en asignación sentencia SQL: «SELECT _cm3_attribute_default_set(_class, _attr, _default, TRUE)» función PL/pgSQL _cm3_attribute_create(regclass,character varying,character varying,jsonb) en la línea 33 en PERFORM sentencia SQL: «SELECT _cm3_attribute_create(_class, _attr, _features->>‘TYPE’, _features - ‘TYPE’)» función PL/pgSQL _cm3_attribute_create(regclass,character varying,jsonb) en la línea 2 en PERFORM sentencia SQL: «SELECT _cm3_attribute_create(_cm3_utils_name_to_regclass(_features->>‘OWNER’), _features->>‘NAME’, _features - ‘OWNER’ - ‘NAME’)» función PL/pgSQL _cm3_attribute_create(jsonb) en la línea 2 en PERFORM sentencia SQL: «SELECT _cm3_attribute_create(_cm3_comment_to_jsonb(_features))» función PL/pgSQL _cm3_attribute_create(character varying) en la línea 2 en PERFORM, caused by: org.postgresql.util.PSQLException: ERROR: no existe la columna pg_attrdef.adsrc Where: función SQL «_cm3_attribute_default_get», durante expansión en línea sentencia SQL: «SELECT _cm3_attribute_default_get(_class, _attr)» función PL/pgSQL _cm3_attribute_default_set(regclass,character varying,character varying,boolean) en la línea 11 en asignación sentencia SQL: «SELECT _cm3_attribute_default_set(_class, _attr, _default, TRUE)» función PL/pgSQL _cm3_attribute_create(regclass,character varying,character varying,jsonb) en la línea 33 en PERFORM sentencia SQL: «SELECT _cm3_attribute_create(_class, _attr, _features->>‘TYPE’, _features - ‘TYPE’)» función PL/pgSQL _cm3_attribute_create(regclass,character varying,jsonb) en la línea 2 en PERFORM sentencia SQL: «SELECT _cm3_attribute_create(_cm3_utils_name_to_regclass(_features->>‘OWNER’), _features->>‘NAME’, _features - ‘OWNER’ - ‘NAME’)» función PL/pgSQL _cm3_attribute_create(jsonb) en la línea 2 en PERFORM sentencia SQL: «SELECT _cm3_attribute_create(_cm3_comment_to_jsonb(_features))» función PL/pgSQL _cm3_attribute_create(character varying) en la línea 2 en PERFORM

Whic version of postgresql are you using?

hola ya resolvi el problema

Hola, tengo el mismo problmo. Puedes explenar como has solvido?

Antreas, in my case, previously I had installed postgresql v12, I removed it and installed v10 but there were still requests from v12, I had to delete all the records from v12 and it worked; if you want assistance in the installation I can help you with a full installation of openmaint with all the complements my email is juanandresrs@ufps.edu.co

I attempted to install v10 or even v9.5 but ran into dependency issues that can’t seem to be resolved.

The following packages have unmet dependencies:
 postgresql-9.5 : Depends: libpq5 (>= 9.2~beta3) but it is not going to be installed
                  Depends: libssl1.0.0 (>= 1.0.0) but it is not installable
                  Depends: postgresql-client-9.5 but it is not going to be installed
                  Recommends: postgresql-contrib-9.5 but it is not going to be installed
                  Recommends: sysstat but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

So I tried to install libpq5
The following packages have unmet dependencies:
libpq5 : Depends: libssl1.0.0 (>= 1.0.2~beta3) but it is not installable
E: Unable to correct problems, you have held broken packages.

Then I installed libssl1.0.0
The following packages have unmet dependencies:
libpq5 : Depends: libssl1.0.0 (>= 1.0.2~beta3) but 1.0.1t-1+deb8u12 is to be installed
E: Unable to correct problems, you have held broken packages.

I even downloaded and installed libssl1.0.0_1.0.1t-1+deb8u12_amd64.deb but I keep getting the previous error.

Has anyone figured out how to resolve this using postgresql v12?