strange problem with passing $dbh value
I need a clue... I'm having a problem with import of bulk MARC records. We just moved all the Nelsonville Library Koha stuff to a new machine on Sunday, where we are now using the new 2.0 release. (Our old production machine had a pasted together collection of Koha stuff, some of it 7 months old.) In the process we also moved our MARC import script. Now something weird is happening. When I try to run the script as any user other than root, it fails because the bulkmarcimport call to the &MARCfind_marc_from_kohafield function in Biblio.pm is not passing the $dbh value. So Biblio.pm throws a 'no database' error: DBD::mysql::st execute failed: No Database Selected at /usr/local/koha/intranet/modules//C4/Biblio.pm line 258. (same error happens later in the script at Biblio.pm line 858) If I "su" to superuser and try running the script again, it works. (On our old machine, it worked either way.) The script is getting the value of $dbh from Context.pm without any problem. It just doesn't seem to pass the value to Biblio.pm unless the script is run by the superuser. All the Koha module permissions look OK (755) -- although that shouldn't even be a factor. I don't think this is a bug, I think I'm just overlooking something. Does anybody have any suggestions? -- Stephen Hedges Skemotah Solutions, USA www.skemotah.com -- shedges@skemotah.com
Stephen Hedges a écrit :
I don't think this is a bug, I think I'm just overlooking something. Does anybody have any suggestions?
chmod 644 /etc/koha.conf :-D -- Paul POULAIN Consultant indépendant en logiciels libres responsable francophone de koha (SIGB libre http://www.koha-fr.org)
On 2004-04-07 08:34:02 +0100 paul POULAIN <paul.poulain@free.fr> wrote:
Stephen Hedges a écrit :
I don't think this is a bug, I think I'm just overlooking something. Does anybody have any suggestions? chmod 644 /etc/koha.conf :-D
Even in jest, I think you shouldn't post such things. Someone will try it, publish their koha password without thinking and then blame you.
Thanks to Paul and Chris for suggesting the solution to this problem. I saw that the bulkmarcimport script was getting a hash reference from Context.pm, but I didn't bother to look at what was actually _in_ the hash reference! But thanks also to MJ for mentioning the security problem. I think I'm going to use sudo to give the non-root user the ability to run the import script as superuser and leave the file permissions as they are. Thanks, folks! -- Stephen Hedges Skemotah Solutions, USA www.skemotah.com -- shedges@skemotah.com
On Tue, Apr 06, 2004 at 01:56:25PM -0400, Stephen Hedges said:
I need a clue...
I'm having a problem with import of bulk MARC records. We just moved all the Nelsonville Library Koha stuff to a new machine on Sunday, where we are now using the new 2.0 release. (Our old production machine had a pasted together collection of Koha stuff, some of it 7 months old.) In the process we also moved our MARC import script.
Now something weird is happening. When I try to run the script as any user other than root, it fails because the bulkmarcimport call to the &MARCfind_marc_from_kohafield function in Biblio.pm is not passing the $dbh value. So Biblio.pm throws a 'no database' error:
DBD::mysql::st execute failed: No Database Selected at /usr/local/koha/intranet/modules//C4/Biblio.pm line 258. (same error happens later in the script at Biblio.pm line 858)
If I "su" to superuser and try running the script again, it works. (On our old machine, it worked either way.)
Hi Stephen My guess is its the permissions of /etc/koha.conf if it isnt readable as the user you run as, this might be the problem. Chris -- Chris Cormack Programmer 027 4500 789 Katipo Communications Ltd chris@katipo.co.nz www.katipo.co.nz
participants (4)
-
Chris Cormack -
MJ Ray -
paul POULAIN -
Stephen Hedges