-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
STONReaderError
: File from GitStore
cache is incomplete
#356
Comments
Thank you for sending me the image. Ok, this was tricky: debugging the reading of a repository which is not on my disk, which means I cannot read any new objects from it. From your FSReference to git:/packages/Sandblocks-Core/package.st I went to
Now that I am finished it arises to me that I could also just have looked up that hash on GitHub in the Sandblocks repository... but anyway. The GitBlob of package.st contains all the bytes of So why is the file incomplete in the memory filesystem cache anyway? Either the bytes were put there incorrectly, or the file has since been overwritten. Looking at the GitStore's Ok no surprise given the start of the issue description:
The code has already begun writing to the file in the cache, putting 'Package ' there, then failing to write any rest because currentPackageProperties was nil. So we have to solve why it was nil. In TonelWriter>>#currentPackageProperties I see no obvious code path where it would return nil. STON fromStream: should also not have returned nil given the bytes from above in the file. To be continued... |
@LinqLover Please modify the TonelWriter>>writePackage: method as follows and wait until you see the debugger here next time:
If it happens again, please tell me what is in the package.st (according to the contents of the FSReference) at this point (in the GitFilesystem of course, not on the disk). If possible try to restart and debug through the currentPackageProperties method to find out how it can return nil (should only do that if the file contents were "nil" or "null"). |
...and for invalidating the cache, try |
(self packageDir / 'package.st') contents yields
If I debug it, I get a
Translating this to myself, I evaluated self directoryReference filesystem store loadFromRepository: self directoryReference path in the context of I have prepared another image snapshot for you, the issue is reproducible if you try to commit ( I could work around the issue by deleting all defect |
I suspect it was already too late then and the writer had already partially overwritten the file, but I cannot be sure. Did you modify the writePackage: with isThisEverCalled as I asked you to? Can you send me the image please? Maybe I also need your Git repository from the disk.
Not at all. The GitStore is a temporary object, just like its FileSystem, which only exists while the commit is being edited/prepared. You find it only while a SquitRepository creates a new commit. The SquotFileSystemStore used during that has an FSReference to the root directory of the Git FileSystem, which has the GitStore. Each GitStore and associated FileSystem are specific to a particular commit, that's why you cannot find it from the working copy.
The expression looks good to me, although its effectiveness depends on choosing the correct directory and I'm not sure whether it also discards files and directories below the one you pass as an argument. So be sure to pass the exact path of the package.st file and/or its parent directory, not just the root of the Tonel tree. |
I just sent you the image snapshot via Discord, hope that answers all open questions. Thank you for the explanations! :-) |
Originally raised in #341:
Today encountered a very similar bug, with the following difference:
(self packageDir / 'package.st') contents
evaluates to'Package '
As opposed to that, when accessing the normal
FileSystem
from the repository, the file contents are correct:Additional info from the command line:
Down in the
GitFilesystem
/FSMemoryHandle
/GitStore
/FSMemoryStore
, theroot
actually only contains these eight bytes (#[80 97 99 107 97 103 101 32]
) for that file.I did not find out how to invalidate the cache ...
The text was updated successfully, but these errors were encountered: