tags:

views:

83

answers:

1

I'm new to Perforce, and it is not going well at all. But currently, I am completely stuck, as all I can get it to say is:

$ p4 open a_code_file.cpp
Locked client 'my_hostname' can only be used by owner 'perforce'.

I have absolutely no idea what I did to upset it, and the error message itself is meaningless gibberish to me. "perforce" doesn't own anything - all the files are owned by me. I am in a Perforce repository, ie, there's a .p4rc a few directories up.


Edit: It only seems to be some files. If I:

$ cd some_other_directory_in_the_repo
$ p4 open a_file

... it works. So it's only some things...

+2  A: 

The "locked client" error suggests that p4 is trying to use a client workspace, named after your hostname, owned by the user perforce. If Perforce can't find a valid client name, either in the registry (on Windows), environment variables, or in an environment file, it'll default to using a client workspace named after your hostname.

It sounds like Perforce can't find a valid client workspace for your "broken" directory, and finds one for your "working" directory.

Since you have one directory that works, and one directory that doesn't, can you try:

$ p4 set

from both directories, and compare the results? If Perforce can find a valid client, you'll see something like:

P4CLIENT=XXXX (config)

(the "(config)" means Perforce is getting that configuration variable from a configuration file. Consult p4 help set for more information on the various ways you can set variables.)

Look also for a line like:

P4CONFIG=.p4env

which is what Perforce will use to search for your workspace configuration. If you're using a file named .p4rc, that's what P4CONFIG should be set to.

Commodore Jaeger
I apparently had a blank `.p4rc` in that directory - I have no clue how that got there. I would have never been able that out with just the error that Perforce was giving me. The `p4 set` helped greatly, thanks!
Thanatos