go client fails with error when retrieving blob

55 views
Skip to first unread message

Quinn

unread,
Jan 23, 2025, 9:51:23 PMJan 23
to Perkeep
Here's the code:
    rc, _, err := src.Fetch(ctx, br)
    if err != nil {
        return nil, fmt.Errorf("failed to fetch %s: %s", br, err)
    }
error message:

failed to fetch sha224-64660a1aaedf98702e9ca80ea9287c7bcd1be3b09dc9a5fcd2bbd67a: file does not exist  

However, there is a datfile for this:

ls -l ~/var/perkeep/blobs/sha224/64/66/sha224-64660a1aaedf98702e9ca80ea9287c7bcd1be3b09dc9a5fcd2bbd67a.dat
-rw------- 1 quinn quinn 249 Jan 18 21:33 /home/quinn/var/perkeep/blobs/sha224/64/66/sha224-64660a1aaedf98702e9ca80ea9287c7bcd1be3b09dc9a5fcd2bbd67a.dat

I have my server configured with index disabled. This error is intermittent, sometimes it goes away on its own, i think. Do i need to rebuild the cache manually sometimes?

Quinn


Quinn

unread,
Jan 23, 2025, 9:52:51 PMJan 23
to Perkeep
Here's more context:

    br, ok := blob.Parse(hash)
    if !ok {
        return nil, fmt.Errorf("failed to parse argument %q as a blobref", hash)
    }

    src, err := cacher.NewDiskCache(p.cl)
    if err != nil {
        log.Fatalf("Error setting up local disk cache: %v", err)
    }
    defer src.Clean()

Quinn

Quinn

unread,
Jan 23, 2025, 10:09:17 PMJan 23
to Perkeep
OK, I just removed the disk cache and am fetching from the client directly and it works.. The disk cache was copy pasta =(

Quinn

Quinn

unread,
Jan 26, 2025, 10:54:56 AMJan 26
to Perkeep
I am seeing this again, and it seems to be intermittent. A blob will definitely exist (i confirm in ~/var), but I will get an error on client.Fetch, and also client.SimpleEnumerateBlobs does not include the hash. I restart my server a couple times, or restart perkeepd, and suddenly it can retrieve the blob without me changing anything in the code. 

This is how I'm initiating the client:

    optTransportConfig := client.OptionTransportConfig(&client.TransportConfig{})
    cl := client.NewOrFail(client.OptionInsecure(false), optTransportConfig)

Quinn

unread,
Jan 29, 2025, 5:38:48 PMJan 29
to Perkeep
After dealing with this intermittent issue for a few more days now, I seem to have the best luck with restarting my server (not perkeepd). Not sure why "reloading" the the go perkeep client lib would cause it to find these blobs any better, after removing the cache, not sure what it could be doing other than calling to the perkeep REST API? 
Reply all
Reply to author
Forward
0 new messages