Fossil Forum

Unresolved RID when using fossil open
Login

Unresolved RID when using fossil open

Unresolved RID when using fossil open

(1.1) Originally by othelarian with edits by Warren Young (wyoung) on 2023-11-15 14:26:09 from 1.0 [link] [source]

Hi everyone,

After a long time without using fossil, I'm starting a new project with it today. I make it work once, with a commit and all, but now I can't use the following commands :

cd myapp_dir
fossil open ..\myapp.fossil
fossil co ..\myapp.fossil
fossil close --force
fossil http

Each time I have the following message :

PS C:\****\myapp_dir> fossil open ..\myapp.fossil
Unresolved RID values: 2 3 4 5 6 7 8 9

I'm on Windows 11. I already delete a file named _fossil in AppData\Local, but nothing changed.

I'm still searching for a solution, and I'm aware of this thread but I have the same error message with fossil close --force

If someone has some hint on what's going on, or if I need to delete a config file somewhere, I would appreciate it ;-)

(WY EDIT: Markdown fix for post URL.)

(2) By Richard Hipp (drh) on 2023-11-15 14:35:16 in reply to 1.1 [link] [source]

The first two commands seem reasonable:

cd myapp_dir
fossil open ../myapp.fossil

The second command above should have opened the repository and populated your working directory with all the files of the latest check-in. But the next command is puzzling:

fossil co ../myapp.fossil

What were you hoping to accomplish there? What did you think that command would do? Why did you think it was necessary?

I'm not being snarky. I genuinely do not understand what is your mental model of DVCSes, and so I do not know how I might improve the documentation to make things easier.

(5) By othelarian on 2023-11-15 15:45:28 in reply to 2 [link] [source]

Sorry for the bad explanation, the first line cd myapp_dir is the only one that actually works, and all the commands after fail with the same error. I tried fossil co ..\myapp.fossil just in case it was an issue with open only, and help me define how bad was the issue.

So actually all the commands listed in my post don't work and generate the same error message.

(3) By Richard Hipp (drh) on 2023-11-15 14:37:28 in reply to 1.1 [link] [source]

If you error is coming from the "fossil open" command and the error is "Unresolved RID values:", that indicates that the argument to "fossil open" was not a valid Fossil repository. Where did you get that repository? Did you try to build it yourself? What commands did you use to build it? What do you think is in that repository? What do you see if you run:

fossil ui ../myapp.fossil

(6) By othelarian on 2023-11-15 16:00:03 in reply to 3 [link] [source]

I ran through the following process (multiple time, each time with the same error):

PS C:\****\Dev> fossil new app.fossil
project-id: 5545c124e849bcb9a7c45ec4373740830aee8584
server-id:  0467123f001c1c3b88cadcfddbc8ce12118220e6
admin-user: othelarian (initial password is "RBGVDr8pWu")
PS C:\****\Dev> cd .\myapp_dir
PS C:\****\Dev\myapp_dir> fossil open ..\app.fossil
Unresolved RID values: 2 3 4 5 6 7 8 9

PS C:\****\Dev\myapp_dir>

I tried to create a new directory to be sure, same issue (and all the previous directory was empty).

