Why am I getting a NULL error during a connection test with the S3 bucket?

It was working for me in version 4.2.2 but stopped working after upgrading

Until 4.2.2, S3 was supported via JCloud library

From 4.3.0 onwards S3 is supported via JetS3t library

During the initial restart of Artifactory with the S3 provider, there is a process of checking the connection with the bucket which includes uploading a test blob, downloading it, and then deleting it.

For various S3 internal providers this process might fail even though the bucket exists. The logs will show a failure in the process during the PUT request of the test blob:

        [art-init] [DEBUG] (o.a.a.f.t.j.s.S3JetS3tBinaryProvider:236) – Starting to add item ’78ea69964989af6fd7953bab4358d892163fc006′ bucket ‘mybucket’ to s3

        [art-init] [ERROR] (o.a.a.f.t.j.s.S3JetS3tBinaryProvider:253) – null

By default, JetS3 always incorporates bucket names that are DNS-compatible into the host name of its requests. For example, a request directed at the bucket named “mybucket” will be sent to the host name like this: ‘mybucket.s3.amazonaws.com

On the other hand, JCloud uses the following convention when sending requests to the bucket: http://s3.amazonaws.com/mybucket‘.

It might be that the convention of the provider you are using (which explains why it was working on 4.2.2) is the latter. In this case, you will need to add to your storage.properties file the following entry:

binary.provider.s3.env.s3service.disable-dns-buckets=true

(Note: This changes the convention to ‘http://s3.amazonaws.com/mybucket’)

 

Here is more on the subject from the JetS3t library.