On Windows: "Error writing block to datastore: Access is denied."

I’m running the ipfs daemon on Windows. I run it as Administrator, so it should have all the rights it needs, but still I get the “Error writing block to datastore: Access is denied.” from now and then. My datastore is allowed to grow to 25GBs, but ipfs blocks folder is only 32MB and datastore is 900kb. Sometimes I have connections to around 500 nodes, sometimes it drops to 0 until I restart the daemon.

Agent Version go-ipfs/0.4.13/
Protocol Version ipfs/0.1.0

Initializing daemon...
Swarm listening on /ip4/10.41.10.6/tcp/4001
Swarm listening on /ip4/127.0.0.1/tcp/4001
Swarm listening on /ip4/169.254.135.141/tcp/4001
Swarm listening on /ip4/169.254.217.99/tcp/4001
Swarm listening on /ip4/172.30.29.49/tcp/4001
Swarm listening on /ip4/192.168.1.30/tcp/4001
Swarm listening on /ip6/::1/tcp/4001
Swarm listening on /p2p-circuit/ipfs/Qmd8bhCzgAsonPzu54yZB3WVEHtt4n2wiybifmdiYBhaiH
Swarm announcing /ip4/10.41.10.6/tcp/4001
Swarm announcing /ip4/127.0.0.1/tcp/4001
Swarm announcing /ip4/169.254.135.141/tcp/4001
Swarm announcing /ip4/169.254.217.99/tcp/4001
Swarm announcing /ip4/172.30.29.49/tcp/4001
Swarm announcing /ip4/192.168.1.30/tcp/4001
Swarm announcing /ip6/::1/tcp/4001
API server listening on /ip4/127.0.0.1/tcp/5001
Gateway (readonly) server listening on /ip4/127.0.0.1/tcp/8080
Daemon is ready
e[0;37m09:14:20.276 e[31mERROR e[0;34m   bitswap: e[0mError writing block to datastore: Access is denied. e[0;37mbitswap.go:317e[0m
e[0;37m09:14:20.471 e[31mERROR e[0;34m   bitswap: e[0mError writing block to datastore: Access is denied. e[0;37mbitswap.go:317e[0m
e[0;37m09:14:20.471 e[31mERROR e[0;34m   bitswap: e[0mError writing block to datastore: Access is denied. e[0;37mbitswap.go:317e[0me[0;37m09:21:03.471 e[31mERROR e[0;34m    swarm2: e[0mfailed to reset connection deadline after setup: set tcp4 10.41.10.6:65245: use of closed network connection e[0;37mswarm_dial.go:406e[0m

This issue is being tracked on github: https://github.com/ipfs/go-ipfs/issues/3971

When I was using the default datastore the issue seemed to have been helped by disabling Windows indexing and antivirus on the directory, but that didn’t seem to totally address it. However, I haven’t gotten this error since switching to the badger datastore (currently still experimental, but planned to be the default at some point in the future).

Instructions for using badger are here.

2 Likes

Thanks a lot @leerspace!

I’ll follow the issue on GitHub and I will probably switch to badger datastore as well in the meantime.

I guess I should go ahead and close my post here - Error messages/phone tethering

Should have known to use the search first lol

i got this error:
e[0;37m16:54:35.094 e[31mERROR e[0;34m bitswap: e[0mError writing block to datastore: rename E:\Users\xxx.ipfs\blocks\AI\put-214307124 E:\Users\xxx.ipfs\blocks\AI\CIQOGLCIEMXAHJLDCM7VQ44JSCPCPFIGMBVMNX2WV3LK3OZUP25HAIA.data: Access is denied.

@leerspace I followed your guide
first : >ipfs init --profile=badgerds
initializing IPFS node at E:\Users\xxx.ipfs
Error: ipfs configuration file already exists!
Reinitializing would overwrite your keys.

so i delete ~/.ipfs , start it over

ipfs init --profile=badgerds
initializing IPFS node at E:\Users\xxx.ipfs
generating 2048-bit RSA keypair…done
Error: Unable to mmap RDWR log file: MapViewOfFile: The parameter is incorrect.

what’s wrong ? could you help?

OS: Microsoft Windows Pro 1709 [Version 10.0.16299.371]
ipfs version 0.4.15

It sounds like a permissions issue. Are you able to manually create a file in the .ipfs directory in your user folder?

manually creat a new file is ok , here is content of .ipfs after execute “ipfs init --profile=badgerds”

it seems ti had used badgerds ,when execute " ipfs daemon" , come out the same error .

Are you sure that’s a fresh ipfs repo? Your screenshot shows that it’s 2 GB. A fresh IPFS repo should be <100 kB.

FWIW I can’t recreate the error or the abnormally large repository size you’re getting on my Windows 10 install with v0.4.15.

Where did you download IPFS from?

i delete .ipfs directory ,start it over again. it comes out the same parameter incorrect error, and the size of badgerds is the same 2GB.

a few days ago after fresh setup, in the webui i try to download a file about 40MB. after a long long time ,it never showed me the end, and in the cmd it show the “…Access is denied” error. so i closed it and the ipfs became 2GB, i don’t know why ,that’s the story.