Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Bricolage: users

Too many Bric::Dist::Resource objects found.

 

 

Bricolage users RSS feed   Index | Next | Previous | View Threaded


mwlazlo at gmail

Apr 10, 2008, 9:11 PM

Post #1 of 5 (264 views)
Permalink
Too many Bric::Dist::Resource objects found.

Hi, I'm getting the above error while trying to publish or preview a certain
story.

Bric version is 1.10.3, backtrace follows.

Error: Too many Bric::Dist::Resource objects found.

Fault Class: Bric::Util::Fault::Exception::DP
Description: Data Processing Exception
Timestamp: 2008-04-11 14:05:01.000000
Package: Bric::Dist::Resource
Filename: /usr/lib/perl5/site_perl/5.8.8/Bric/Dist/Resource.pm
Line: 263
Payload:

STACK:

Trace begun at /usr/lib/perl5/site_perl/5.8.8/Bric/Dist/Resource.pm line 263
Bric::Dist::Resource::lookup('Bric::Dist::Resource',
'HASH(0xbcc0e10)') called at
/usr/lib/perl5/site_perl/5.8.8/Bric/Util/Burner.pm line 2022
Bric::Util::Burner::add_resource('Bric::Util::Burner::Mason=HASH(0xbcc1104)',
'/opt/bric/data/burn/stage/oc_1024/about/services/osrassist/mortgages_multistate/.menu/index.html',
'/about/services/osrassist/mortgages_multistate/.menu/index.html')
called at /usr/lib/perl5/site_perl/5.8.8/Bric/Util/Burner/Mason.pm
line 598
Bric::Util::Burner::Mason::end_page('Bric::Util::Burner::Mason=HASH(0xbcc1104)')
called at /usr/lib/perl5/site_perl/5.8.8/Bric/Util/Burner/Mason.pm
line 297
Bric::Util::Burner::Mason::burn_one('Bric::Util::Burner::Mason=HASH(0xbcc1104)',
'Bric::Biz::Asset::Business::Story=HASH(0xbce4644)',
'Bric::Biz::OutputChannel=HASH(0xbce01bc)',
'Bric::Biz::Category=HASH(0xbcfd7e0)') called at
/usr/lib/perl5/site_perl/5.8.8/Bric/Util/Burner.pm line 1498
Bric::Util::Burner::burn_one('Bric::Util::Burner=HASH(0xbce49d4)',
'Bric::Biz::Asset::Business::Story=HASH(0xbce4644)',
'Bric::Biz::OutputChannel=HASH(0xbce01bc)',
'Bric::Biz::Category=HASH(0xbcfd7e0)') called at
/usr/lib/perl5/site_perl/5.8.8/Bric/Util/Burner.pm line 1275
Bric::Util::Burner::publish('Bric::Util::Burner=HASH(0xbce49d4)',
'Bric::Biz::Asset::Business::Story=HASH(0xbce4644)', 'story', 0,
'2008-04-11 14:04:51.000000') called at
/usr/lib/perl5/site_perl/5.8.8/Bric/Util/Burner.pm line 1439
Bric::Util::Burner::publish_another('Bric::Util::Burner::Mason=HASH(0xbcc1104)',
'Bric::Biz::Asset::Business::Story=HASH(0xbce4644)') called at
/opt/bric/data/burn/comp/oc_1/generate_menu.mc line 195
Bric::Util::Burner::Commands::__ANON__('c',
'Bric::Biz::Category=HASH(0xbc8cc50)', 'is_root', 0) called at
/usr/lib/perl5/site_perl/5.8.8/HTML/Mason/Component.pm line 135
HTML::Mason::Component::run('HTML::Mason::Component::Subcomponent=HASH(0xbba067c)',
'c', 'Bric::Biz::Category=HASH(0xbc8cc50)', 'is_root', 0) called at
/usr/lib/perl5/site_perl/5.8.8/HTML/Mason/Request.pm line 1262
eval {...} at /usr/lib/perl5/site_perl/5.8.8/HTML/Mason/Request.pm line 1252
HTML::Mason::Request::comp(undef, undef, 'c',
'Bric::Biz::Category=HASH(0xbc8cc50)', 'is_root', 0) called at
/opt/bric/data/burn/comp/oc_1/generate_menu.mc line 21
Bric::Util::Burner::Commands::__ANON__ at
/usr/lib/perl5/site_perl/5.8.8/HTML/Mason/Component.pm line 135
HTML::Mason::Component::run('HTML::Mason::Component::FileBased=HASH(0xbba0730)')
called at /usr/lib/perl5/site_perl/5.8.8/HTML/Mason/Request.pm line
1262
eval {...} at /usr/lib/perl5/site_perl/5.8.8/HTML/Mason/Request.pm line 1252
HTML::Mason::Request::comp(undef, undef) called at
/opt/bric/data/burn/comp/oc_1/autohandler line 207
Bric::Util::Burner::Commands::__ANON__ at
/usr/lib/perl5/site_perl/5.8.8/HTML/Mason/Component.pm line 135
HTML::Mason::Component::run('HTML::Mason::Component::FileBased=HASH(0xbb0c37c)')
called at /usr/lib/perl5/site_perl/5.8.8/HTML/Mason/Request.pm line
1257
eval {...} at /usr/lib/perl5/site_perl/5.8.8/HTML/Mason/Request.pm line 1252
HTML::Mason::Request::comp(undef, undef, undef) called at
/usr/lib/perl5/site_perl/5.8.8/HTML/Mason/Request.pm line 466
eval {...} at /usr/lib/perl5/site_perl/5.8.8/HTML/Mason/Request.pm line 466
eval {...} at /usr/lib/perl5/site_perl/5.8.8/HTML/Mason/Request.pm line 418
HTML::Mason::Request::exec('HTML::Mason::Request=HASH(0xbb09e5c)')
called at /usr/lib/perl5/site_perl/5.8.8/HTML/Mason/Interp.pm line 342
HTML::Mason::Interp::exec(undef, undef) called at
/usr/lib/perl5/site_perl/5.8.8/Bric/Util/Burner/Mason.pm line 268
eval {...} at /usr/lib/perl5/site_perl/5.8.8/Bric/Util/Burner/Mason.pm line 268
Bric::Util::Burner::Mason::burn_one('Bric::Util::Burner::Mason=HASH(0xbaf71b8)',
'Bric::Biz::Asset::Business::Story=HASH(0xbae6e78)',
'Bric::Biz::OutputChannel=HASH(0xbaf2054)',
'Bric::Biz::Category=HASH(0xbaf2618)') called at
/usr/lib/perl5/site_perl/5.8.8/Bric/Util/Burner.pm line 1498
Bric::Util::Burner::burn_one('Bric::Util::Burner=HASH(0xbae719c)',
'Bric::Biz::Asset::Business::Story=HASH(0xbae6e78)',
'Bric::Biz::OutputChannel=HASH(0xbaf2054)',
'Bric::Biz::Category=HASH(0xbaf2618)') called at
/usr/lib/perl5/site_perl/5.8.8/Bric/Util/Burner.pm line 1275
Bric::Util::Burner::publish('Bric::Util::Burner=HASH(0xbae719c)',
'Bric::Biz::Asset::Business::Story=HASH(0xbae6e78)', 'story', 0,
'2008-04-11 14:04:51.000000', 1) called at
/usr/lib/perl5/site_perl/5.8.8/Bric/Util/Job/Pub.pm line 191
Bric::Util::Job::Pub::_do_it('Bric::Util::Job::Pub=HASH(0xbae6968)')
called at /usr/lib/perl5/site_perl/5.8.8/Bric/Util/Job.pm line 1889
eval {...} at /usr/lib/perl5/site_perl/5.8.8/Bric/Util/Job.pm line 1887
Bric::Util::Job::execute_me('Bric::Util::Job::Pub=HASH(0xbae6968)')
called at /usr/lib/perl5/site_perl/5.8.8/Bric/Util/Job.pm line 1808
Bric::Util::Job::save('Bric::Util::Job::Pub=HASH(0xbae6968)') called
at /usr/lib/perl5/site_perl/5.8.8/Bric/App/Callback/Publish.pm line
184
Bric::App::Callback::Publish::publish('Bric::App::Callback::Publish=HASH(0x9bebc3c)')
called at /usr/lib/perl5/site_perl/5.8.8/Bric/App/Callback/Desk.pm
line 346
Bric::App::Callback::Desk::publish('Bric::App::Callback::Desk=HASH(0xba8277c)')
called at /usr/lib/perl5/site_perl/5.8.8/Bric/App/Callback/Profile/Story.pm
line 208
Bric::App::Callback::Profile::Story::checkin('Bric::App::Callback::Profile::Story=HASH(0xbac71e4)')
called at /usr/lib/perl5/site_perl/5.8.8/Params/CallbackRequest.pm
line 294
eval {...} at /usr/lib/perl5/site_perl/5.8.8/Params/CallbackRequest.pm line 284
Params::CallbackRequest::request('Params::CallbackRequest=HASH(0x9e13dd8)',
'HASH(0xb01da38)', 'requester',
'MasonX::Interp::WithCallbacks=HASH(0xb70f52c)', 'apache_req',
'Apache::Request=SCALAR(0xb78a560)') called at
/usr/lib/perl5/site_perl/5.8.8/MasonX/Interp/WithCallbacks.pm line 119
MasonX::Interp::WithCallbacks::make_request('MasonX::Interp::WithCallbacks=HASH(0xb70f52c)',
'comp', '/workflow/profile/story/2126', 'args', 'ARRAY(0xb9ee418)',
'ah', 'HTML::Mason::ApacheHandler=HASH(0xb70f430)', 'apache_req',
'Apache::Request=SCALAR(0xb78a560)') called at
/usr/lib/perl5/site_perl/5.8.8/HTML/Mason/ApacheHandler.pm line 869
eval {...} at /usr/lib/perl5/site_perl/5.8.8/HTML/Mason/ApacheHandler.pm
line 868
HTML::Mason::ApacheHandler::prepare_request('HTML::Mason::ApacheHandler=HASH(0xb70f430)',
'Apache=SCALAR(0xb76d6cc)') called at
/usr/lib/perl5/site_perl/5.8.8/HTML/Mason/ApacheHandler.pm line 823
HTML::Mason::ApacheHandler::handle_request('HTML::Mason::ApacheHandler=HASH(0xb70f430)',
'Apache=SCALAR(0xb76d6cc)') called at
/usr/lib/perl5/site_perl/5.8.8/Bric/App/Handler.pm line 314
eval {...} at /usr/lib/perl5/site_perl/5.8.8/Bric/App/Handler.pm line 303
Bric::App::Handler::handler('Apache=SCALAR(0xb76d6cc)') called at
/dev/null line 0
eval {...} at /dev/null line 0





