<html>
  <head>
    <meta content="text/html; charset=windows-1252"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    On 28-04-2015 6:08, Roy Golan wrote:<br>
    <blockquote cite="mid:553F4E22.2070403@redhat.com" type="cite">On
      04/28/2015 11:56 AM, Christopher Pereira wrote:
      <br>
      <blockquote type="cite">Hi, something broke Engine's Database in
        master:
        <br>
        <br>
        2015-04-28 05:53:15,959 ERROR
        [org.ovirt.engine.core.bll.InitBackendServicesOnStartupBean]
        (MSC service thread 1-4) [] Failed to initialize backend:
        org.jboss.weld.exceptions.WeldException: WELD-000049 Unable to
        invoke [method] @PostConstruct private
        org.ovirt.engine.core.vdsbroker.ResourceManager.init() on
        org.ovirt.engine.core.vdsbroker.ResourceManager@38e3648c
        <br>
                at
        org.jboss.weld.bean.AbstractClassBean.defaultPostConstruct(AbstractClassBean.java:518)
        [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]
        <br>
                at
        org.jboss.weld.bean.ManagedBean$ManagedBeanInjectionTarget.postConstruct(ManagedBean.java:174)
        [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]
        <br>
                at
        org.jboss.weld.bean.ManagedBean.create(ManagedBean.java:291)
        [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]
        <br>
                at
        org.jboss.weld.context.AbstractContext.get(AbstractContext.java:107)
        [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]
        <br>
                at
        org.jboss.weld.manager.BeanManagerImpl.getReference(BeanManagerImpl.java:616)
        [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]
        <br>
                at
        org.jboss.weld.manager.BeanManagerImpl.getReference(BeanManagerImpl.java:643)
        [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]
        <br>
                at
        org.ovirt.engine.core.di.Injector.instanceOf(Injector.java:73)
        [vdsbroker.jar:]
        <br>
        [...]<br>
        Caused by: org.postgresql.util.PSQLException: The column name
        gluster_tuned_profile was not found in this ResultSet.
        <br>
                at
org.postgresql.jdbc2.AbstractJdbc2ResultSet.findColumn(AbstractJdbc2ResultSet.java:2542)<br>
                at
org.postgresql.jdbc2.AbstractJdbc2ResultSet.getString(AbstractJdbc2ResultSet.java:2385)<br>
                at
org.jboss.jca.adapters.jdbc.WrappedResultSet.getString(WrappedResultSet.java:1381)<br>
                at
        org.ovirt.engine.core.dao.VdsGroupDAODbFacadeImpl$VdsGroupRowMapper.mapRow(VdsGroupDAODbFacadeImpl.java:306)
        [dal.jar:]
        <br>
                at
        org.ovirt.engine.core.dao.VdsGroupDAODbFacadeImpl$VdsGroupRowMapper.mapRow(VdsGroupDAODbFacadeImpl.java:256)
        [dal.jar:]
        <br>
                at
        org.springframework.jdbc.core.RowMapperResultSetExtractor.extractData(RowMapperResultSetExtractor.java:92)
        [spring-jdbc.jar:3.1.1.RELEASE]
        <br>
                at
        org.springframework.jdbc.core.RowMapperResultSetExtractor.extractData(RowMapperResultSetExtractor.java:1)
        [spring-jdbc.jar:3.1.1.RELEASE]
        <br>
                at
        org.springframework.jdbc.core.JdbcTemplate$1.doInPreparedStatement(JdbcTemplate.java:649)
        [spring-jdbc.jar:3.1.1.RELEASE]
        <br>
                at
        org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:587)
        [spring-jdbc.jar:3.1.1.RELEASE]
        <br>
                ... 68 more
        <br>
        <br>
      </blockquote>
    </blockquote>
    <blockquote cite="mid:553F4E22.2070403@redhat.com" type="cite">probably
      one of the packaging/dbscripts/upgrade script failed or didn't run
      <br>
      <br>
      try to run this
      <br>
      <br>
packaging/dbscripts/upgrade/03_06_1260_add_tuned_profile_column_to_vds_groups.sql
      <br>
      <br>
      and the vds_groups_sp.sql must be run again
      <br>
    </blockquote>
    <br>
    1) Adding the field 'gluster_tuned_profile' to 'vds_groups' didn't
    fix the problem.<br>
    <br>
    2) FYI: select * from schema_version order by id desc limit 1, was
    reporting:<br>
    version      | 03061240<br>
    script       |
    upgrade/03_06_1240_revert_03061210_add_vm_host_device_commands.sql<br>
    <br>
    3) I executed manually the remaining update scripts but it didn't
    fix the problem.<br>
    <br>
    4) Then I tried:<br>
    <blockquote>cd /usr/share/ovirt-engine/dbscripts<br>
      export PGPASSWORD=...<br>
      ./schema.sh -u engine -d engine -c refresh -v<br>
    </blockquote>
    but it failed with:<br>
    <blockquote>Creating views...<br>
      psql:./create_views.sql:445: ERROR: column
      vm_device.is_using_scsi_reservation does not exist<br>
      LINE 9: vm_device.is_using_scsi_reservation<br>
      FATAL: Cannot execute sql command: --file=./create_views.sql<br>
    </blockquote>
    5) This field is defined in
    '03_06_1270_add_uses_scsi_reservation.sql' which I supposedly
    executed before (but probably really did not).<br>
    I added manually "alter table vm_device add column
    is_using_scsi_reservation BOOLEAN NOT NULL DEFAULT FALSE;"
    ('fn_db_add_column' was not defined at this point).<br>
    <br>
    6) Then I executed again "./schema.sh -u engine -d engine -c refresh
    -v" and this time it run until the end and fixed the problem.<br>
  </body>
</html>