SUSE Support

Here When You Need Us

SUMA 2.1 Migration to SCC Can Result in Duplicate Product_ids

This document (7016161) is provided subject to the disclaimer at the end of this document.

Environment

SUSE Manager 2.1

Situation

After migrating to SCC the command mgr-sync refresh fails with the following error.

mgr-sync refresh
Refreshing Channels [DONE]
Refreshing Channel families [DONE]
Refreshing SUSE products [DONE]
Refreshing SUSE Product channels [FAIL]
Error: <Fault -1: 'redstone.xmlrpc.XmlRpcFault: unhandled internal exception: query did not return a unique result: 2'>

We discovered there were double entries in suseProducts table.

Resolution

To investigate the product ids for duplicates run the following command:


echo "select * from suseProducts order by product_id;"| spacewalk-sql --select-mode -|less -S

example:

suma21:~ # grep 832 /tmp/bla.txt 
 2312 | suse-linux-enterprise-server-sp4                   | 10.4     | SUSE Linux Enterprise Server 10 SP4                                         |          119 |                                  |        832 | 2015-01-28 16:37:08.668005+01 | 2015-01-28 16:37:08.668005+01
  246 | suse-linux-enterprise-desktop-sp2                  | 10       | SUSE Linux Enterprise Desktop 10 SP2                                        |          102 | online                           |        832 | 2015-01-12 09:58:12.831784+01 | 2015-01-18 20:37:29.278229+01

If there are duplicate ids then run the command: echo "delete from suseProducts;" | spacewalk-sql --select-mode - ***NOTE Do Not Forget the Trailing - after mode*** Followed by:
mgr-sync refresh


Additional Information

Entries in catalina.out:

2015-02-05 14:55:43,470 [TP-Processor9] ERROR com.redhat.rhn.frontend.xmlrpc.BaseHandler - Error calling method: 
java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:95)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:56)
        at java.lang.reflect.Method.invoke(Method.java:620)
[...]
Caused by: org.hibernate.NonUniqueResultException: query did not return a unique result: 2
        at org.hibernate.impl.AbstractQueryImpl.uniqueElement(AbstractQueryImpl.java:820)
        at org.hibernate.impl.CriteriaImpl.uniqueResult(CriteriaImpl.java:305)
        at com.redhat.rhn.domain.product.SUSEProductFactory.lookupByProductId(SUSEProductFactory.java:201)


Disclaimer

This Support Knowledgebase provides a valuable tool for SUSE customers and parties interested in our products and solutions to acquire information, ideas and learn from one another. Materials are provided for informational, personal or non-commercial use within your organization and are presented "AS IS" WITHOUT WARRANTY OF ANY KIND.

  • Document ID:7016161
  • Creation Date: 06-Feb-2015
  • Modified Date:03-Mar-2020
    • SUSE Manager

< Back to Support Search

For questions or concerns with the SUSE Knowledgebase please contact: tidfeedback[at]suse.com

tick icon

SUSE Support Forums

Get your questions answered by experienced Sys Ops or interact with other SUSE community experts.

tick icon

Support Resources

Learn how to get the most from the technical support you receive with your SUSE Subscription, Premium Support, Academic Program, or Partner Program.

tick icon

Open an Incident

Open an incident with SUSE Technical Support, manage your subscriptions, download patches, or manage user access.