Go to file
Clement Sam 64e5fb7772 storagenode/collector: fix error check when file does not exist
The collector calls the Delete() method on the pieces
which returns an error which is wrapped by many error classes.
Delete() method is using Stat() from
1aec831d98/storage/filestore/dir.go (L328)
under the hood.
os.IsNotExist(errors.Unwrap(err) will always be false unless
errors.Unwrap(err) is called multiple times till it gets to
the core os.ErrNotExist. Here is a test case to explain better:

    func TestABC(t *testing.T) {
	classA := errs.Class("A")
	classB := errs.Class("B")

	wrappedError := classB.Wrap(classA.Wrap(os.ErrNotExist))

	require.True(t, os.IsNotExist(errs.Unwrap(wrappedError)))
	require.True(t, os.IsNotExist(errors.Unwrap(wrappedError)))
    }

Using errs.Is() seems to resolve this even without unwrapping the error:

    func TestABC(t *testing.T) {
	classA := errs.Class("A")
	classB := errs.Class("B")

	wrappedError := classB.Wrap(classA.Wrap(os.ErrNotExist))

	require.True(t, errs.Is(wrappedError, os.ErrNotExist))
	require.False(t, errs.Is(wrappedError, os.ErrExist))
	require.False(t, os.IsNotExist(wrappedError))
    }

Does not resolve the collector issue here but enhances it:
https://github.com/storj/storj/issues/4192

Change-Id: Ifb75dd15b54c1e1a5e23f6eba2d621d64874a5cc
2022-09-02 12:26:33 +00:00
.github .github: add issue templates 2021-09-24 08:42:48 +00:00
certificate all: fix linting errors 2022-03-30 18:45:23 +03:00
cmd cmd: add command to migrate project public_ids 2022-08-31 13:14:17 +00:00
crashcollect crashcollect: removed redundant structure 2021-04-28 00:35:39 +03:00
docs docs/blueprints: add async packing 2022-04-23 06:34:17 +00:00
installer/windows storj/storj: more domain changes 2021-04-15 20:51:43 +00:00
multinode {storagenode,multinode/nodes}: use multinodeauth.Secret instead of []byte for APISecret 2022-08-23 11:04:04 +00:00
private private/testplanet: integrate GC bloom filter service 2022-09-02 11:52:45 +00:00
resources cmd: add ca-certificates to Docker images (#3986) 2020-12-08 01:38:33 +01:00
satellite private/testplanet: integrate GC bloom filter service 2022-09-02 11:52:45 +00:00
scripts satellite/gc/bloomfilter: add service to collect bloom filters 2022-09-02 08:10:46 +00:00
storage all: fix linting issues 2022-03-21 15:26:42 +00:00
storagenode storagenode/collector: fix error check when file does not exist 2022-09-02 12:26:33 +00:00
testsuite go.mod: bump clingy dependency 2022-08-31 10:24:27 +00:00
versioncontrol ci: fix lint errors 2021-05-17 13:37:31 +00:00
web web/satellite: added server-side encryption banner to buckets page 2022-09-02 09:36:18 +00:00
.dockerignore Forward-port release-alpha8 build script issues (#1726) 2019-04-09 23:01:10 -06:00
.gitattributes web/: add check for change to eslint import 2021-12-21 15:59:23 +00:00
.gitignore gitignore: add files generated by storj-up 2022-03-09 12:36:56 -06:00
.gitreview add config file for git review usage 2021-10-14 18:01:30 +00:00
CODE_OF_CONDUCT.md Adding CODE_OF_CONDUCT to storj/storj repo (#779) 2018-12-07 15:10:02 -05:00
CODEOWNERS satellite/metabase: add codeowners 2022-05-18 16:13:06 +02:00
CONTRIBUTING.md go.mod: update to minimum supported go version (#4239) 2021-10-22 21:12:13 +02:00
DEVELOPING.md Makefile: run lint locally in docker 2022-05-25 12:30:15 -05:00
docker-compose.tests.yaml Makefile: make test run more safe 2022-05-31 10:58:26 +00:00
go.mod go.mod: bump clingy dependency 2022-08-31 10:24:27 +00:00
go.sum go.mod: bump clingy dependency 2022-08-31 10:24:27 +00:00
Jenkinsfile scripts,Jenkinsfile,Makefile: upload binaries to drafted github release 2021-12-21 13:55:38 +00:00
Jenkinsfile.premerge build: fix conditional run of web builds 2022-08-11 14:34:44 +00:00
Jenkinsfile.public build: fix conditional run of web builds 2022-08-11 14:34:44 +00:00
Jenkinsfile.verify build: turn off postgres unit tests (build time test) 2022-08-22 13:18:59 +00:00
LICENSE license code with agplv3 (#126) 2018-07-05 10:24:26 -04:00
MAINTAINERS.md Maintainers: remove link 2022-03-14 14:16:31 +02:00
Makefile Makefile: bump to Go 1.17.12 2022-07-14 20:57:26 +00:00
monkit.lock satellite/{web, console}: login captcha implemented 2022-08-03 23:02:27 +00:00
proto.lock multinode/payouts: paystub extended with disposed 2021-06-01 16:28:20 +00:00
README.md Update README.md (#4320) 2021-12-22 14:12:58 +01:00

Storj V3 Network

Go Report Card Go Doc Coverage Status

Storj is building a decentralized cloud storage network. Check out our white paper for more info!


Storj is an S3-compatible platform and suite of decentralized applications that allows you to store data in a secure and decentralized manner. Your files are encrypted, broken into little pieces and stored in a global decentralized network of computers. Luckily, we also support allowing you (and only you) to retrieve those files!

Table of Contents

Contributing to Storj

All of our code for Storj v3 is open source. If anything feels off, or if you feel that some functionality is missing, please check out the contributing page. There you will find instructions for sharing your feedback, building the tool locally, and submitting pull requests to the project.

A Note about Versioning

While we are practicing semantic versioning for our client libraries such as uplink, we are not practicing semantic versioning in this repo, as we do not intend for it to be used via Go modules. We may have backwards-incompatible changes between minor and patch releases in this repo.

Start using Storj

Our wiki has documentation and tutorials. Check out these three tutorials:

License

This repository is currently licensed with the AGPLv3 license.

For code released under the AGPLv3, we request that contributors sign our Contributor License Agreement (CLA) so that we can relicense the code under Apache v2, or other licenses in the future.

Support

If you have any questions or suggestions please reach out to us on our community forum or file a ticket at https://support.storj.io/.