Closed Bug 357374 Opened 18 years ago Closed 18 years ago

Can't locate object method "use_for" via package "Bugzilla::Group"

Categories

(Bugzilla :: Administration, task)

2.22.1
task
Not set
major

Tracking

()

RESOLVED FIXED
Bugzilla 2.22

People

(Reporter: mkanat, Assigned: LpSolit)

References

Details

Attachments

(2 files)

Several users have reported that editgroups.cgi does not work for them in 2.22.1, and when they try to load it (just clicking on "Groups"), they get the following error:

undef error - Can't locate object method "use_for" via package
"Bugzilla::Group" at C:/Perl/site/lib/Template/Stash.pm line 870.

I can't reproduce this on landfill.
The template line is probably this one:

[% FOREACH group = groups %]
  [% group.use_for = (group.isactive != 0) && (group.isbuggroup) %]
[% END %]

I don't know why the Template-Toolkit is trying to call a subroutine instead of just setting the value, though.
This is not something I can reproduce and none of our Selenium scripts failed when calling editgroups.cgi. Neither on 2.22.1 nor on 2.23.3. WFM.
It's possible that it's Windows-specific.

I have multiple different users reporting it, so it sounds like something is wrong.

Here's the checksetup output of one of the users reporting it:

Checking perl modules ...
Checking for       AppConfig (v1.52)   ok: found v1.63
Checking for             CGI (v2.93)   ok: found v3.20
Checking for    Data::Dumper (any)     ok: found v2.121_08
Checking for    Date::Format (v2.21)   ok: found v2.22
Checking for             DBI (v1.38)   ok: found v1.52
Checking for      File::Spec (v0.84)   ok: found v3.12
Checking for      File::Temp (any)     ok: found v0.16
Checking for        Template (v2.10)   ok: found v2.15
Checking for      Text::Wrap (v2001.0131) ok: found v2005.082401
Checking for    Mail::Mailer (v1.67)   ok: found v1.74
Checking for    MIME::Base64 (v3.01)   ok: found v3.07
Checking for     MIME::Tools (v5.406)  ok: found v5.411
Checking for        Storable (any)     ok: found v2.15

The following Perl modules are optional:
Checking for              GD (v1.20)   ok: found v2.16
Checking for Template::Plugin::GD::Image (any)     ok: found v1.56
Checking for     Chart::Base (v1.0)    ok: found v2.3
Checking for       XML::Twig (any)     ok: found v3.26
Checking for       GD::Graph (any)     ok: found v1.43
Checking for GD::Text::Align (any)     ok: found v1.18
Checking for     PatchReader (v0.9.4)  ok: found v0.9.5
Checking for   Image::Magick (any)      not found
Checking for    HTML::Parser (v3.40)   ok: found v3.55
Checking for  HTML::Scrubber (any)     ok: found v0.08
works for me with Template v2.13 on Win32, clean install
(upgrades to 2.15)
still WFM.

Checking for       AppConfig (v1.52)   ok: found v1.55
Checking for             CGI (v2.93)   ok: found v3.17
Checking for    Data::Dumper (any)     ok: found v2.121_04
Checking for    Date::Format (v2.21)   ok: found v2.22
Checking for             DBI (v1.38)   ok: found v1.48
Checking for      File::Spec (v0.84)   ok: found v3.05
Checking for      File::Temp (any)     ok: found v0.16
Checking for        Template (v2.10)   ok: found v2.15
Checking for      Text::Wrap (v2001.0131) ok: found v2001.09293
Checking for    Mail::Mailer (v1.67)   ok: found v1.67
Checking for    MIME::Base64 (v3.01)   ok: found v3.05
Checking for     MIME::Tools (v5.406)  ok: found v5.411
Checking for        Storable (any)     ok: found v2.13

