Question

I'm trying fossil for the first time, and messed it up within minutes. I created a repository, then apparently ran commands in the wrong folders etc., eventually deleted the test repository, in order to restart. (Somewhere I had read that fossil was "self contained", so I thought, deleting a repository file would be ok. What is the correct way to delete a fossil repository?)

Now, with almost every command I try (incl. "all rebuild"), I get the error "not a valid repository" with the deleted repository name.

What now?

Was it helpful?

Solution

According to this post:

The "not a valid repository" error only arises when Fossil tries to measure the size of the repository file and sees that either the file does not exist or else that the size of the file is less than 1024 bytes. It does this by calling stat() on the file and looking at the stat.st_size field.

it seems likely that you have a missing or truncated Fossil file. Make sure you've actually deleted the repository file, and that your filesystem has actually released the file handles. Fossil stores some respository information in ~/.fossil, so you may need to remove that too.

rm ~/.fossil

In egregious cases, you may want reboot after deleting this file, just to be sure you're working with a clean slate.

If you're still having problems, try creating a new repository file in a different directory. For example:

cd /tmp
fossil init foo.fsl
fossil open foo.fsl
fossil close

If all that goes smoothly, you'll have to hunt down whatever remnants of the repository are lurking. As long as the file handles are closed, there's no reason you shouldn't be able to delete foo.fsl (or whatever) and call it good.

OTHER TIPS

I have just experienced the exact same problem on Windows. I too seem to have found a solution. Here is what I did. I cannot guarantee that it is a universal solution or even a good one. In:

C:\Users\mywindowsusername\AppData\Local

There was a file named _fossil and a directory/folder named VirtualStore. I deleted both. This seems to have removed all traces of the repository. Note that the repository was still in the "open" state, as with your case.

Edit: After experimenting further, it would appear that VirtualStore is a temporary directory that will disappear after committing (a .fossil file will then appear inside the targeted directory).

My mistake was to create a repository at the root and clone: fossil proceeded to clone the entire C drive. Probably a common newbie mistake.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top