For a quick test - you can try running some of the following Bugzilla scripts to check if they work fine: ./collectstats.pl ./whineatnews.pl
(They're command-line scripts using Bugzilla so I suppose they should go through the same initialization path). Regards, Yavor On Wed, Mar 2, 2011 at 17:43, Yavor Nikolov <[email protected]> wrote: > Hi Adam, > > I think USAGE_MODE_CMDLINE is the right mode to be used with Scmbug. > > Yes, the problem seems to be that Bugzilla cannot initialize. The > initialization code is in <bugzilla root>/Bugzilla/Install/Util.pm -> > init_console. > > That init_console does call binmode but does also make some other > initializations: > sub init_console { > eval { ON_WINDOWS && require Win32::Console::ANSI; }; > $ENV{'ANSI_COLORS_DISABLED'} = 1 if ($@ || !-t *STDOUT); > $SIG{__DIE__} = \&_console_die; > prevent_windows_dialog_boxes(); > set_output_encoding(); > } > > Some additional modules are loaded (you may be missing some of them); some > encoding tweaking takes place - I suspect root cause of the problem could be > some of these. > > (What you're doing with your "hack" is that you're skipping some of these > initialization steps; and some of those could be important). > > > You can try to catch the Bugzilla initialization error stack: > eval { > # initialization attempt here > }; # eval > if ( $@ ) { > my $err = $@; > log_daemon_warn( undef, $err ); > return 1, "Error while adding bug comment: $err"; > } > else { > # success > } > > (This is what I usually do. Maybe there is more elegant approach to debug - > I'm not a Perl guru :-)). > > Regards, > Yavor > > On Wed, Mar 2, 2011 at 16:42, Adam Noon <[email protected]> wrote: > >> Yavor Nikolov <nikolov.javor@...> writes: >> >> > >> > >> > Hi Adam, >> > >> > Which version of scmbug is that? This could be somehow related >> > to http://bugzilla.mkgnu.net/show_bug.cgi?id=1496 >> > >> > >> > >> > >> > >> > Can you trace down where exactly does Bugzilla initialization fail? >> There >> > some windows-specific things in Bugzilla which could cause the problem. >> (you >> > may check Bugzilla/Install/Util.pm). >> > >> > >> > Are you using Bugzilla in utf8 mode? >> > >> > >> > Regards, >> > Yavor2011/3/2 Thorsten Schöning <tschoening <at> am-soft.de>Guten Tag >> Adam >> > Noon, am Dienstag, 1. März 2011 um 20:51 schrieben Sie: >> > >> > > 87 7257 >> > > if (Bugzilla->usage_mode == USAGE_MODE_CMDLINE) { >> > > 88 >> > > init_console(); >> > > 89 >> > > } >> > This seems like the problem, demaonize and using a console don't seem >> > to fit. Are you sure that your usage_mode, whatever it is, I don't use >> > Bugzilla 4, is properly configured? Myybe it just works in the apache >> > context but the configuration is wrong? >> > Mit freundlichen Grüßen, >> > Thorsten Schöning >> > -- >> > Thorsten Schöning >> > AM-SoFT IT-Systeme - Hameln | Potsdam | Leipzig >> > Telefon: Potsdam: 0331-743881-0 >> > E-Mail: tschoening <at> am-soft.de >> > Web: http://www.am-soft.de >> > AM-SoFT GmbH IT-Systeme, Konsumhof 1-5, 14482 Potsdam >> > Amtsgericht Potsdam HRB 21278 P, Geschäftsführer: Andreas Muchow >> >> >> Hi Yavor, >> >> I'm using the latest Scmbug version (0.26.22) which includes the code >> change in >> bug 1496. >> >> I've put some more debug statements in various places... >> >> When I run Bugzilla in the web browser "Bugzilla->usage_mode" is set to 0. >> When I run scmbug-server.bat "Bugzilla->usage_mode" is set to 1 (which is >> the >> value of USAGE_MODE_CMDLINE). >> >> The actual line of code which doesn't seem to execute is line 532 in the >> daemonize sub in Daemon.pm... >> >> 532 defined (my $pid = fork) or log_fatal_error ( >> $DAEMON_ERROR_FORK_ERROR, >> "Can't fork: $!\n" ); >> >> Thorsten definitely seems to be on the right track in that Scmbug doesn't >> like >> the way Bugzilla is initializing itself with the "init_console()" command. >> >> I've debugged all the way through the Bugzilla.pm file in the Bugzilla >> source >> and everything executes; it just seems like Scmbug simply can't fork if we >> don't call the binmode command in Bugzilla.pm! >> >> I can't seem to be able to change the usage mode value from the Scmbug >> code so >> at the moment my only option is to force binmode! >> >> Thank you, >> Adam >> >> _______________________________________________ >> scmbug-users mailing list >> [email protected] >> http://lists.mkgnu.net/cgi-bin/mailman/listinfo/scmbug-users >> > >
_______________________________________________ scmbug-users mailing list [email protected] http://lists.mkgnu.net/cgi-bin/mailman/listinfo/scmbug-users