The following Perl modules are optional:
Checking for              GD (v1.20)   ok: found v2.16
Checking for Template::Plugin::GD::Image (any)     ok: found v1.55
Checking for     Chart::Base (v1.0)    ok: found v2.3
Checking for       XML::Twig (any)     ok: found v3.22
Checking for       GD::Graph (any)     ok: found v1.43
Checking for GD::Text::Align (any)     ok: found v1.18
Checking for     PatchReader (v0.9.4)  ok: found v0.9.5
Checking for   Image::Magick (any)      not found
Checking for    HTML::Parser (v3.40)   ok: found v3.45
Checking for  HTML::Scrubber (any)      not found

I am running into this problem on Windows XP SP2. This is the output of my checksetup.pl:

Checking perl modules ...
Checking for       AppConfig (v1.52)   ok: found v1.63
Checking for             CGI (v2.93)   ok: found v3.20
Checking for    Data::Dumper (any)     ok: found v2.121_08
Checking for    Date::Format (v2.21)   ok: found v2.22
Checking for             DBI (v1.38)   ok: found v1.52
Checking for      File::Spec (v0.84)   ok: found v3.12
Checking for      File::Temp (any)     ok: found v0.16
Checking for        Template (v2.10)   ok: found v2.15
Checking for      Text::Wrap (v2001.0131) ok: found v2005.082401
Checking for    Mail::Mailer (v1.67)   ok: found v1.74
Checking for    MIME::Base64 (v3.01)   ok: found v3.07
Checking for     MIME::Tools (v5.406)  ok: found v6.106
Checking for        Storable (any)     ok: found v2.15

The following Perl modules are optional:
Checking for              GD (v1.20)   ok: found v2.16
Checking for Template::Plugin::GD::Image (any)     ok: found v1.56
Checking for     Chart::Base (v1.0)    ok: found v2.3
Checking for       XML::Twig (any)     ok: found v3.26
Checking for       GD::Graph (any)     ok: found v1.43
Checking for GD::Text::Align (any)     ok: found v1.18
Checking for     PatchReader (v0.9.4)  ok: found v0.9.5
Checking for   Image::Magick (any)      not found
Checking for    HTML::Parser (v3.40)   ok: found v3.55
Checking for  HTML::Scrubber (any)     ok: found v0.08

All the required modules are available at:
    http://landfill.bugzilla.org/ppm/
You can add the repository with the following command:
    ppm rep add bugzilla http://landfill.bugzilla.org/ppm/

If you want to convert BMP image attachments to PNG to conserve
disk space, you will need to install the ImageMagick application
Available from http://www.imagemagick.org, and the Image::Magick
Perl module by running (as Administrator):

   ppm install Image::Magick

