Discussion:
[p4] Unable to revert opened file
jamiep
2012-05-14 09:40:01 UTC
Permalink
Posted on behalf of forum user 'jamiep'.

Good morning all,

We have a problem with an opened file, which was integrated and then somehow
opened for add (or at least this is how P4V once displayed its status). We are
using v2011.1 on both the server and client.

Unfortunately, we can't find any way of reverting it, as p4 opened does not
show that it is opened. When trying to add a file with the same name, Perforce
states that the file is already opened.

We have since deleted the the client workspace and obliterated the file in
question and it no longer appears in P4V at all. However, Perforce on the client
still believes that it is open for edit. I've tried to run a p4 flush and p4
sync -f, but neither seems to fix the problem.

% p4 add SystemDefinition.cfg
//depot/systems/XYZ/ABC/v11.2/SOL_X86/FIXEIG/run/site-specific/cfg/SystemDefinition.cfg
- can't add (already opened on this client)
...
//depot/systems/XYZ/ABC/v11.2/SOL_X86/FIXEIG/run/site-specific/cfg/SystemDefinition.cfg
- also opened by [...]

% p4 filelog SystemDefinition.cfg
SystemDefinition.cfg - file(s) not on client.

% p4 opened -a
[File not listed]

Has anyone else got any other ideas? We've been banging our heads against a
wall for the past few days(!)

Thanks very much,
Jamie



