[Dachs-support] [itteam] gavo import lock

carlosadean at linea.gov.br carlosadean at linea.gov.br
Fri Nov 4 16:11:03 CET 2016


Hi Markus,

I used the 'gavo purge' but a new error message was introduced.

[gavo at devel2 inputs [master]]$ gavo upgrade
>  Adding column_index column to TAP_SCHEMA.columns... *X*X* Uncaught exception at toplevel
*** Error: Oops.  Unhandled exception ProgrammingError.

Exception payload: column "column_index" of relation "columns" already
exists


I created a dump from those schemes and renamed the column_index to old_column_index (just to know if the upgrade would keep forward), but the result wasn't positive. I'll restore the dump in order to keep the state of the things.

[gavo at devel2 inputs [master]]$ gavo upgrade
>  Adding column_index column to TAP_SCHEMA.columns...  ok
> ingesting column_index for TAP-published tables....** WARNING: Column name 'size' conincides with a ADQL/SQL reserved name.  This may lead to serious trouble later.  Please consider changing the name, or prepend quoted/ to make it a delimited identifier.
** WARNING: Somwhere near /opt/dachs/inputs/cluster/mag_auto_10023232_i.rd, (16, 51):  Column pixel may be null but has no explicit null value.
** WARNING: RD cluster/mag_auto_10023232_i couldn't be loaded (Element with id u'tilename' could not be located in parse context).  Fix and run gavo imp -m on it to get column indices in TAP_SCHEMA
*X*X* Uncaught exception at toplevel
*** Error: Oops.  Unhandled exception UnboundLocalError.

Exception payload: local variable 'rd' referenced before assignment



Definitively I do not know how can I fix this, any suggestion?


thanks,

--
Carlos Adean
IT Team
linea.gov.br
skype: carlosadean

----- Mensagem original -----
De: "Markus Demleitner" <msdemlei at ari.uni-heidelberg.de>
Para: carlosadean at linea.gov.br
Enviadas: Sexta-feira, 4 de novembro de 2016 6:37:40
Assunto: Re: [itteam] gavo import lock

Hi Carlos,

On Thu, Nov 03, 2016 at 06:07:48PM -0200, carlosadean at linea.gov.br wrote:
> Hi Markus,
> 
> I tried to update the version of DaCHS (0.9 to 0.9.7) however after
> I ran the command 'gavo upgrade', and some successful steps, the
> upgrade stopped and I got the following error:
> 
> Thank you for the help.
[...]
> 
> Exception payload: duplicate key value violates unique constraint
> "columns_pkey" DETAIL:  Key (table_name,
> column_name)=(vac_cluster.footprint_map_10025007, pixel) already
> exists.

This was while upgrading the TAP_SCHEMA, I guess.  This kind of thing
typically happens when a table is/was defined in two RDs -- in this
case, vac_cluster.footprint_map_10025007.

Let me guess: There's probably something like

vac_cluster.rd
vac_cluster_version_2016-04-13.rd

somewhere, i.e., a backup copy of an RD or so.  DaCHS picks up that
RD on the upgrade but finds that the metadata already is in the
database -- boom.

Fix: Don't keep inactive/backup/"for documentation" RDs in your
inputs (it's a much better idea to keep that stuff in version control
anyway).

If that's not the reason, the most likely scenario leading to this is
when an RD is renamed.  Essentially, when renaming an RD, you should
gavo drop it first, rename it, then gavo imp it again.  Perhaps I
should write a  gavo renameRD  thingy that does this better, and
perhaps I should warn against renaming RDs in more dire words?

Anyway, the quickest way to fix this is to say

gavo purge vac_cluster.footprint_map_10025007

(which forcibly removes all traces of a given table; repeat for any
other table that gives this kind of problem).  You'll have to
re-import the tables again, though.

If re-importing is prohibitively expensive, an alternative is to find
the old RD id (the name *before* it was renamed) and then say gavo
drop -f <old rd id>.  That would save you the chore of re-importing.

Btw., I believe this kind of thing would be interesting to others,
too, so let me invite you again to use the dachs-support mailing list
for this kind of thing. Cf. http://docs.g-vo.org/DaCHS/#support

Cheers,

       Markus


More information about the Dachs-support mailing list