Login | Register
My pages Projects Community openCollabNet

Discussions > dev > confused

Project highlights: Stable Version: 1.6.1, Development Version: 1.7.6

Discussion topic

Back to topic list



Author jaredgreenwald
Full name Jared Greenwald
Date 2006-10-02 11:22:45 PDT
Hash: SHA1

I'm confused about where I'm getting an error and I figure maybe someone
else can point it out to me...

The code in question is the new system registration path through
setupBaseChannels (I've thrown in debug statements for my own benefit).
   Below the code is the output I'm getting in the current.log file. I
can't seem to figure out why I'm getting the error I'm getting. I've
been stuck on this for the better part of today and its really bothering
me (and new system reg is failing because of this)...

    def setupBaseChannels(self, pid):
        """Subscribe profile to all matching base channels."""

        # XXX: Schema here isn't consistant
        # Do this completely in SQL? What about duplicate subscriptions?
        q = """select CHANNEL.channel_id from CHANNEL, PROFILE where
               CHANNEL.base != 0 and
               PROFILE.profile_id = :profile_id and
               PROFILE.cannon_arch = CHANNEL.arch and
               PROFILE.os_release = CHANNEL.osrelease"""

        t = {'profile_id': pid}

        self.cursor.execute(q, t)
        result = resultSet(self.cursor)
        log("result: %s" % str(result), DEBUG2)
        for row in result:
            log("row: %s" % str(row), DEBUG2)
            self.subscribe(pid, row['CHANNEL_ID'])

        log("got here", DEBUG2)

    def subscribe(self, pid, channel):
        """Subscribe a profile to a channel."""

            # PM2006: type(channel) == type(1) does not work. With mysql
        # as DB backend, type(channel) becomes long, and type(1) is int.
        if type(channel) == type('a'):
            q = """insert into SUBSCRIPTIONS (profile_id, channel_id)
                   select :profile_id, channel_id from CHANNEL where
label = :ch
            q = """insert into SUBSCRIPTIONS (profile_id, channel_id) values
                   (:profile_id, :channel_id)"""

        t = {'profile_id': pid, 'channel_id': channel}

        self.cursor.execute(q, t)
        log("profile %s subscribed to %s" % (pid, channel), DEBUG2)

Now, the log output...

Oct 02 08:37:32 DEBUG2:
'44e84b0a-4f29-11db-​9c30-7bc4f5239858', 'user': 1, 'os_release': '4',
'release_name': 'oracle-release', 'arch': 'i686-redhat-linux', 'name':

Oct 02 08:37:32 DEBUG2:

Oct 02 08:37:32 DEBUG2: result: {'CHANNEL_ID': 1}
Oct 02 08:37:32 DEBUG2: row: {'CHANNEL_ID': 1}
Oct 02 08:37:32 DEBUG: Starting calculations for INSTALLED.info for
profile 40
Oct 02 08:37:32 DEBUG: Doing the actual update thing
Oct 02 08:37:32 DEBUG2: profile 40 subscribed to 1
Oct 02 08:37:32 CRITICAL: ERROR: Recognized function
registration.new_system blew up with undefined error
Oct 02 08:37:32 CRITICAL: EXCEPTION (File:
/usr/lib/python2.3/s​ite-packages/current​/current_apache.py, Method:
callAPIMethod(), Line: 321): [logException()]

Oct 02 08:37:32 CRITICAL: Traceback (most recent call last):
Oct 02 08:37:32 CRITICAL: File
"/usr/lib/python2.3/​site-packages/curren​t/current_apache.py"​, line 298,
in callAPIMethod
    result = apply(func, params)
Oct 02 08:37:32 CRITICAL: File
"/usr/lib/python2.3/​site-packages/curren​t/api/registration.p​y", line
125, in new_system
Oct 02 08:37:32 CRITICAL: File
"/usr/lib/python2.3/​site-packages/curren​t/profiles.py", line 78, in
Oct 02 08:37:32 CRITICAL: File
"/usr/lib/python2.3/​site-packages/curren​t/db/profile.py", line 118, in
    for row in result:
Oct 02 08:37:32 CRITICAL: File
"/usr/lib/python2.3/​site-packages/curren​t/db/resultSet.py", line 101, in
Oct 02 08:37:32 CRITICAL: File
"/usr/lib/python2.3/​site-packages/curren​t/db/resultSet.py", line 79, in
    self._row = self.cursor.fetchone()
Oct 02 08:37:32 CRITICAL: InterfaceError: not a query
Oct 02 08:37:32 DEBUG2: API Result = <Fault 1000: u'Function new_system
call blew up. Bad week.'>
Oct 02 08:37:32 WARNING: Fault: <Fault 1000: u'Function new_system call
blew up. Bad week.'>
Oct 02 08:37:32 TRACE: (File:
/usr/lib/python2.3/s​ite-packages/current​/current_apache.py, Method:
sendClientResult(), Line: 244) Data sent.
Oct 02 08:37:32 DEBUG: sendClientResult() finished


Please if anyone can point out to me what is going on, I'll be forever

Version: GnuPG v1.4.5 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org


« Previous message in topic | 1 of 1 | Next message in topic »


Show all messages in topic

confused jaredgreenwald Jared Greenwald 2006-10-02 11:22:45 PDT
Messages per page: