"Use of uninitialized value in transliteration" er

Support and queries relating to all previous versions of ZoneMinder
Locked
unclerichy
Posts: 74
Joined: Wed Feb 25, 2004 5:06 pm

"Use of uninitialized value in transliteration" er

Post by unclerichy »

It has to be said that zmupdate.pl has never worked for me (usually because my mySQL server is on a different PC to ZM), however this time the errors were quite odd.

When I ran zmupdate.pl I got this:

Code: Select all

Use of uninitialized value in transliteration (tr///) at scripts/zmupdate.pl line 52, <CONFIG> line 5.
Use of uninitialized value in string eq at scripts/zmupdate.pl line 53, <CONFIG> line 5.
Use of uninitialized value in string eq at scripts/zmupdate.pl line 53, <CONFIG> line 5.
Use of uninitialized value in string eq at scripts/zmupdate.pl line 53, <CONFIG> line 5.
Use of uninitialized value in string eq at scripts/zmupdate.pl line 53, <CONFIG> line 5.
Use of uninitialized value in transliteration (tr///) at scripts/zmupdate.pl line 52, <CONFIG> line 5.
Use of uninitialized value in string eq at scripts/zmupdate.pl line 53, <CONFIG> line 5.
Use of uninitialized value in string eq at scripts/zmupdate.pl line 53, <CONFIG> line 5.
Use of uninitialized value in string eq at scripts/zmupdate.pl line 53, <CONFIG> line 5.
Use of uninitialized value in string eq at scripts/zmupdate.pl line 53, <CONFIG> line 5.
Use of uninitialized value in transliteration (tr///) at scripts/zmupdate.pl line 52, <CONFIG> line 5.
Use of uninitialized value in string eq at scripts/zmupdate.pl line 53, <CONFIG> line 5.
Use of uninitialized value in string eq at scripts/zmupdate.pl line 53, <CONFIG> line 5.
Use of uninitialized value in string eq at scripts/zmupdate.pl line 53, <CONFIG> line 5.
Use of uninitialized value in string eq at scripts/zmupdate.pl line 53, <CONFIG> line 5.
Use of uninitialized value in transliteration (tr///) at scripts/zmupdate.pl line 52, <CONFIG> line 5.
Use of uninitialized value in string eq at scripts/zmupdate.pl line 53, <CONFIG> line 5.
Use of uninitialized value in string eq at scripts/zmupdate.pl line 53, <CONFIG> line 5.
Use of uninitialized value in string eq at scripts/zmupdate.pl line 53, <CONFIG> line 5.
Use of uninitialized value in string eq at scripts/zmupdate.pl line 53, <CONFIG> line 5.
Undefined subroutine &main::ZM_DB_NAME called at scripts/zmupdate.pl line 64.
BEGIN failed--compilation aborted at scripts/zmupdate.pl line 74.
I got round that by running the correct zmalter.sql myself then checking zmupdate.pl for anything else that needed tweaking.

That done I ran zmpkg.pl status. uh-oh... exactly the same error, but this time in zmpkg.pl instead of zmupdate.pl. Looking at the code it's something to do with the regular expression that splits each line in the config file. If I change the regexp into /^(.*)=(.*)$/ (which depends on there being no whitespace in the file) it works. I don't fancy changing all of the PL files yet though :)

Here's my /usr/local/etc/zm.conf

Code: Select all

# ZoneMinder config
ZM_DB_SERVER=localhost
ZM_DB_NAME=zm
ZM_DB_USER=XXXX
ZM_DB_PASS=XXXX
There are no iffy end of line characters and no blank lines in it.

I'm running perl 5.8.0 on Redhat 9. Any suggestions?
User avatar
zoneminder
Site Admin
Posts: 5215
Joined: Wed Jul 09, 2003 2:07 pm
Location: Bristol, UK
Contact:

Post by zoneminder »

I'll take a look at the regexps.

You don't have any odd characters as part of your username or password do you?

Phil
unclerichy
Posts: 74
Joined: Wed Feb 25, 2004 5:06 pm

Post by unclerichy »

Nope, just plain text - no spaces, no punctuation.
User avatar
securiteaze
Posts: 25
Joined: Wed Jun 16, 2004 5:38 pm

Solved ... (for me)

Post by securiteaze »

FWIW
I also received the same error. In my case, it appears to be caused by my ignoring the errors caused using an old zmconfig.txt (1.19.5) with zmconfig.pl, and continuing with the install.

Code: Select all

DBI connect('database=zm;host=localhost','',...) failed: Access denied for user: 'root@localhost' (Using password: NO) at zmconfig.pl line 1603
Error: unable to load options from database: Access denied for user: 'root@localhost' (Using password: NO)
Saving config to 'zmconfig-gentoo.txt'
Saving config to DB
DBI connect('database=zm;host=localhost','',...) failed: Access denied for user: 'root@localhost' (Using password: NO) at zmconfig.pl line 1507
Error: unable to save options to database: Access denied for user: 'root@localhost' (Using password: NO)
I resolved the error by hardcoding a password on the the DBI connect(... lines in zmconfig.pl and running it again interactively, and then rebuilding zm. I suspect this may be caused by my system not having the proper entries in zm.conf (it didn't exist).

As a side note, all mysql users have passwords on my system, and because of this, prior zm installs have also needed a little tweaking. It appears that zm expects to connect without a password as 'root'@'localhost' which gives me minor fits.

I appreciate the hard work.
User avatar
zoneminder
Site Admin
Posts: 5215
Joined: Wed Jul 09, 2003 2:07 pm
Location: Bristol, UK
Contact:

Post by zoneminder »

ZM shouldn't assume a non-password at all. In fact it's not an error to not be able to initially connect to the DB when running zmconfig. It just uses the fle until you've had chance to enter the correct DB acess details.

Phil
oskin
Posts: 84
Joined: Tue May 25, 2004 7:03 pm
Location: Moscow, Russia

Post by oskin »

At upgrade zm the command " rpm-U zm-1.19.5-*.rpm " I too have faced this problem: zmconfig.pl has no values ZM_DB_USER and ZM_DB_PASS. In rpm I have overcome it by creation zmoptions from zmconfig.pl (having added a code for reading zm.conf).
Sorry, I counted it a local problem zm-*.rpm and have not thought about 1.20.0 to inform it to Phil. :(
duppie
Posts: 11
Joined: Fri Aug 01, 2003 8:01 am

Post by duppie »

I have the same problem but i cannot get it fixed i did replace:

Code: Select all

my ( $name, $value ) = $str =~ /^\s*([^=\s]+)\s*=\s*([^=\s]+)\s*$/;
with

Code: Select all

#my ( $name, $value ) = $str =~ /^(.*)=(.*)$/;
The scripts goes without any error but zm.php still reports Zoneminder not started. and if i try to start it with the zm.php it will not change.
duppie
Posts: 11
Joined: Fri Aug 01, 2003 8:01 am

Post by duppie »

I have the same problem but i cannot get it fixed i did replace:

Code: Select all

my ( $name, $value ) = $str =~ /^\s*([^=\s]+)\s*=\s*([^=\s]+)\s*$/;
with

Code: Select all

#my ( $name, $value ) = $str =~ /^(.*)=(.*)$/;
The scripts goes without any error but zm.php still reports Zoneminder not started. and if i try to start it with the zm.php it will not change.

There where NO errors with the make and configure script
unclerichy
Posts: 74
Joined: Wed Feb 25, 2004 5:06 pm

Post by unclerichy »

Why the # in front of my? # is a comment in perl which means that the line is being ignored.
duppie
Posts: 11
Joined: Fri Aug 01, 2003 8:01 am

Post by duppie »

That is correct I forgot to delete the # in this message I did not delete the line in the config. so that i can change between commands in the conf file.
Locked