--
Reclaim your digital rights, eliminate DRM, learn more at
http://www.defectivebydesign.org/what_is_drm

-----BEGIN GEEK CODE BLOCK-----
Version: 3.12
GCS d--- s: a C++++ UL+++ P+++ L+++++ E--- W++ N o-- K- w--
O M+ V PS+++ PE Y PGP t+ 5 X++ R !tv b+++ DI+ D++
G-- e++ h+ r+ y+++++
------END GEEK CODE BLOCK------


Today's lucky number is: 09 F9 11 02 9D 74 E3 5B D8 41 56 C5 63 56 88 C0


david at kineticode

Apr 11, 2008, 9:33 AM

Post #2 of 5 (248 views)
Permalink
Re: Too many Bric::Dist::Resource objects found. [In reply to]

On Apr 10, 2008, at 21:11, Matt Wlazlo wrote:

> Hi, I'm getting the above error while trying to publish or preview a
> certain
> story.
>
> Bric version is 1.10.3, backtrace follows.
>
> Error: Too many Bric::Dist::Resource objects found.
>
> Fault Class: Bric::Util::Fault::Exception::DP
> Description: Data Processing Exception
> Timestamp: 2008-04-11 14:05:01.000000
> Package: Bric::Dist::Resource
> Filename: /usr/lib/perl5/site_perl/5.8.8/Bric/Dist/Resource.pm
> Line: 263
> Payload:
>
> STACK:
>
> Trace begun at /usr/lib/perl5/site_perl/5.8.8/Bric/Dist/Resource.pm
> line 263
> Bric::Dist::Resource::lookup('Bric::Dist::Resource',
> 'HASH(0xbcc0e10)') called at
> /usr/lib/perl5/site_perl/5.8.8/Bric/Util/Burner.pm line 2022