Checking user setup ...
Removing existing compiled templates ...
Precompiling templates ...
Checking for      DBD::mysql (v2.9003) ok: found v3.0002
Checking for           MySQL (v4.0.14) ok: found v5.0.26-community-nt
Checking for        GraphViz (any)     ok: found
(In reply to comment #1)
> [% FOREACH group = groups %]
>   [% group.use_for = (group.isactive != 0) && (group.isbuggroup) %]
> [% END %]

wwang:

if you write

[% SET group.use_for = (group.isactive != 0) && (group.isbuggroup) %]

in template/en/default/admin/groups/list.html.tmpl, does this fix your problem? (i.e. adding "SET" before group.use_for)
I made the change as you suggested at line 128 of list.html.tmpl and it still gives me the same error.
I tried with a 2.23.3 installation on Windows 2000 SP4, Perl 5.8.8 Build 819, MySQL 5.0.26, Apache 2.2.3 and I still cannot reproduce the bug. I know this bug is about 2.22.1, but the code in admin/groups/list.html.tmpl is the same.
I've the same bug on w2k with activestate perl 819

Microsoft Windows 2000 [Version 5.00.2195]
(C) Copyright 1985-2000 Microsoft Corp.

C:\>cd \XAMPP\xampp\htdocs\bugzilla

C:\XAMPP\xampp\htdocs\bugzilla>perl checksetup.pl

Checking perl modules ...
Checking for       AppConfig (v1.52)   ok: found v1.63
Checking for             CGI (v2.93)   ok: found v3.20
Checking for    Data::Dumper (any)     ok: found v2.121_08
Checking for    Date::Format (v2.21)   ok: found v2.22
Checking for             DBI (v1.38)   ok: found v1.52
Checking for      File::Spec (v0.84)   ok: found v3.12
Checking for      File::Temp (any)     ok: found v0.16
Checking for        Template (v2.10)   ok: found v2.15
Checking for      Text::Wrap (v2001.0131) ok: found v2005.082401
Checking for    Mail::Mailer (v1.67)   ok: found v1.74
Checking for    MIME::Base64 (v3.01)   ok: found v3.07
Checking for     MIME::Tools (v5.406)  ok: found v5.411
Checking for        Storable (any)     ok: found v2.15

The following Perl modules are optional:
Checking for              GD (v1.20)   ok: found v2.35
Checking for Template::Plugin::GD::Image (any)     ok: found v1.56
Checking for     Chart::Base (v1.0)    ok: found v2.3
Checking for       XML::Twig (any)     ok: found v3.26
Checking for       GD::Graph (any)     ok: found v1.4308
Checking for GD::Text::Align (any)     ok: found v1.18
Checking for     PatchReader (v0.9.4)  ok: found v0.9.5
Checking for   Image::Magick (any)     ok: found v6.3.0
Checking for    HTML::Parser (v3.40)   ok: found v3.55
Checking for  HTML::Scrubber (any)     ok: found v0.08

All the required modules are available at:
    http://landfill.bugzilla.org/ppm/
You can add the repository with the following command:
    ppm rep add bugzilla http://landfill.bugzilla.org/ppm/

Checking user setup ...
Removing existing compiled templates ...
Precompiling templates ...
Checking for      DBD::mysql (v2.9003) ok: found v3.0007
Checking for           MySQL (v4.0.14) ok: found v5.0.24a-community-nt

Populating duplicates table...
> C:\>cd \XAMPP\xampp\htdocs\bugzilla

anyone else with this problem also using xampp?
> if you write
> 
> [% SET group.use_for = (group.isactive != 0) && (group.isbuggroup) %]
> 
> in template/en/default/admin/groups/list.html.tmpl, does this fix your problem?

I have this problem on OpenSuSE 10.1 with bugzilla 2.22.1, and this fix did not help.  Here is my output from checksetup:

Checking perl modules ...
Checking for       AppConfig (v1.52)   ok: found v1.56
Checking for             CGI (v2.93)   ok: found v3.15
Checking for    Data::Dumper (any)     ok: found v2.121_08
Checking for    Date::Format (v2.21)   ok: found v2.22
Checking for             DBI (v1.38)   ok: found v1.50
Checking for      File::Spec (v0.84)   ok: found v3.23
Checking for      File::Temp (any)     ok: found v0.17
Checking for        Template (v2.10)   ok: found v2.15
Checking for      Text::Wrap (v2001.0131) ok: found v2005.082401
Checking for    Mail::Mailer (v1.67)   ok: found v1.74
Checking for    MIME::Base64 (v3.01)   ok: found v3.07
Checking for    MIME::Parser (v5.406)  ok: found v5.420
Checking for        Storable (any)     ok: found v2.15

The following Perl modules are optional:
Checking for              GD (v1.20)    not found
Checking for Template::Plugin::GD::Image (any)      not found
Checking for     Chart::Base (v1.0)     not found
Checking for       XML::Twig (any)      not found
Checking for       GD::Graph (any)      not found
Checking for GD::Text::Align (any)      not found
Checking for     PatchReader (v0.9.4)   not found
Checking for   Image::Magick (any)      not found
Checking for    HTML::Parser (v3.40)   ok: found v3.48
Checking for  HTML::Scrubber (any)      not found
Per comment 11, this bug doesn't seem specific to Windows. Comparing comment 8 and comment 9, the bug doesn't seem related to ActiveState Perl 5.8.8 Build 819 nor Windows 2000. Byron says he cannot reproduce the bug using TT 2.15 despite some others can using this version of TT. So my question is: what's the common config of all these broken systems??? This cannot be a problem related to the web server (either Apache or IIS) nor to the DB (MySQL or PostgreSQL).

Note that comments 3, 5, 9 and 11 all report the problem against TT 2.15. Maybe you need this specific version of TT + some other specific (broken?) module? It would help a lot if one of the users having this problem could downgrade their TT module to 2.14 or lower and tell us if the problem still occurs.
Keywords: helpwanted, qawanted
Bingo! I just upgraded TT on my W2k installation from 2.13 to 2.15 and I can now reproduce the bug with exactly the same error message as in comment 0.
I can now reproduce the bug on Linux too if I comment the eval() in the BEGIN block of Template::Stash::XS:

BEGIN {
  require DynaLoader;
  @Template::Stash::XS::ISA = qw( DynaLoader Template::Stash );

  eval {
  #  bootstrap Template::Stash::XS $Template::VERSION; # I commented this line!
  };

Else bootstrap() loads /usr/lib/perl5/vendor_perl/5.8.8/i386-linux/auto/Template/Stash/XS/XS.so instead of /usr/lib/perl5/vendor_perl/5.8.8/i386-linux/Template/Stash.pm.

So my feeling is that there is really something wrong in Stash.pm, but that loading XS.so hides this problem for some unknown reason (maybe because it preloaded its own version of Template::Stash::set()).

Maybe related to http://tt2.org/pipermail/templates/2006-February/008367.html?

See also http://www.template-toolkit.org/download/stable/Changes

I'm not sure I understand correctly, but it seems that missing methods are no longer ignored and falling back to a hash is no longer performed.
If I'm right in my previous comment, we have no other choice than defining methods out of templates and move these definitions in Perl modules themselves.

I will keep bootstrap() commented for a few days on my local installations to see if there are some other places to fix. This means we should now release 2.22.2 asap.
Depends on: 323525
Flags: blocking3.0?
Flags: blocking2.22.2?
Assignee: administration → LpSolit
Status: NEW → ASSIGNED
Attachment #244133 - Flags: review?(kiko)
Comment on attachment 244133 [details] [diff] [review]
patch for tip, v1

I was going to request a comment, but that's not really important. If there's no POD to be updated, r=kiko, otherwise update while you land.
Attachment #244133 - Flags: review?(kiko) → review+
Attachment #244135 - Flags: review?(kiko)
Attachment #244135 - Flags: review?(kiko) → review+
Flags: approval?
Flags: approval2.22?
Flags: approval?
Flags: approval2.22?
Flags: approval2.22+
Flags: approval+
tip:

Checking in Bugzilla/Group.pm;
/cvsroot/mozilla/webtools/bugzilla/Bugzilla/Group.pm,v  <--  Group.pm
new revision: 1.18; previous revision: 1.17
done
Checking in template/en/default/admin/groups/list.html.tmpl;
/cvsroot/mozilla/webtools/bugzilla/template/en/default/admin/groups/list.html.tmpl,v  <--  list.html.tmpl
new revision: 1.11; previous revision: 1.10
done


2.22.1:

Checking in Bugzilla/Group.pm;
/cvsroot/mozilla/webtools/bugzilla/Bugzilla/Group.pm,v  <--  Group.pm
new revision: 1.10.2.1; previous revision: 1.10
done
Checking in template/en/default/admin/groups/list.html.tmpl;
/cvsroot/mozilla/webtools/bugzilla/template/en/default/admin/groups/list.html.tmpl,v  <--  list.html.tmpl
new revision: 1.4.2.4; previous revision: 1.4.2.3
done
Status: ASSIGNED → RESOLVED
Closed: 18 years ago
Flags: blocking3.0?
Flags: blocking2.22.2?
Keywords: helpwanted, qawanted
Resolution: --- → FIXED
*** Bug 361743 has been marked as a duplicate of this bug. ***
Having this issue in the 2.22.2 version also... Patches seem to apply to 2.22.1, so I don't want to do those updates.

Error:
URL: http://theq/editgroups.cgi

undef error - Can't locate object method "use_for" via package "Bugzilla::Group" at C:/Perl/lib/Template/Stash.pm line 760 



Environment:
Windows Server 2003, SE, SP1



E:\Bugzilla>checksetup.pl

Checking perl modules ...
Checking for       AppConfig (v1.52)   ok: found v1.63
Checking for             CGI (v2.93)   ok: found v3.10
Checking for    Data::Dumper (any)     ok: found v2.121_04
Checking for    Date::Format (v2.21)   ok: found v2.22
Checking for             DBI (v1.38)   ok: found v1.53
Checking for      File::Spec (v0.84)   ok: found v3.05
Checking for      File::Temp (any)     ok: found v0.16
Checking for        Template (v2.10)   ok: found v2.10
Checking for      Text::Wrap (v2001.0131) ok: found v2001.09293
Checking for    Mail::Mailer (v1.67)   ok: found v1.74
Checking for    MIME::Base64 (v3.01)   ok: found v3.05
Checking for     MIME::Tools (v5.406)  ok: found v5.411
Checking for        Storable (any)     ok: found v2.13

The following Perl modules are optional:
Checking for              GD (v1.20)   ok: found v2.16
Checking for Template::Plugin::GD::Image (any)     ok: found v1.50
Checking for     Chart::Base (v1.0)    ok: found v2.3
Checking for       XML::Twig (any)      not found
Checking for       GD::Graph (any)     ok: found v1.43
Checking for GD::Text::Align (any)     ok: found v1.18
Checking for     PatchReader (v0.9.4)  ok: found v0.9.5
Checking for   Image::Magick (any)      not found
Checking for    HTML::Parser (v3.40)   ok: found v3.45
Checking for  HTML::Scrubber (any)     ok: found v0.08

All the required modules are available at:
    http://landfill.bugzilla.org/ppm/
You can add the repository with the following command:
    ppm rep add bugzilla http://landfill.bugzilla.org/ppm/

If you want to use the bug import/export feature to move bugs to
or from other bugzilla installations, you will need to install
 the XML::Twig module by running (as Administrator):

   ppm install XML::Twig

If you want to convert BMP image attachments to PNG to conserve
disk space, you will need to install the ImageMagick application
Available from http://www.imagemagick.org, and the Image::Magick
Perl module by running (as Administrator):

   ppm install Image::Magick

Checking user setup ...
Removing existing compiled templates ...
Precompiling templates ...
Checking for      DBD::mysql (v2.9003) ok: found v3.0002
Checking for           MySQL (v4.0.14) ok: found v4.1.22-community-nt

Populating duplicates table...

E:\Bugzilla>
updating bugzilla\template\en\defualt\admin\groups\list.html.tmpl
and bugzilla\Group.pm
no impact.
Perl version 5.8.7 build 813 
My actual error is:
undef error - Can't locate object method "use_for" via package "Bugzilla::Group" at C:/Perl/lib/Template/Stash.pm line 760. 
The age of this file is 7/24/2003


Seem to be looking for a different path than the original error:
undef error - Can't locate object method "use_for" via package
"Bugzilla::Group" at C:/Perl/site/lib/Template/Stash.pm line 870
age of this file is 5/26/2006.

For some reason I seem to be referencing the wrong file..hmmmm


Modifing the perl module resolved it, but I don't like the fix.
Can anyone point me to why I was referencing that particular path... My env (windows) doesn't set that path.
This is not the right place to get support. It looks like you are having some conflict with your Perl packages.
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: