"Could not open lock file" but not fixed by 4.32

NorfolkMustard

Joined: 2003-05-14
Posts: 6
Posted: Wed, 2003-05-14 17:17

Error on the last page of config.

Quote:
Warning: fopen("/home/nas03/f/forums.norfolkmustard.co.uk/user/htdocs/photos/.users/1052930061:1484966764.lock", "a+") - Invalid argument in /home/nas03/f/forums.norfolkmustard.co.uk/user/htdocs/platform/fs_unix.php on line 53
Error: Could not open lock file (/home/nas03/f/forums.norfolkmustard.co.uk/user/htdocs/photos/.users/1052930061:1484966764.lock)!

Running chmod -v -R 777 *

Quote:
--snip--

mode of `photos' changed to 0777 (rwxrwxrwx)
mode of `photos/.users' changed to 0777 (rwxrwxrwx)
failed to change mode of `photos/.users/.htaccess' to 0777 (rwxrwxrwx)
chmod: changing permissions of `photos/.users/.htaccess': Operation not permitted
failed to change mode of `photos/.users/userdb.dat' to 0777 (rwxrwxrwx)
chmod: changing permissions of `photos/.users/userdb.dat': Operation not permitted
failed to change mode of `photos/.users/userdb.dat.lock' to 0777 (rwxrwxrwx)
chmod: changing permissions of `photos/.users/userdb.dat.lock': Operation not permitted

Some config info for background

the URL to your Gallery http://forums.norfolkmustard.co.uk
the version of Gallery, 1.3.3
the version of PHP, 4.1.2
the version of Apache, Apache/1.3.27
your operating system and hardware, Linux fhlinuxbuild 2.4.9-13 #1 Tue Oct 30 20:11:04 EST 2001 i686

 
alindeman
alindeman's picture

Joined: 2002-10-06
Posts: 8194
Posted: Wed, 2003-05-14 20:47

Run chmod on the .users directory, which a "*" will not match.

E.g.
cd /my/albums/directory
chmod -R 0777 .users

 
NorfolkMustard

Joined: 2003-05-14
Posts: 6
Posted: Wed, 2003-05-14 21:04

Thanks for replying mate... but didn't seem to do the trick

Quote:
$chmod -R 777 .users
chmod: changing permissions of `.users/.htaccess': Operation not permitted
chmod: changing permissions of `.users/userdb.dat': Operation not permitted
chmod: changing permissions of `.users/userdb.dat.lock': Operation not permitted

A ls -l of the files

Quote:
$ ls -l
total 1
-rw-r--r-- 1 apache gapache 737 May 14 17:37 userdb.dat
-rw-r--r-- 1 apache gapache 0 May 14 17:37 userdb.dat.lock

Am I locked out because the owner is 'apache' ??

Stu

 
alindeman
alindeman's picture

Joined: 2002-10-06
Posts: 8194
Posted: Wed, 2003-05-14 21:16

Now that I look at the error, it seems like it's not a permission issue

Quote:
fopen("/home/nas03/f/forums.norfolkmustard.co.uk/user/htdocs/photos/.users/1052930061:1484966764.lock", "a+") - Invalid argument in /home/nas03/f/forums.norfolkmustard.co.uk/user/htdocs/platform/fs_unix.php on line 53

I don't really know what would cause an Invalid argument error... Does anyone else have any ideas?

 
NorfolkMustard

Joined: 2003-05-14
Posts: 6
Posted: Wed, 2003-05-14 21:25

A bit more info

Thinking it may well be the 'apache' problem, i thought't I'd FTP the files back here, delete them from the remote server, then FTp them back. Sure enough, this cleared the 'apache' entries on the three files. I then duly chmod -R -v 777 .users and they all returned fine rwxrwxrwx. Great I thought. Went through the /setup pages again, and got the same error as before. Of course, it had created a new userdb.dat file and a .bak of the old one... ;o(

so now I have

Quote:
$ ls -l
total 2
-rw-r--r-- 1 apache gapache 737 May 14 22:12 userdb.dat
-rwxrwxrwx 1 4294967294 4294967294 737 May 14 22:10 userdb.dat.bak
-rwxrwxrwx 1 4294967294 4294967294 0 May 14 22:10 userdb.dat.lock

Thanks for persevering...

 
alindeman
alindeman's picture

Joined: 2002-10-06
Posts: 8194
Posted: Wed, 2003-05-14 21:43

As I said in my last post, this is probably not a permission issue.

It's fine to have the files owned by "apache", because the web server is the one who is trying to write to it.

 
joan
joan's picture

Joined: 2002-10-21
Posts: 3473
Posted: Wed, 2003-05-14 22:12

just to be sure: the directory /home/nas03/f/forums.norfolkmustard.co.uk/user/htdocs/photos/.users/ does exist?

 
NorfolkMustard

Joined: 2003-05-14
Posts: 6
Posted: Wed, 2003-05-14 22:37

yep http://forums.norfolkmustard.co.uk/photos/.users/

gallery created the folder, and successfully created .htaccess, userdb.dat and userdb.dat.lock in it.

you can play around with http://forums.norfolkmustard.co.uk/setup/ if you like, there's no files there yet... without getting past this problem I can't login through the front-end to upload photos anyway :wink:

 
joan
joan's picture

Joined: 2002-10-21
Posts: 3473
Posted: Wed, 2003-05-14 23:11

so if you type ls /home/nas03/f/forums.norfolkmustard.co.uk/user/htdocs/photos/.users/ at a shell prompt, you see the files?

Have you tried "rm -r .users" and then re-run the configuration script? You never know, it might fix it.

 
NorfolkMustard

Joined: 2003-05-14
Posts: 6
Posted: Thu, 2003-05-15 18:55

joan,

Quote:
$ cd /
$ ls /home/nas03/f/forums.norfolkmustard.co.uk/user/htdocs/photos/.users
userdb.dat userdb.dat.bak userdb.dat.lock

Also deleted the folder as you suggested, no joy I'm afraid... Is there anything you think I should be asking my hosting company?

Cheers
Stu

 
joan
joan's picture

Joined: 2002-10-21
Posts: 3473
Posted: Thu, 2003-05-15 19:55

I'm stumped.

Beckett? Joyof?

 
beckett
beckett's picture

Joined: 2002-08-16
Posts: 3474
Posted: Fri, 2003-05-16 03:30

If you can give me a shell login/password (PM or email it to me) I'll go in and try a bunch of things. If this is just a permissions problem, it should be easy to fix. But it doesn't seem that way. I'd be inclined to move the old albums directory, create a brand new one, and copy over the albums.

-Beckett (

)

 
beckett
beckett's picture

Joined: 2002-08-16
Posts: 3474
Posted: Fri, 2003-05-16 09:35

Hi okay. Thanks for the login info.

I have some unfortunate news:
Your host has disabled certain PHP functions such as exec() and passthru() which are vital for Gallery to run. It needs these commands to execute various external programs. It's very likely that the fopen() error is a side-effect of this as well.

You'll either need to ask your host to re-enable these functions, or Gallery will not be able to run on this host. :(

-Beckett (

)

 
NorfolkMustard

Joined: 2003-05-14
Posts: 6
Posted: Fri, 2003-05-16 10:01

Cheers mate, much appreciated. I'll get on to my host...

Stu

 
tholbroo

Joined: 2003-06-04
Posts: 1
Posted: Thu, 2003-06-05 04:15

I think I may have an answer for what's going on here since I had the same problem and managed to fix it. Is your host running unix of some kind for the hosting box but using a Windows NAS box over NFS for disk storage? Judging by your path (/home/nas02/...) this could very well be the case.

The problem is the colon in the filename (1052930061:1484966764.lock) which is fine under unix but the Windows box chokes on it. I fixed it on my end by reg_replace()ing all the colons to dashes in every file related command in platform/fs_unix.php.

You may also have a problem with renaming albums if you get past this one, but I haven't got a solution for that one. Luckily it means you're just stuck with "album??" as the internal album name. I haven't found any other problems yet.