Alex Brodov
Alex Brodov

Reputation: 3515

perforce p4 sync issue

I've created a workspace through the GUI using p4v in the following path:

/home/RND/abrodov/Perforce/abrodov_tlv-cc-32_93

I'm trying to use the p4 commands, for example i've tried:

p4 sync -f

and i got the following error:

Client 'tlv-cc-32' unknown - use 'client' command to create it.

This is the environment variable that i'm using for P4:

export p4v=/opt/p4v-2014.2.973065/bin
export P4PORT=IP:PORT
export P4USER=$USER
export P4CLIENT=$HOSTNAME
alias p4v="p4v &"
export PATH=$p4v:$PATH

Upvotes: 11

Views: 21330

Answers (2)

Sahil Singh
Sahil Singh

Reputation: 3787

Summary

Remove any extra spaces.

Detailed explanation.

P4 command can throw this error because of extra spaces too. I faced a similar issue when setting p4 global options via environment variables (windows).

set GLOBAL_OPTIONS="-c sahil"                  REM **INCORRECT**
p4 %GLOBAL_OPTIONS% sync //file/path

sahil is my workspace name. p4 was interpreting the name as " sahil" (with space), and therefore was failing to find it. The following worked.

set GLOBAL_OPTIONS="-csahil"                  REM **CORRECT**
p4 %GLOBAL_OPTIONS% sync //file/path

For the same reason among the following 2 commands, 1st one fails to work, 2nd one works fine.

p4 "-c sahil" sync //file/path REM **INCORRECT**
p4  -c sahil  sync //file/path REM **CORRECT**

The space causes this subtle issue which can be hard to detect. In my case the workspace name "sahil" did exist, I was however not aware about how p4 interprets spaces.

PS: Not the reason why the author of the question faced this error, but it is one of the causes for which p4 can throw this error, and which took me some time to figure out.

Upvotes: 0

Bryan Pendleton
Bryan Pendleton

Reputation: 16339

Since client 'tlv-cc-32' is unknown to the server, that must not be the correct name of the client you're using with P4V.

Run

p4 clients -u $P4USER

to get a list of all your workspace names, then find the one that you're using with P4V. (Alternatively, in P4V, use the "Edit Current Connection" menu to see your "Workspace name:")

Then set P4CLIENT to the correct name of your P4V workspace, and use 'p4 info' to verify that the server associates that client name with your workstation's root directory.

Then

p4 sync -f

will work just fine.

(Though, one wonders, why do you feel the need to run 'p4 sync -f'?)

Upvotes: 13

Related Questions