And if I run fossil ui ..\app.fossil I get the normal ui on my browser, and I can change the settings (like the project's name), save, close the server, and start it again with the changes visible. Same if I use fossil server ..\app.fossil, I can access localhost:8080.

I also tried with a non-empty directory, and then I have a different answer:

PS C:\****\nonempty_dir> fossil open ..\app.fossil
directory C:/****/nonempty_dir is not empty
use the -f (--force) option to override
or the -k (--keep) option to keep local files unchanged
PS C:\****\nonempty_dir>

But when I add -f or -k I get the same error as with an empty directory.

(4) By Preben Guldberg (preben) on 2023-11-15 14:47:49 in reply to 1.1 [source]

What was the general flow before you encountered the problem?

Did you do any backups of repositories that you restored, for instance?

BTW, what version of fossil are you using?

(7) By othelarian on 2023-11-15 16:08:46 in reply to 4 [link] [source]

I downloaded and installed fossil.exe this morning, version 2.22 [66ee0beb9b]. I added it to a directory I have in my PATH envar.

It's a fresh project, on a computer I never use fossil on before. I created a new fossil project with fossil init myapp.fossil to practice a bit before using it on my latest code. I also installed the plugin for Visual Studio Code, but I removed it quickly as it seemed to always scan my directory.

I used fossil successfully one time, using fossil open ..\myapp.fossil and fossil add some files, and I managed to have one commit. I deleted the first myapp.fossil to retry another time and it's since this that I have the issue.

I tried to reboot my computer, but I'm still facing the issue.

I don't remember using fossil close though, is this possible that my deleted project was still locking the parent directory?

(8) By Preben Guldberg (preben) on 2023-11-15 16:37:17 in reply to 7 [link] [source]

I deleted the first myapp.fossil to retry another time and it's since this that I have the issue.

For your current directory, where you checked out the files from the original repository, that would be a cause for RID errors on at least some of the commands.

After a fossil open, there is a local fossil related database that tracks information about the current checkout, including the path to the repository and the current state of the files.

When you delete the original repository, the local state has no repository to compare to.

If you create a new repository where the previous one existed, the local state is inherently out of sync with the repository - and you get RID errors.

(9) By Richard Hipp (drh) on 2023-11-15 16:42:30 in reply to 8 [link] [source]

I suppose we need to detect when users do this and emit a better error message. Though, this has never come up before, that I recall.

(11) By Preben Guldberg (preben) on 2023-11-15 17:21:59 in reply to 9 [link] [source]

Would a wording like this be good?

% fsl branch ls
Unresolved RID values: 2 4 6 8 10 12 14 16 18 20

Local check-out database is out of sync with repository file:

    /Users/preben/tmp/fossil/rids/x.fossil

Has the repository file been replaced?

(16) By Preben Guldberg (preben) on 2023-11-16 12:19:46 in reply to 11 [link] [source]

FWIW, I mottied the above message in a new branch (unresolved-rid-explanation).

Wording probably could be better, but it's a starting point.

(25) By Preben Guldberg (preben) on 2024-01-02 20:12:23 in reply to 16 [link] [source]

Catching up on old threads and branches...

Is the wording OK?

And if so, would it be helpful to merge unresolved-rid-explanation branch?

(26) By Daniel Dumitriu (danield) on 2024-01-02 20:17:25 in reply to 25 [link] [source]

I'd say yes and yes.

(27) By Preben Guldberg (preben) on 2024-01-05 21:05:11 in reply to 26 [link] [source]

Thank you.

Merged it into trunk just now.

(12) By Larry Brasfield (larrybr) on 2023-11-15 17:54:20 in reply to 9 [link] [source]

I hit this problem several times before Fossil trained me to avoid it.

The reason I hit it is because I like to have subdirectory names corresponding the branches, and was taught by Fossil that I cannot just change the name of a directory which is an active ("open", not closed) check-out.

That training would have been a one-shot affair with a more edifying error message.

(13.2) By Andy Bradford (andybradford) on 2023-11-15 18:12:18 edited from 13.1 in reply to 12 [link] [source]

> The  reason I  hit it  is because  I like  to have  subdirectory names
> corresponding the  branches, and  was taught by  Fossil that  I cannot
> just change  the name of a  directory which is an  active ("open", not
> closed) check-out.

Are you sure?  I don't know why  Fossil would care what the  name of the
checkout directory  (aka local-root) is called  or if you move  it. What
matters is the location of the actual Fossil file (aka repository).

Case in point:

$ fossil status
repository:   /tmp/test.fossil
local-root:   /tmp/someotherdirectory/
config-db:    /home/amb/.fossil
checkout:     8e2313375ccb8c1f8843d8b420df2bd3c1d14693 2023-11-15 18:05:08 UTC
parent:       5fe4842b50283126167b64e9b1621c7d0550f37d 2023-11-15 18:04:36 UTC
tags:         trunk
comment:      go (user: amb)
$ mv /tmp/someotherdirectory /tmp/renameddirectory
$ fossil status
repository:   /tmp/test.fossil
local-root:   /tmp/renameddirectory/
config-db:    /home/amb/.fossil
checkout:     8e2313375ccb8c1f8843d8b420df2bd3c1d14693 2023-11-15 18:05:08 UTC
parent:       5fe4842b50283126167b64e9b1621c7d0550f37d 2023-11-15 18:04:36 UTC
tags:         trunk
comment:      go (user: amb)
$ echo $RANDOM >> file
$ fossil ci -m done
New_Version: 9c4a06dc46e87058c6bcc4408dd4c23566247b8fb54c0637f37138ebd722f170
$ mv /tmp/test.fossil /tmp/oops.fossil
$ fossil status
repository does not exist or is in an unreadable directory: /tmp/test.fossil
$ fossil new ../test.fossil
project-id: 8088b02984863584b3055602d19fbfa53d751a85
server-id:  7816d50b1f30646ab1fb8447e79f230ff6a8686e
admin-user: amb (initial password is "LNodTa7qPV")
$ fossil status            
Unresolved RID values: 4

So,  as I  have demonstrated,  Fossil does  not care  what the  checkout
directory is. You can name your directories to correspond to branches if
you like.  You can even  move them around if  you like. What  you cannot
move or replace is the repository.

Andy

(15) By Larry Brasfield (larrybr) on 2023-11-15 18:29:25 in reply to 13.2 [link] [source]

I am fully prepared to admit that I may have learned to trod a narrower path than Fossil actually requires to avoid grief. Since sorting out the exact boundary it imposes is a side-track for me, I elect to be conservative on this. I especially hope to avoid doing anything that messes up project repositories.

(14) By Preben Guldberg (preben) on 2023-11-15 18:20:49 in reply to 12 [link] [source]

I think the restriction is that fossil must still be able to find the repository as recorded in the local check-out database.

So you cannot rename or move the repository.

And if you use relative paths to the repository, the relative path must remain the same (so you can rename a checked-out directory, but moving it is likely to cause problems).

But, indeed, it pays of to be careful with where you keep your repositories and checkouts.

(17) By Konstantin Khomutov (kostix) on 2023-11-16 14:18:21 in reply to 14 [link] [source]

May be something like fossil reconnect-checkout a/new/path/to/the/relocated/repository.fossil could work for such cases?

Or it's just too much fuss for a non-problem?

(18) By Daniel Dumitriu (danield) on 2023-11-16 14:21:06 in reply to 17 [link] [source]

Try fossil test-move-repository /a/new/path/to/the/relocated/repository.fossil.

(19) By Preben Guldberg (preben) on 2023-11-16 14:49:56 in reply to 18 [link] [source]

I suppose that may work in other situations where the repository is missing.

But for the Unresolved RID error, I think you can only get that if a repository currently exists where the local check-out expects it.

Even if this may be part of a solution, I think it's better to expand on why, in general terms, a Unresolved RID might occur - but leave the user to search for a solution (e.g. here), rather than try to second guess the flow that let to the situation.

(20) By Daniel Dumitriu (danield) on 2023-11-16 16:59:32 in reply to 19 [link] [source]

Agreed. My reply's goal was more to point out that for Konstantin's issue a command already exists.

By the way - should we maybe upgrade test-move-repository to a (possibly renamed) first-class command? I feel like it belongs somewhere between a full command and a test command - something like a subcommand or an option to another command, but I can't say which one specifically it would fit :)

(22.1) By Andy Bradford (andybradford) on 2023-11-16 17:32:49 edited from 22.0 in reply to 19 [link] [source]

> But for the Unresolved  RID error, I think you can only  get that if a
> repository currently exists where the local check-out expects it.

Correct.  If you  have deleted  the repository  completely, Fossil  will
issue a different error:

$ mv ../relative.fossil ../newrelative.fossil
$ fossil status
repository does not exist or is in an unreadable directory: /tmp/relative.fossil

And if the repository isn't really a repository:

$ fossil status
not a valid repository: /tmp/relative.fossil


The discussion about test-move-repository really doesn't help new users;
it can only help experienced users  who know that one cannot simply move
a repository and  expect open checkout directories that  reference it to
continue to work. This is not the situation of the OP, nor any other new
user who is experimenting and breaks things through trial and error.

Andy

(23) By Daniel Dumitriu (danield) on 2023-11-16 17:33:49 in reply to 22.0 [link] [source]

The discussion about test-move-repository really doesn't help new users

Yes, that should be another thread. Or /chat.

(24) By Florian Balmer (florian.balmer) on 2023-11-16 20:13:16 in reply to 23 [link] [source]

Also see the link below for what is required to make test-move-repository a first-class command:

(21.1) By Andy Bradford (andybradford) on 2023-11-16 17:30:27 edited from 21.0 in reply to 14 [link] [source]

> I think the restriction is that fossil  must still be able to find the
> repository as recorded in the local check-out database.

Furthermore, it must be the same repository file from which the checkout
was opened, not  a clone, or not a newly  minted repository that happens
to have the same name.


> (so you can rename a checked-out directory, but moving it is likely to
> cause problems).

Let me  just clarify;  I think  what you meant  to say  is that  one can
rename  a checkout  directory, but  one cannot  rename a  repository and
expect open checkouts to continue working.


Andy

(10) By othelarian on 2023-11-15 16:47:25 in reply to 8 [link] [source]

Since your message I checked the parent directory, and I have a _FOSSIL_ hidden in the mess. After deleting it I finally get fossil to work gracefully.

Thanks for pointing me to the right direction. I agree that the message should be more helpful.

Thank all of you for your very fast answer.

=== SOLUTION ===

So, if someone meet the same issue as mine, on Windows, with fossil 2.22:

=> check in your current AND parent directory if there's a _FOSSIL_ file, and delete it.