Bug 838190
| Summary: | Repodata is not being generated correctly. Error: WrappedSQLException: ERROR: column p.installed_size does not exist | ||
|---|---|---|---|
| Product: | [Community] Spacewalk | Reporter: | Marcelo Moreira de Mello <mmello> |
| Component: | Server | Assignee: | Marcelo Moreira de Mello <mmello> |
| Status: | CLOSED NOTABUG | QA Contact: | Red Hat Satellite QA List <satqe-list> |
| Severity: | medium | Docs Contact: | |
| Priority: | medium | ||
| Version: | 1.7 | CC: | mmello |
| Target Milestone: | --- | ||
| Target Release: | --- | ||
| Hardware: | All | ||
| OS: | All | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | Bug Fix | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2012-07-09 19:26:56 UTC | Type: | Bug |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
| Bug Depends On: | |||
| Bug Blocks: | 871344 | ||
|
Description
Marcelo Moreira de Mello
2012-07-07 02:02:33 UTC
** Looking the SQL
java/code/src/com/redhat/rhn/common/db/datasource/xml/Task_queries.xml
---------------------
573 <mode name="repomdgenerator_channel_packages"
574 class="com.redhat.rhn.frontend.dto.PackageDto">
575 <query params="channel_id">
576 SELECT /*+ ORDERED */ p.id, pn.name as name, pevr.epoch as epoch,
577 pevr.version as version, pevr.release as release,
578 p.summary, p.description, pa.label as arch_label,
579 p.build_time, p.path, p.package_size, p.payload_size, p.installed_size,
580 p.copyright, p.vendor, p.build_host, p.header_start, p.header_end,
581 srpm.name as source_rpm, pg.name as package_group_name,
582 cs.checksum, cs.checksum_type as checksum_type,
583 prd.primary_xml as primary_xml, prd.filelist as filelist_xml, prd.other as other_xml
584 FROM
585 rhnChannelPackage cp,
586 rhnPackage p
587 LEFT OUTER JOIN rhnPackageGroup pg ON p.package_group = pg.id
588 LEFT OUTER JOIN rhnSourceRpm srpm ON p.source_rpm_id = srpm.id
589 LEFT JOIN rhnPackageRepodata prd ON prd.package_id = p.id,
590 rhnPackageName pn,
591 rhnPackageEvr pevr,
592 rhnPackageArch pa,
593 rhnChecksumView cs
594 WHERE
595 cp.package_id = p.id
596 AND p.name_id = pn.id
597 AND p.evr_id = pevr.id
598 AND p.package_arch_id = pa.id
599 AND cp.channel_id = :channel_id
600 AND p.checksum_id = cs.id
601 ORDER by 1
602 </query>
603 </mode>
Checking the rhnpackage table:
spaceschema=# \d+ rhnpackage;
Table "public.rhnpackage"
Column | Type | Modifiers | Storage | Description
-----------------+-----------------------------+------------------------+----------+-------------
id | numeric | not null | main |
org_id | numeric | | main |
name_id | numeric | not null | main |
evr_id | numeric | not null | main |
package_arch_id | numeric | not null | main |
package_group | numeric | | main |
rpm_version | character varying(16) | | extended |
description | character varying(4000) | | extended |
summary | character varying(4000) | | extended |
package_size | numeric | not null | main |
payload_size | numeric | | main |
build_host | character varying(256) | | extended |
build_time | timestamp without time zone | | plain |
source_rpm_id | numeric | | main |
checksum_id | numeric | not null | main |
vendor | character varying(64) | not null | extended |
payload_format | character varying(32) | | extended |
compat | smallint | default 0 | plain |
path | character varying(1000) | | extended |
header_sig | character varying(64) | | extended |
copyright | character varying(128) | | extended |
cookie | character varying(128) | | extended |
last_modified | timestamp with time zone | not null default now() | plain |
created | timestamp with time zone | not null default now() | plain |
modified | timestamp with time zone | not null default now() | plain |
header_start | numeric | not null default (-1) | main |
header_end | numeric | not null default (-1) | main |
Reproducing the issue manually: spaceschema-# SELECT /*+ ORDERED */ p.id, pn.name as name, pevr.epoch as epoch, spaceschema-# pevr.version as version, pevr.release as release, spaceschema-# p.summary, p.description, pa.label as arch_label, spaceschema-# p.build_time, p.path, p.package_size, p.payload_size, p.installed_size, spaceschema-# p.copyright, p.vendor, p.build_host, p.header_start, p.header_end, spaceschema-# srpm.name as source_rpm, pg.name as package_group_name, spaceschema-# cs.checksum, cs.checksum_type as checksum_type, spaceschema-# prd.primary_xml as primary_xml, prd.filelist as filelist_xml, prd.other as other_xml spaceschema-# FROM spaceschema-# rhnChannelPackage cp, spaceschema-# rhnPackage p spaceschema-# LEFT OUTER JOIN rhnPackageGroup pg ON p.package_group = pg.id spaceschema-# LEFT OUTER JOIN rhnSourceRpm srpm ON p.source_rpm_id = srpm.id spaceschema-# LEFT JOIN rhnPackageRepodata prd ON prd.package_id = p.id, spaceschema-# rhnPackageName pn, spaceschema-# rhnPackageEvr pevr, spaceschema-# rhnPackageArch pa, spaceschema-# rhnChecksumView cs spaceschema-# WHERE spaceschema-# cp.package_id = p.id spaceschema-# AND p.name_id = pn.id spaceschema-# AND p.evr_id = pevr.id spaceschema-# AND p.package_arch_id = pa.id spaceschema-# AND cp.channel_id = 101 spaceschema-# AND p.checksum_id = cs.id spaceschema-# ORDER by 1; ERROR: column p.installed_size does not exist LINE 4: ...ild_time, p.path, p.package_size, p.payload_size, p.install
Investigating the schema changes, installed_size was introduced by commit fd1e71ef69b1c5a7d8b99a836e1b291ab5654f15
commit fd1e71ef69b1c5a7d8b99a836e1b291ab5654f15
Author: Joshua Roys <Joshua.Roys.edu>
Date: Tue May 15 15:01:29 2012 -0400
712313 - Add installed size to repodata
For some reason, the schema-upgrade does not updated my database. I'm investigating it.
After update the table manually, the repodata was generated as expected.
spaceschema=# alter table rhnPackage add column installed_size numeric;
ALTER TABLE
spaceschema=# select count(*) from rhnreporegenqueue;
count
-------
96
(1 row)
spaceschema=# delete from rhnreporegenqueue;
DELETE 96
==> /var/log/rhn/rhn_taskomatic_daemon.log <==
INFO | jvm 1 | 2012/07/06 23:26:00 | 2012-07-06 23:26:00,130 [DefaultQuartzScheduler_Worker-2] INFO com.redhat.rhn.taskomatic.task.ChannelRepodata - In the queue: 1
INFO | jvm 1 | 2012/07/06 23:26:14 | 2012-07-06 23:26:14,854 [Thread-470] INFO com.redhat.rhn.taskomatic.task.repomd.RepositoryWriter - Repository metadata generation for 'centos6_base-x86_64' finished in 74 seconds
INFO | jvm 1 | 2012/07/06 23:27:00 | 2012-07-06 23:27:00,111 [DefaultQuartzScheduler_Worker-7] INFO com.redhat.rhn.taskomatic.task.ChannelRepodata - In the queue: 1
INFO | jvm 1 | 2012/07/06 23:27:00 | 2012-07-06 23:27:00,166 [Thread-475] INFO com.redhat.rhn.taskomatic.task.repomd.RepositoryWriter - File Modified Date:2012-07-06 08:38:09 BRT
INFO | jvm 1 | 2012/07/06 23:27:00 | 2012-07-06 23:27:00,166 [Thread-475] INFO com.redhat.rhn.taskomatic.task.repomd.RepositoryWriter - Channel Modified Date:2012-07-06 08:38:09 BRT
INFO | jvm 1 | 2012/07/06 23:27:00 | 2012-07-06 23:27:00,261 [Thread-475] INFO com.redhat.rhn.taskomatic.task.repomd.RepositoryWriter - Generating new repository metadata for channel 'centos6_base-x86_64'(sha1) 7296 packages, 198 errata
INFO | jvm 1 | 2012/07/06 23:28:00 | 2012-07-06 23:28:00,587 [Thread-475] INFO com.redhat.rhn.taskomatic.task.repomd.RepositoryWriter - Repository metadata generation for 'centos6_base-x86_64' finished in 60 seconds
Investigating it further, it seems that running spacewalk-schema-upgrade does not really updated the information.
As we can see the script 104-suseCredentials_create.sql.postgresql should create a table called suseCredentials, but I don't have it on my database.
# rhn-schema-version
1.8.58-1.el6
# rpm -aq | grep schema
spacewalk-schema-1.8.58-1.el6.noarch
# rhn-schema-stats output-schema
label | created | modified | name | epoch | version | release
-----------------------------+------------+------------+------------------+-------+---------+---------
schema-from-20120406-235755 | 2012-04-06 | 2012-04-24 | spacewalk-schema | | 1.7.55 | 1.el6
schema-from-20120424-152418 | 2012-04-24 | 2012-04-27 | spacewalk-schema | | 1.8.19 | 1.el6
schema-from-20120427-204214 | 2012-04-27 | 2012-05-01 | spacewalk-schema | | 1.8.24 | 1.el6
schema-from-20120501-202601 | 2012-05-01 | 2012-05-04 | spacewalk-schema | | 1.8.28 | 1.el6
schema-from-20120504-204243 | 2012-05-04 | 2012-05-10 | spacewalk-schema | | 1.8.29 | 1.el6
schema-from-20120510-214516 | 2012-05-10 | 2012-05-14 | spacewalk-schema | | 1.8.31 | 1.el6
schema-from-20120514-224612 | 2012-05-14 | 2012-05-25 | spacewalk-schema | | 1.8.33 | 1.el6
schema-from-20120525-134737 | 2012-05-25 | 2012-06-05 | spacewalk-schema | | 1.8.40 | 1.el6
schema-from-20120605-002436 | 2012-06-05 | 2012-06-09 | spacewalk-schema | | 1.8.47 | 1.el6
schema-from-20120609-010210 | 2012-06-09 | 2012-07-03 | spacewalk-schema | | 1.8.50 | 1.el6
schema-from-20120703-193611 | 2012-07-03 | 2012-07-06 | spacewalk-schema | | 1.8.57 | 1.el6
schema | 2012-07-06 | 2012-07-06 | spacewalk-schema | | 1.8.58 | 1.el6
(12 rows)
Hello,
The issue reported was a locally issue due for downgrading the spacewalk-schema.
Closing this as NOTABUG.
|