-
Notifications
You must be signed in to change notification settings - Fork 106
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
How can I fetch file with permanent name without version in name from not versioned S3 like minio #143
Comments
You have to enable versioning |
This can be bypassed by inserting a timestamp into the filename. It would be nice to simply fetch a static filename without requiring versioning on the bucket however. |
I faced a similar problem, in reading about the s3 resource I could see that providing the regexp field in the s3 resource can be used in place of a version number by allowing the resource to identify/extract a version number from the filename. But it took me a bit to figure out how to define the regexp field properly, but as noted in the description of the regexp field, you must use a capture group in your regex so the s3 resource knows which section of your filename contains the version number. Once I setup my regexp properly, the system pulled the version number from my filename and I stopped getting the error about from s3resource.Version about the missing versionid field and was able to fetch my permanently named file with no version metadata from my minio server. Hope this helps. I should note, it seems to me like this issue relates to incorrect use of the regexp field and may reflect a user error, the documentation does correctly explain how to implement the regexp field so I think this issue may be able to be closed. Thanks! |
Also for reference, here is an example of my s3 resource that is working for me to pull a permanently named file from an unversioned minio bucket. Note the key part is the parentheses in the regexp, as the parentheses define a capture group, which is the part of your filename that will be extracted and used as the version number by the s3 resource:
|
I have
type: s3
source:
access_key_id: ((s3_access_key_id))
bucket: ((s3_buckets_cli))
endpoint: ((s3_endpoint))
secret_access_key: ((s3_secret_access_key))
versioned_file: bbr
I get
resource script '/opt/resource/check []' failed: exit status 1
stderr:
�[31merror finding versions: bucket is not versioned
�[0m
file is in bucket with name bbr
The text was updated successfully, but these errors were encountered: