-
Notifications
You must be signed in to change notification settings - Fork 283
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
removeObjects did not throw an error #1181
Comments
by default the client does not have a timeout.
then for removeObject with invalid bucket, it will throw error.
if invalid/non-existent object is passed, it would always return 204 or 200 OK So it is working as expected. |
removeObjects, not removeObject. |
with removeObjects const deleteList = [
{ name: 'non-existent' },
{ name: '0.txt' },
{ name: 'does not exist object2' },
{ name: '1.txt' },
{ name: '2.txt' },
{ name: 'does not exist object1110' }
]
mc.removeObjects("test-bucket", deleteList ,(e, res) => {
if (e) {
return console.log(e)
}
console.log("Success", res)
// Note : Inspect the res to find out if an object deletion is success or failure.
}) e.g: [
{
Code: 'AccessDenied',
Message: 'Access Denied.',
Key: 'non-existent',
VersionId: ''
},
{
Code: 'AccessDenied',
Message: 'Access Denied.',
Key: '0.txt',
VersionId: ''
},
{
Code: 'AccessDenied',
Message: 'Access Denied.',
Key: 'does not exist object2',
VersionId: ''
},
{
Code: 'AccessDenied',
Message: 'Access Denied.',
Key: '1.txt',
VersionId: ''
},
{
Code: 'AccessDenied',
Message: 'Access Denied.',
Key: '2.txt',
VersionId: ''
},
{
Code: 'AccessDenied',
Message: 'Access Denied.',
Key: 'does not exist object1110',
VersionId: ''
}
]
|
We will check and send a fix for this scenario minio.js Line 1207 needs a fix like: (e) => {
if (e) {
return cb(e, null)
}
return cb(null, _.flatten(batchResults))
}, |
version:7.1.1
When the minio client is invalid, such as endPoint or port error, or even the minio service is not running, calling this API will not throw an error. I haven't checked other APIs for the time being. I hope the bug can be fixed in time.
case:
`var Minio = require('minio')
var minioClient = new Minio.Client({
endPoint: '192.168.128.109', // Any invalid IP
port: 9000,
useSSL: true,
accessKey: 'Q3AM3UQ867SPQQA43P2F',
secretKey: 'zuf+tfteSlswRu7BJ86wekitnifILbZam1KYY3TG'
})
minioClient.removeObjects(bucket, target, (e) => {
if (e) {
return console.log('Unable to remove Objects ', e)
}
console.log('Removed the objects successfully')
})`
The text was updated successfully, but these errors were encountered: