[rt-users] Can't call method "HasRight"

Jeff Blaine jblaine at kickflop.net
Tue Jul 12 20:43:17 EDT 2011


On 7/12/2011 7:30 PM, Thomas Sibley wrote:
> On 07/12/2011 06:09 PM, Jeff Blaine wrote:
>> I suspect that as well, but it took me ~3 hours to
>> get this far and I'm trying to get past it somehow
>> instead of trying to figure out a completely different
>> plan of attack and starting over :(

I appreciate the replies, everyone.  I'm far from a DB guy,
so there's zero guarantee I've done anything right, but I
did what seemed to make sense to me.  You can point and
laugh at me if you'd like :)  I realize this is pretty
out of scope for standard rt-users list fare.

> Did you drop the relevant fresh tables that you then loaded data into
> after make initdb?

No.  I deleted the data from them.

DELETE FROM tablename WHERE id > 0;

I was afraid to drop the tables for fear that there was
some black magic interconnectedness that I'd screw up
and never be able to reproduce.

Perhaps I did *just that* by *being fearful*

I dumped the databases as such, on the production server:

for i in `psql -U postgres rt3 -c "\dt" | grep table | awk '{print $3}' 
| sed -e '/transactions/D' -e '/tickets/D' -e '/sessions/D' -e 
'/attachments/D' -e '/links/D'`
do
     pg_dump --table $i -U postgres rt3 > DUMP.$i.sql
done

I copied these dump files over to the development server.

I edited each one and commented out the CREATE TABLE,
INDEX, and ALTER TABLE...ADD CONSTRAINT statements.

I loaded them on the development server with:

     psql -f filename rt3 postgres

Here is the non-verbose rt-validate summary.

The output is 23MB (!), 6MB if I strip out the stuff
about 'Tickets', which were not carried over from
the production server (on purpose).

Running rt-validate again with --check --resolve --force
cuts the output down to 15MB from 23MB.  Still light
years from reasonable to figure out.

[root at rtdev1 src]# grep 'in Groups references not existent record in 
Tickets' validation.log | wc -l
89660
[root at rtdev1 src]#

[root at rtdev1 src]# sed 's/\(Record\) #[0-9]* \(in .*\)/\1 \2/' 
validation.log | grep Record | sort | uniq
Record in Attributes references not existent record in Tickets
Record in CachedGroupMembers references not existent record in GroupMembers
Record in CachedGroupMembers references not existent record in Groups
Record in ObjectCustomFieldValues references not existent record in Tickets
Record in Groups references not existent record in Tickets
[root at rtdev1 src]#

Some example full lines are at the end of the message,
though I think they're mostly pointless to you.

> You don't say how you loaded up the data, but if you ended up generating
> new id sequences when you inserted rows into Principals and Users, you'd
> surely create an unworkable database.
>
> Try running rt-validator in check mode to see if it can make heads or
> tails of your database.
>
> These are all just guesses.  We don't have nearly enough information
> here to do anything than that.  Perhaps you want to start over by
> copying the entire database and then using Shredder to get rid of
> tickets, attachments, links, and transactions.

Unfortunately, bringing the "DATA data" over is not an
option due to a security policy.

Suggested paths forward?  Start over and drop the tables
before loading the data?

============================================================

Record #25 in Groups references not existent record in Tickets
         Instance => '1' => id

Record #26 in Groups references not existent record in Tickets
         Instance => '1' => id
...
Record #350522 in CachedGroupMembers references not existent record in 
GroupMembers
         GroupId => '188231' => GroupId
         MemberId => '136849' => MemberId

Record #350514 in CachedGroupMembers references not existent record in 
GroupMembers
         GroupId => '188234' => GroupId
         MemberId => '74' => MemberId
...
Record #350490 in CachedGroupMembers references not existent record in 
Groups
         GroupId => '188222' => id
         MemberId => '188222' => id

Record #350491 in CachedGroupMembers references not existent record in 
Groups
         GroupId => '188223' => id
         MemberId => '188223' => id
...
Record #59 in Attributes references not existent record in Tickets
         ObjectId => '3' => id

Record #143 in Attributes references not existent record in Tickets
         ObjectId => '5397' => id
...
Record #1 in ObjectCustomFieldValues references not existent record in 
Tickets
         ObjectId => '1' => id

Record #213126 in ObjectCustomFieldValues references not existent record 
in Tickets
         ObjectId => '1' => id



More information about the rt-users mailing list