--
Please click here to see the post in its original format:
http://forums.perforce.com/index.php?/topic/1606-unable-to-revert-opened-file
Michael Mirman
2012-05-14 12:33:59 UTC
Permalink
A few thoughts (I'm shooting in the dark):

If you want to revert the file, and using Unix relative path does not work, what happens if you use a client- or depot-path?
I would try to revert the file by using the depot path.

What does "p4 where SystemDefinition.cfg" say?

Is it possible that your client spec changed and the file is now not mapped (but it was mapped when it was added)?

--
Michael Mirman
MathWorks, Inc.
508-647-7555
Post by jamiep
We have a problem with an opened file, which was integrated and then somehow
opened for add (or at least this is how P4V once displayed its status). We are
using v2011.1 on both the server and client.
Unfortunately, we can't find any way of reverting it, as p4 opened does not
show that it is opened. When trying to add a file with the same name, Perforce
states that the file is already opened.
We have since deleted the the client workspace and obliterated the file in
question and it no longer appears in P4V at all. However, Perforce on the client
still believes that it is open for edit. I've tried to run a p4 flush and p4
sync -f, but neither seems to fix the problem.
% p4 add SystemDefinition.cfg
//depot/systems/XYZ/ABC/v11.2/SOL_X86/FIXEIG/run/site-
specific/cfg/SystemDefinition.cfg
- can't add (already opened on this client)
...
//depot/systems/XYZ/ABC/v11.2/SOL_X86/FIXEIG/run/site-
specific/cfg/SystemDefinition.cfg
- also opened by [...]
% p4 filelog SystemDefinition.cfg
SystemDefinition.cfg - file(s) not on client.
% p4 opened -a
[File not listed]
Has anyone else got any other ideas? We've been banging our heads against a
wall for the past few days(!)
Thanks very much,
Jamie
jamiep
2012-05-14 12:50:01 UTC
Permalink
Posted on behalf of forum user 'jamiep'.



[http://forums.perforce.com/index.php?app=forums&module=forums&section=findpost&pid=5229]
Originally posted to the perforce-user mailing list by: Michael Mirman
If you want to revert the file, and using Unix relative path does not work, what happens if you use a client- or depot-path?
I would try to revert the file by using the depot path.
What does "p4 where SystemDefinition.cfg" say?
Is it possible that your client spec changed and the file is now not mapped (but it was mapped when it was added)?
I've tried reverting using a depot path and it refuses to revert it, saying
that it is not opened in the client:

$ p4 reopen
//depot/systems/XYZ/ABC/v11.2/SOL_X86/FIXEIG/run/site-specific/cfg/SystemDefinition.cfg
//depot/systems/XYZ/ABC/v11.2/SOL_X86/FIXEIG/run/site-specific/cfg/SystemDefinition.cfg
- file(s) not opened on this client. $ p4 revert
//depot/systems/XYZ/ABC/v11.2/SOL_X86/FIXEIG/run/site-specific/cfg/SystemDefinition.cfg
//depot/systems/XYZ/ABC/v11.2/SOL_X86/FIXEIG/run/site-specific/cfg/SystemDefinition.cfg
- file(s) not opened on this client.

When I run 'p4 where', I'm only seeing the single mapping:

$ p4 where SystemDefinition.cfg
//depot/systems/XYZ/ABC/v11.2/SOL_X86/FIXEIG/run/site-specific/cfg/SystemDefinition.cfg
//fixeig_xyz-dev/site-specific/cfg/SystemDefinition.cfg
/data/fixeig/run/site-specific/cfg/SystemDefinition.cfg

However, that file doesn't exist:

$ p4 filelog
//depot/systems/XYZ/ABC/v11.2/SOL_X86/FIXEIG/run/site-specific/cfg/SystemDefinition.cfg
//depot/systems/XYZ/ABC/v11.2/SOL_X86/FIXEIG/run/site-specific/cfg/SystemDefinition.cfg
- no such file(s).

I don't understand how it can believe that a file that no longer exists in
the depot is still open. Unless there is some relationship between an older
version of the client and the file in the database which is in a kind of
'orphaned' state.

Thanks for your help,
Jamie



--
Please click here to see the post in its original format:
http://forums.perforce.com/index.php?/topic/1606-unable-to-revert-opened-file
Michael Mirman
2012-05-14 13:44:39 UTC
Permalink
Jamie -

I also had a case like that recently, and it always turns out to be something trivial, but it's not obvious.
The trick is to find out what is wrong, and more often than not, mapping plays the crucial role.
Post by jamiep
$ p4 filelog
//depot/systems/XYZ/ABC/v11.2/SOL_X86/FIXEIG/run/site-
specific/cfg/SystemDefinition.cfg
//depot/systems/XYZ/ABC/v11.2/SOL_X86/FIXEIG/run/site-
specific/cfg/SystemDefinition.cfg
- no such file(s).
Sure the file does not exist since it was opened for 'ad''. It's a new file, so there is no file log for it.

What I am curious about is
Post by jamiep
% p4 opened -a
[File not listed]
Do it differently:
p4 opened -a //depot/... | grep SystemDefinition.cfg

There are always ways to revert any file - whether by reverting a specific file, or forceful removal of a change.
It's only a matter what size of a hammer to use.

I make the following assumptions:
- you have only one server,
- in all your commands the same user is used,
- there are no tricky protection table settings in regards to what files are seen by what users, from which IPs, etc.
Post by jamiep
$ p4 revert
//depot/systems/XYZ/ABC/v11.2/SOL_X86/FIXEIG/run/site-
specific/cfg/SystemDefinition.cfg
//depot/systems/XYZ/ABC/v11.2/SOL_X86/FIXEIG/run/site-
specific/cfg/SystemDefinition.cfg
- file(s) not opened on this client.
Do p4 info, and compare the client name in the output with the client where this file is opened (which would be shown in "p4 opened -a")

--
Michael Mirman
MathWorks, Inc.
508-647-7555
jamiep
2012-05-14 14:20:01 UTC
Permalink
Posted on behalf of forum user 'jamiep'.



[http://forums.perforce.com/index.php?app=forums&module=forums&section=findpost&pid=5231]
Originally posted to the perforce-user mailing list by: Michael Mirman
I also had a case like that recently, and it always turns out to be something trivial, but it's not obvious.
The trick is to find out what is wrong, and more often than not, mapping plays the crucial role.
Sure the file does not exist since it was opened for 'ad''. It's a new file, so there is no file log for it.
What I am curious about is
p4 opened -a //depot/... | grep SystemDefinition.cfg
Strangely, this still doesn't show the file at all...



Quote
There are always ways to revert any file - whether by reverting a specific file, or forceful removal of a change.
It's only a matter what size of a hammer to use.
- you have only one server,
- in all your commands the same user is used,
- there are no tricky protection table settings in regards to what files are seen by what users, from which IPs, etc.
We have two servers - one master and one replica server, but *all* commands go
to the master. The user who originally opened the file is different, however
they can't revert the file either - it still says the file is not opened on
the current client.

There are no particularly tricky protection table entries.



Quote
Do p4 info, and compare the client name in the output with the client where this file is opened (which would be shown in "p4 opened -a")
I've checked p4 info and it shows:

Client name: fixeig_xyz-dev Client host: xyz-dev

This matches what we see if we try and p4 add the file again:

//depot/systems/XYZ/ABC/v11.2/SOL_X86/FIXEIG/run/site-specific/cfg/SystemDefinition.cfg
- can't add (already opened on this client) ...
//depot/systems/XYZ/ABC/v11.2/SOL_X86/FIXEIG/run/site-specific/cfg/SystemDefinition.cfg
- also opened by ***@fixeig_xyz-dev

If I delete the client does that actually cause any opened files to be reverted?
I've tried this once already (as there's nothing in it we cannot afford
to lose) but it didn't seem to actually revert it as I expected.

Thanks,
Jamie



--
Please click here to see the post in its original format:
http://forums.perforce.com/index.php?/topic/1606-unable-to-revert-opened-file
Michael Mirman
2012-05-14 14:57:27 UTC
Permalink
Post by jamiep
Post by Michael Mirman
p4 opened -a //depot/... | grep SystemDefinition.cfg
Strangely, this still doesn't show the file at all...
Are you doing this as an admin? In other words, is it possible that you (as the current p4user) are restricted to see this file?
Post by jamiep
to the master. The user who originally opened the file is different, however
they can't revert the file either - it still says the file is not opened on
the current client.
So, there are two users involved (the original one and you).
I wonder if "p4 -u original_user opened -a //depot/..." would show that file.
Post by jamiep
Client name: fixeig_xyz-dev Client host: xyz-dev
//depot/systems/XYZ/ABC/v11.2/SOL_X86/FIXEIG/run/site-
specific/cfg/SystemDefinition.cfg
- can't add (already opened on this client) ...
//depot/systems/XYZ/ABC/v11.2/SOL_X86/FIXEIG/run/site-
specific/cfg/SystemDefinition.cfg
I would expect this command to work:
p4 -u other.user -c fixeig_xyz-dev revert -k //depot/systems/XYZ/ABC/v11.2/SOL_X86/FIXEIG/run/site-specific/cfg/SystemDefinition.cfg
Post by jamiep
If I delete the client does that actually cause any opened files to be reverted?
I've tried this once already (as there's nothing in it we cannot afford
to lose) but it didn't seem to actually revert it as I expected.
p4 client -f -d fixeig_xyz-dev
will kill all pending changes for that client, which will effectively remove the Perforce knowledge about the open file on that client.
I would not necessarily call it a revert, but that's beside the point.

--
Michael Mirman
MathWorks, Inc.
508-647-7555
jamiep
2012-05-16 08:40:01 UTC
Permalink
Posted on behalf of forum user 'jamiep'.



[http://forums.perforce.com/index.php?app=forums&module=forums&section=findpost&pid=5233]
Originally posted to the perforce-user mailing list by: Michael Mirman
Are you doing this as an admin? In other words, is it possible that you (as the current p4user) are restricted to see this file?
Yes, I'm an admin - with access to everything



Quote
So, there are two users involved (the original one and you).
I wonder if "p4 -u original_user opened -a //depot/..." would show that file.
Unfortunately, it still doesn't show it:

$ p4 -u original_user opened -a
//depot/systems/XYZ/ABC/v11.2/SOL_X86/FIXEIG/run/site-specific/... [... some
files, but not that one ...]



Quote
p4 -u other.user -c fixeig_xyz-dev revert -k //depot/systems/XYZ/ABC/v11.2/SOL_X86/FIXEIG/run/site-specific/cfg/SystemDefinition.cfg
...and unfortunately, reverting in this way doesn't work either:

$ p4 -u original_user -c fixeig_xyz-dev revert -k
//depot/systems/XYZ/ABC/v11.2/SOL_X86/FIXEIG/run/site-specific/cfg/SystemDefinition.cfg
//depot/systems/XYZ/ABC/v11.2/SOL_X86/FIXEIG/run/site-specific/cfg/SystemDefinition.cfg
- file(s) not opened on this client.



Quote
p4 client -f -d fixeig_xyz-dev
will kill all pending changes for that client, which will effectively remove the Perforce knowledge about the open file on that client.
I would not necessarily call it a revert, but that's beside the point.
This is strange then, as we've already deleted the original client once, so
I'm at a loss as to why it still thinks the file is open.

Thanks very much for all your help
Jamie



--
Please click here to see the post in its original format:
http://forums.perforce.com/index.php?/topic/1606-unable-to-revert-opened-file
jamiep
2012-05-16 11:35:01 UTC
Permalink
Posted on behalf of forum user 'jamiep'.



[http://forums.perforce.com/index.php?app=forums&module=forums&section=findpost&pid=5256]
Post by jamiep
Yes, I'm an admin - with access to everything
$ p4 -u original_user opened -a //depot/systems/XYZ/ABC/v11.2/SOL_X86/FIXEIG/run/site-specific/... [... some files, but not that one ...]
In case anyone else experiences a similar problem, this turned out to be due to
an inconsistency between db.lock and db.working.

On the advice of Perforce we ran:

p4d -r P4ROOT -xf 925

which deleted 1 lock - now we can work with the file normally again.

Thanks for your time,
Jamie



--
Please click here to see the post in its original format:
http://forums.perforce.com/index.php?/topic/1606-unable-to-revert-opened-file
Loading...