You have more than one row in the resource table with the same file
name. You'll need to fix that. The file name is something like
$BRICOLAGE_ROOT/data/burn/stage/oc_1/news/2004/05/04/slug/foo.gif. So
you would find the dupe with a query like this:

SELECT *
FROM resource
WHERE path LIKE '/usr/local/bricolage/data/burn/stage/oc_1/news/
2004/05/04/slug/%';

Just substitute the "1" in "oc_1" with the ID of the output channel
the media document is in, and "/news/2004/05/04/slug/" for the URI of
the medium being published. It's likely a related media document in
the story you're trying to publish, so look at the URIs of those media.

NB: We should have a UNIQUE index on that column, methinks.

HTH,

David


mwlazlo at gmail

Apr 14, 2008, 9:56 PM

Post #3 of 5 (244 views)
Permalink
Re: Too many Bric::Dist::Resource objects found. [In reply to]

On 12/04/2008, David E. Wheeler <david[at]kineticode.com> wrote:
> You have more than one row in the resource table with the same file name. You'll need to fix that.

Thanks David, I actually found about six duplicate path rows in the
resource table using the query:

select path from resource group by path having count(*) > 1;

Interestingly they are all media. I'm not sure how to fix. Can I
delete one of the offending rows (if so, how can I tell which one?) or
should I remove the media entirely and start again?

Any ideas how I can prevent this from happening again?

Cheers,
Matt.


--
Reclaim your digital rights, eliminate DRM, learn more at
http://www.defectivebydesign.org/what_is_drm

-----BEGIN GEEK CODE BLOCK-----
Version: 3.12
GCS d--- s: a C++++ UL+++ P+++ L+++++ E--- W++ N o-- K- w--
O M+ V PS+++ PE Y PGP t+ 5 X++ R !tv b+++ DI+ D++
G-- e++ h+ r+ y+++++
------END GEEK CODE BLOCK------


Today's lucky number is: 09 F9 11 02 9D 74 E3 5B D8 41 56 C5 63 56 88 C0


david at kineticode

Apr 15, 2008, 9:29 AM

Post #4 of 5 (246 views)
Permalink
Re: Too many Bric::Dist::Resource objects found. [In reply to]

On Apr 14, 2008, at 21:56, Matt Wlazlo wrote:

> On 12/04/2008, David E. Wheeler <david[at]kineticode.com> wrote:
>> You have more than one row in the resource table with the same file
>> name. You'll need to fix that.
>
> Thanks David, I actually found about six duplicate path rows in the
> resource table using the query:
>
> select path from resource group by path having count(*) > 1;
>
> Interestingly they are all media. I'm not sure how to fix. Can I
> delete one of the offending rows (if so, how can I tell which one?) or
> should I remove the media entirely and start again?

Actually, I was wrong before. There's a UNIQUE constraint on the
combination of path and URI. So that's good. Looking at the code
again, I think that Burner.pm is wrong at line 2022, because all the
other instantiations of resources look up by path and URI. Try this
patch:

--- lib/Bric/Util/Burner.pm (revision 8050)
+++ lib/Bric/Util/Burner.pm (working copy)
@@ -2019,9 +2019,13 @@
my ($story, $ext, $ress) = $self->_get(qw(story output_ext
resources));

# Create a resource for the distribution stuff.
- my $res = Bric::Dist::Resource->lookup({ path => $file }) ||
- Bric::Dist::Resource->new({ path => $file,
- uri => $uri });
+ my $res = Bric::Dist::Resource->lookup({
+ path => $path,
+ uri => $uri,
+ }) || Bric::Dist::Resource->new({
+ path => $path,
+ uri => $uri,
+ });

# Set the media type.
$res->set_media_type(Bric::Util::MediaType-
>get_name_by_ext($ext));

Best,

David


david at kineticode

Apr 15, 2008, 9:30 AM

Post #5 of 5 (240 views)
Permalink
Re: Too many Bric::Dist::Resource objects found. [In reply to]

On Apr 15, 2008, at 09:29, David E. Wheeler wrote:

> Actually, I was wrong before. There's a UNIQUE constraint on the
> combination of path and URI. So that's good. Looking at the code
> again, I think that Burner.pm is wrong at line 2022, because all the
> other instantiations of resources look up by path and URI. Try this
> patch:

Sorry, pasto in that patch. Try this one:

--- lib/Bric/Util/Burner.pm (revision 8050)
+++ lib/Bric/Util/Burner.pm (working copy)
@@ -2019,9 +2019,13 @@
my ($story, $ext, $ress) = $self->_get(qw(story output_ext
resources));

# Create a resource for the distribution stuff.
- my $res = Bric::Dist::Resource->lookup({ path => $file }) ||
- Bric::Dist::Resource->new({ path => $file,
- uri => $uri });
+ my $res = Bric::Dist::Resource->lookup({
+ path => $file,
+ uri => $uri,
+ }) || Bric::Dist::Resource->new({
+ path => $file,
+ uri => $uri,
+ });

# Set the media type.
$res->set_media_type(Bric::Util::MediaType-
>get_name_by_ext($ext));

Best,

David

Bricolage users RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact lists@gossamer-threads.com
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.