minio / minio-dotnet Goto Github PK
View Code? Open in Web Editor NEWMinIO Client SDK for .NET
Home Page: https://docs.min.io/docs/dotnet-client-quickstart-guide.html
License: Apache License 2.0
MinIO Client SDK for .NET
Home Page: https://docs.min.io/docs/dotnet-client-quickstart-guide.html
License: Apache License 2.0
Without App.config mono build fails
/home/travis/build/minio/minio-dotnet/Minio.Client.sln (default targets) ->
(Build target) ->
/home/travis/build/minio/minio-dotnet/Minio.Client/Minio.Client.csproj (default targets) ->
/usr/lib/mono/xbuild/12.0/bin/Microsoft.Common.targets (_CopyAppConfigFile target) ->
/usr/lib/mono/xbuild/12.0/bin/Microsoft.Common.targets: error : Cannot copy /home/travis/build/minio/minio-dotnet/Minio.Client/App.config to /home/travis/build/minio/minio-dotnet/Minio.Client/bin/Release/Minio.Client.dll.config, as the source file doesn't exist.
0 Warning(s)
1 Error(s)
Time Elapsed 00:00:00.5549170
Each of these fails due to expected exception not being thrown.
[TestMethod]
[ExpectedException(typeof(RequestException))]
public void TestAclNonExistingBucket()
{
client.SetBucketAcl(bucket + "-no-exist", Acl.AuthenticatedRead);
}
[TestMethod]
[ExpectedException(typeof(RequestException))]
public void TestSetAclNotOwned()
{
standardClient.SetBucketAcl("bucket", Acl.AuthenticatedRead);
}
[TestMethod]
[ExpectedException(typeof(RequestException))]
public void TestSetAclDifferentRegion()
{
standardClient.SetBucketAcl(bucket, Acl.AuthenticatedRead);
}
[TestMethod]
[ExpectedException(typeof(RequestException))]
public void TestSetAclDifferentRegionNotOwned()
{
standardClient.SetBucketAcl("bucket", Acl.AuthenticatedRead);
}
minio-dotnet client library does not provide any example related to ACL [access control list]
I have installed minio-dotnet client library & provided it AWS and Play server credentials. I got following error.
$ vim Minio.Examples/ListBuckets.cs $ mcs /r:Minio/bin/Release/Minio.dll Minio.Examples/ListBuckets.cs
$ mono Minio.Examples/ListBuckets.exe
Unhandled Exception:
System.InvalidOperationException: There was an error reflecting type 'Minio.Xml.ListAllMyBucketsResult'. ---> System.InvalidOperationException: Cannot serialize member 'Minio.Xml.ListAllMyBucketsResult.Buckets' of type 'System.Collections.Generic.IReadOnlyCollection`1[[Minio.Xml.Bucket, Minio, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]]', see inner exception for more details. ---> System.NotSupportedException: Cannot serialize member Minio.Xml.ListAllMyBucketsResult.Buckets of type System.Collections.Generic.IReadOnlyCollection`1[[Minio.Xml.Bucket, Minio, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]] because it is an interface.
--- End of inner exception stack trace ---
at System.Xml.Serialization.StructModel.CheckSupportedMember (System.Xml.Serialization.TypeDesc typeDesc, System.Reflection.MemberInfo member, System.Type type) <0x41b25020 + 0x00273> in <filename unknown>:0
at System.Xml.Serialization.StructModel.GetPropertyModel (System.Reflection.PropertyInfo propertyInfo) <0x41b24e20 + 0x000ef> in <filename unknown>:0
at System.Xml.Serialization.StructModel.GetFieldModel (System.Reflection.MemberInfo memberInfo) <0x41b24ca0 + 0x000df> in <filename unknown>:0
at System.Xml.Serialization.XmlReflectionImporter.InitializeStructMembers (System.Xml.Serialization.StructMapping mapping, System.Xml.Serialization.StructModel model, Boolean openModel, System.String typeName, System.Xml.Serialization.RecursionLimiter limiter) <0x41b23000 + 0x00943> in <filename unknown>:0
at System.Xml.Serialization.XmlReflectionImporter.ImportStructLikeMapping (System.Xml.Serialization.StructModel model, System.String ns, Boolean openModel, System.Xml.Serialization.XmlAttributes a, System.Xml.Serialization.RecursionLimiter limiter) <0x41b20620 + 0x003db> in <filename unknown>:0
at System.Xml.Serialization.XmlReflectionImporter.ImportTypeMapping (System.Xml.Serialization.TypeModel model, System.String ns, ImportContext context, System.String dataType, System.Xml.Serialization.XmlAttributes a, Boolean repeats, Boolean openModel, System.Xml.Serialization.RecursionLimiter limiter) <0x41b1f6f0 + 0x0098f> in <filename unknown>:0
--- End of inner exception stack trace ---
at System.Xml.Serialization.XmlReflectionImporter.ImportTypeMapping (System.Xml.Serialization.TypeModel model, System.String ns, ImportContext context, System.String dataType, System.Xml.Serialization.XmlAttributes a, Boolean repeats, Boolean openModel, System.Xml.Serialization.RecursionLimiter limiter) <0x41b1f6f0 + 0x00ccf> in <filename unknown>:0
at System.Xml.Serialization.XmlReflectionImporter.ImportTypeMapping (System.Xml.Serialization.TypeModel model, System.String ns, ImportContext context, System.String dataType, System.Xml.Serialization.XmlAttributes a, System.Xml.Serialization.RecursionLimiter limiter) <0x41b1f680 + 0x00057> in <filename unknown>:0
at System.Xml.Serialization.XmlReflectionImporter.ImportElement (System.Xml.Serialization.TypeModel model, System.Xml.Serialization.XmlRootAttribute root, System.String defaultNamespace, System.Xml.Serialization.RecursionLimiter limiter) <0x41b1d8f0 + 0x000d7> in <filename unknown>:0
at System.Xml.Serialization.XmlReflectionImporter.ImportTypeMapping (System.Type type, System.Xml.Serialization.XmlRootAttribute root, System.String defaultNamespace) <0x41b1adc0 + 0x0009b> in <filename unknown>:0
at System.Xml.Serialization.XmlSerializer..ctor (System.Type type, System.String defaultNamespace) <0x41b01eb0 + 0x0036f> in <filename unknown>:0
at System.Xml.Serialization.XmlSerializer..ctor (System.Type type) <0x41b01d70 + 0x00013> in <filename unknown>:0
at Minio.MinioClient.ListBuckets () <0x41a6e4a0 + 0x00183> in <filename unknown>:0
at Minio.Examples.ListBuckets.Main () <0x41a4fd50 + 0x00067> in <filename unknown>:0
[ERROR] FATAL UNHANDLED EXCEPTION: System.InvalidOperationException: There was an error reflecting type 'Minio.Xml.ListAllMyBucketsResult'. ---> System.InvalidOperationException: Cannot serialize member 'Minio.Xml.ListAllMyBucketsResult.Buckets' of type 'System.Collections.Generic.IReadOnlyCollection`1[[Minio.Xml.Bucket, Minio, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]]', see inner exception for more details. ---> System.NotSupportedException: Cannot serialize member Minio.Xml.ListAllMyBucketsResult.Buckets of type System.Collections.Generic.IReadOnlyCollection`1[[Minio.Xml.Bucket, Minio, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]] because it is an interface.
--- End of inner exception stack trace ---
at System.Xml.Serialization.StructModel.CheckSupportedMember (System.Xml.Serialization.TypeDesc typeDesc, System.Reflection.MemberInfo member, System.Type type) <0x41b25020 + 0x00273> in <filename unknown>:0
at System.Xml.Serialization.StructModel.GetPropertyModel (System.Reflection.PropertyInfo propertyInfo) <0x41b24e20 + 0x000ef> in <filename unknown>:0
at System.Xml.Serialization.StructModel.GetFieldModel (System.Reflection.MemberInfo memberInfo) <0x41b24ca0 + 0x000df> in <filename unknown>:0
at System.Xml.Serialization.XmlReflectionImporter.InitializeStructMembers (System.Xml.Serialization.StructMapping mapping, System.Xml.Serialization.StructModel model, Boolean openModel, System.String typeName, System.Xml.Serialization.RecursionLimiter limiter) <0x41b23000 + 0x00943> in <filename unknown>:0
at System.Xml.Serialization.XmlReflectionImporter.ImportStructLikeMapping (System.Xml.Serialization.StructModel model, System.String ns, Boolean openModel, System.Xml.Serialization.XmlAttributes a, System.Xml.Serialization.RecursionLimiter limiter) <0x41b20620 + 0x003db> in <filename unknown>:0
at System.Xml.Serialization.XmlReflectionImporter.ImportTypeMapping (System.Xml.Serialization.TypeModel model, System.String ns, ImportContext context, System.String dataType, System.Xml.Serialization.XmlAttributes a, Boolean repeats, Boolean openModel, System.Xml.Serialization.RecursionLimiter limiter) <0x41b1f6f0 + 0x0098f> in <filename unknown>:0
▽
* limitations under the License.
--- End of inner exception stack trace ---
at System.Xml.Serialization.XmlReflectionImporter.ImportTypeMapping (System.Xml.Serialization.TypeModel model, System.String ns, ImportContext context, System.String dataType, System.Xml.Serialization.XmlAttributes a, Boolean repeats, Boolean openModel, System.Xml.Serialization.RecursionLimiter limiter) <0x41b1f6f0 + 0x00ccf> in <filename unknown>:0
at System.Xml.Serialization.XmlReflectionImporter.ImportTypeMapping (System.Xml.Serialization.TypeModel model, System.String ns, ImportContext context, System.String dataType, System.Xml.Serialization.XmlAttributes a, System.Xml.Serialization.RecursionLimiter limiter) <0x41b1f680 + 0x00057> in <filename unknown>:0
at System.Xml.Serialization.XmlReflectionImporter.ImportElement (System.Xml.Serialization.TypeModel model, System.Xml.Serialization.XmlRootAttribute root, System.String defaultNamespace, System.Xml.Serialization.RecursionLimiter limiter) <0x41b1d8f0 + 0x000d7> in <filename unknown>:0
at System.Xml.Serialization.XmlReflectionImporter.ImportTypeMapping (System.Type type, System.Xml.Serialization.XmlRootAttribute root, System.String defaultNamespace) <0x41b1adc0 + 0x0009b> in <filename unknown>:0
at System.Xml.Serialization.XmlSerializer..ctor (System.Type type, System.String defaultNamespace) <0x41b01eb0 + 0x0036f> in <filename unknown>:0
at System.Xml.Serialization.XmlSerializer..ctor (System.Type type) <0x41b01d70 + 0x00013> in <filename unknown>:0
at Minio.MinioClient.ListBuckets () <0x41a6e4a0 + 0x00183> in <filename unknown>:0
at Minio.Examples.ListBuckets.Main () <0x41a4fd50 + 0x00067> in <filename unknown>:0
$
$ vim Minio.Examples/ListBuckets.cs
$ mcs /r:Minio/bin/Release/Minio.dll Minio.Examples/ListBuckets.cs
$ export MONO_PATH=Minio/bin/Release
$ mono Minio.Examples/ListBuckets.exe
Unhandled Exception:
System.InvalidOperationException: There was an error reflecting type 'Minio.Xml.ListAllMyBucketsResult'. ---> System.InvalidOperationException: Cannot serialize member 'Minio.Xml.ListAllMyBucketsResult.Buckets' of type 'System.Collections.Generic.IReadOnlyCollection`1[[Minio.Xml.Bucket, Minio, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]]', see inner exception for more details. ---> System.NotSupportedException: Cannot serialize member Minio.Xml.ListAllMyBucketsResult.Buckets of type System.Collections.Generic.IReadOnlyCollection`1[[Minio.Xml.Bucket, Minio, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]] because it is an interface.
--- End of inner exception stack trace ---
at System.Xml.Serialization.StructModel.CheckSupportedMember (System.Xml.Serialization.TypeDesc typeDesc, System.Reflection.MemberInfo member, System.Type type) <0x409af020 + 0x00273> in <filename unknown>:0
at System.Xml.Serialization.StructModel.GetPropertyModel (System.Reflection.PropertyInfo propertyInfo) <0x409aee20 + 0x000ef> in <filename unknown>:0
at System.Xml.Serialization.StructModel.GetFieldModel (System.Reflection.MemberInfo memberInfo) <0x409aeca0 + 0x000df> in <filename unknown>:0
at System.Xml.Serialization.XmlReflectionImporter.InitializeStructMembers (System.Xml.Serialization.StructMapping mapping, System.Xml.Serialization.StructModel model, Boolean openModel, System.String typeName, System.Xml.Serialization.RecursionLimiter limiter) <0x409ad000 + 0x00943> in <filename unknown>:0
at System.Xml.Serialization.XmlReflectionImporter.ImportStructLikeMapping (System.Xml.Serialization.StructModel model, System.String ns, Boolean openModel, System.Xml.Serialization.XmlAttributes a, System.Xml.Serialization.RecursionLimiter limiter) <0x409abc90 + 0x003db> in <filename unknown>:0
at System.Xml.Serialization.XmlReflectionImporter.ImportTypeMapping (System.Xml.Serialization.TypeModel model, System.String ns, ImportContext context, System.String dataType, System.Xml.Serialization.XmlAttributes a, Boolean repeats, Boolean openModel, System.Xml.Serialization.RecursionLimiter limiter) <0x409aad60 + 0x0098f> in <filename unknown>:0
--- End of inner exception stack trace ---
at System.Xml.Serialization.XmlReflectionImporter.ImportTypeMapping (System.Xml.Serialization.TypeModel model, System.String ns, ImportContext context, System.String dataType, System.Xml.Serialization.XmlAttributes a, Boolean repeats, Boolean openModel, System.Xml.Serialization.RecursionLimiter limiter) <0x409aad60 + 0x00ccf> in <filename unknown>:0
at System.Xml.Serialization.XmlReflectionImporter.ImportTypeMapping (System.Xml.Serialization.TypeModel model, System.String ns, ImportContext context, System.String dataType, System.Xml.Serialization.XmlAttributes a, System.Xml.Serialization.RecursionLimiter limiter) <0x409aacf0 + 0x00057> in <filename unknown>:0
at System.Xml.Serialization.XmlReflectionImporter.ImportElement (System.Xml.Serialization.TypeModel model, System.Xml.Serialization.XmlRootAttribute root, System.String defaultNamespace, System.Xml.Serialization.RecursionLimiter limiter) <0x409a8f60 + 0x000d7> in <filename unknown>:0
at System.Xml.Serialization.XmlReflectionImporter.ImportTypeMapping (System.Type type, System.Xml.Serialization.XmlRootAttribute root, System.String defaultNamespace) <0x409a6430 + 0x0009b> in <filename unknown>:0
at System.Xml.Serialization.XmlSerializer..ctor (System.Type type, System.String defaultNamespace) <0x4099ddc0 + 0x0036f> in <filename unknown>:0
at System.Xml.Serialization.XmlSerializer..ctor (System.Type type) <0x4099dc80 + 0x00013> in <filename unknown>:0
at Minio.MinioClient.ListBuckets () <0x4090cd70 + 0x00183> in <filename unknown>:0
at Minio.Examples.ListBuckets.Main () <0x408d9d50 + 0x00067> in <filename unknown>:0
[ERROR] FATAL UNHANDLED EXCEPTION: System.InvalidOperationException: There was an error reflecting type 'Minio.Xml.ListAllMyBucketsResult'. ---> System.InvalidOperationException: Cannot serialize member 'Minio.Xml.ListAllMyBucketsResult.Buckets' of type 'System.Collections.Generic.IReadOnlyCollection`1[[Minio.Xml.Bucket, Minio, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]]', see inner exception for more details. ---> System.NotSupportedException: Cannot serialize member Minio.Xml.ListAllMyBucketsResult.Buckets of type System.Collections.Generic.IReadOnlyCollection`1[[Minio.Xml.Bucket, Minio, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]] because it is an interface.
--- End of inner exception stack trace ---
at System.Xml.Serialization.StructModel.CheckSupportedMember (System.Xml.Serialization.TypeDesc typeDesc, System.Reflection.MemberInfo member, System.Type type) <0x409af020 + 0x00273> in <filename unknown>:0
at System.Xml.Serialization.StructModel.GetPropertyModel (System.Reflection.PropertyInfo propertyInfo) <0x409aee20 + 0x000ef> in <filename unknown>:0
at System.Xml.Serialization.StructModel.GetFieldModel (System.Reflection.MemberInfo memberInfo) <0x409aeca0 + 0x000df> in <filename unknown>:0
at System.Xml.Serialization.XmlReflectionImporter.InitializeStructMembers (System.Xml.Serialization.StructMapping mapping, System.Xml.Serialization.StructModel model, Boolean openModel, System.String typeName, System.Xml.Serialization.RecursionLimiter limiter) <0x409ad000 + 0x00943> in <filename unknown>:0
at System.Xml.Serialization.XmlReflectionImporter.ImportStructLikeMapping (System.Xml.Serialization.StructModel model, System.String ns, Boolean openModel, System.Xml.Serialization.XmlAttributes a, System.Xml.Serialization.RecursionLimiter limiter) <0x409abc90 + 0x003db> in <filename unknown>:0
at System.Xml.Serialization.XmlReflectionImporter.ImportTypeMapping (System.Xml.Serialization.TypeModel model, System.String ns, ImportContext context, System.String dataType, System.Xml.Serialization.XmlAttributes a, Boolean repeats, Boolean openModel, System.Xml.Serialization.RecursionLimiter limiter) <0x409aad60 + 0x0098f> in <filename unknown>:0
▽
--- End of inner exception stack trace ---
at System.Xml.Serialization.XmlReflectionImporter.ImportTypeMapping (System.Xml.Serialization.TypeModel model, System.String ns, ImportContext context, System.String dataType, System.Xml.Serialization.XmlAttributes a, Boolean repeats, Boolean openModel, System.Xml.Serialization.RecursionLimiter limiter) <0x409aad60 + 0x00ccf> in <filename unknown>:0
at System.Xml.Serialization.XmlReflectionImporter.ImportTypeMapping (System.Xml.Serialization.TypeModel model, System.String ns, ImportContext context, System.String dataType, System.Xml.Serialization.XmlAttributes a, System.Xml.Serialization.RecursionLimiter limiter) <0x409aacf0 + 0x00057> in <filename unknown>:0
at System.Xml.Serialization.XmlReflectionImporter.ImportElement (System.Xml.Serialization.TypeModel model, System.Xml.Serialization.XmlRootAttribute root, System.String defaultNamespace, System.Xml.Serialization.RecursionLimiter limiter) <0x409a8f60 + 0x000d7> in <filename unknown>:0
at System.Xml.Serialization.XmlReflectionImporter.ImportTypeMapping (System.Type type, System.Xml.Serialization.XmlRootAttribute root, System.String defaultNamespace) <0x409a6430 + 0x0009b> in <filename unknown>:0
▽
at System.Xml.Serialization.XmlSerializer..ctor (System.Type type, System.String defaultName
▽
using System.IO;
space) <0x4099ddc0 + 0x0036f> in <filename unknown>:0
at System.Xml.Serialization.XmlSerializer..ctor (System.Type type) <0x4099dc80 + 0x00013> in <filename unknown>:0
at Minio.MinioClient.ListBuckets () <0x4090cd70 + 0x00183> in <filename unknown>:0
at Minio.Examples.ListBuckets.Main () <0x408d9d50 + 0x00067> in <filename unknown>:0
For example in Golang in PresignedGetObject
func (a API) PresignedGetObject(bucket, object string, expires time.Duration) (string, error) {
Expires argument is time.Duration which is a native type under Golang ecosystem, we should make sure that wherever possible we should take native types.
https://github.com/minio/minio-dotnet/blob/master/Minio.Client/ObjectStorageClient.cs#L541
Without part-number-marker we won't be able to list beyond 1000 entries
[TestMethod]
[ExpectedException(typeof(InputSizeMismatchError))]
public void PutSmallObjectTooSmall()
{
byte[] data = System.Text.Encoding.UTF8.GetBytes("hello world");
client.PutObject(bucket, "toosmall", 10, "application/octet-stream", new MemoryStream(data));
}
https://github.com/minio/minio-dotnet/blob/master/Minio.Client/ObjectStorageClient.cs#L263
Handle the case where un-authenticated requests haveTemporaryRedirect with no parseable error respone, unless ParseError already handles non xml response bodies internally.
For example, instead of returning RequestException, return BucketNotFoundException : RequestException.
[java] DEBUG [org.apache.http.headers] >> Expect: 100-continue
[java] DEBUG [org.apache.http.wire] << "HTTP/1.1 100 Continue[\r][\n]"
[java] DEBUG [org.apache.http.wire] << "[\r][\n]"
[java] DEBUG [org.apache.http.impl.conn.DefaultClientConnection] Receiving response: HTTP/1.1 100 Continue
[java] DEBUG [org.apache.http.headers] << HTTP/1.1 100 Continue
https://github.com/minio/minio-dotnet/blob/master/Minio.Client/ObjectStorageClient.cs#L414 - would fail unless .Net magically strips them off during ValueToString()
Build succeeded.
Warnings:
/home/harsha/repos/minio-dotnet/Minio.sln (default targets) ->
(Build target) ->
/home/harsha/repos/minio-dotnet/Minio/Minio.csproj (default targets) ->
/usr/lib/mono/xbuild/12.0/bin/Microsoft.Common.targets (ResolveAssemblyReferences target) ->
/usr/lib/mono/xbuild/12.0/bin/Microsoft.Common.targets: warning : Reference 'System.Data.DataSetExtensions' not resolved
/usr/lib/mono/xbuild/12.0/bin/Microsoft.Common.targets: warning : Reference 'System.Data' not resolved
/home/harsha/repos/minio-dotnet/Minio.sln (default targets) ->
(Build target) ->
/home/harsha/repos/minio-dotnet/Minio.Examples/Minio.Examples.csproj (default targets) ->
/usr/lib/mono/xbuild/12.0/bin/Microsoft.Common.targets (ResolveAssemblyReferences target) ->
/usr/lib/mono/xbuild/12.0/bin/Microsoft.Common.targets: warning : Reference 'System.Linq' not resolved
/usr/lib/mono/xbuild/12.0/bin/Microsoft.Common.targets: warning : Reference 'System.Threading.Tasks' not resolved
/usr/lib/mono/xbuild/12.0/bin/Microsoft.Common.targets: warning : Reference 'System.Data.DataSetExtensions' not resolved
/usr/lib/mono/xbuild/12.0/bin/Microsoft.Common.targets: warning : Reference 'System.Data' not resolved
6 Warning(s)
0 Error(s)
Time Elapsed 00:00:00.3835680
Tool /usr/lib/mono/4.5/mcs.exe execution started with arguments: /noconfig /debug:pdbonly /optimize+ /out:obj/Release/Minio.Client.dll Acl.cs Errors/ConnectionException.cs Errors/AccessDeniedException.cs Errors/MethodNotAllowedException.cs Errors/ForbiddenException.cs Errors/InternalServerException.cs Errors/RedirectionException.cs Errors/ObjectNotFoundException.cs Errors/ObjectExistsException.cs Errors/MaxBucketsReachedException.cs Errors/InvalidRangeException.cs Errors/InvalidKeyNameException.cs Errors/InvalidBucketNameException.cs Errors/InvalidAclNameException.cs Errors/InternalClientException.cs Errors/BucketNotFoundException.cs Errors/BucketExistsException.cs Errors/DataSizeMismatchException.cs ItemEnumerable.cs Regions.cs Errors/ClientException.cs Xml/AccessControlPolicy.cs Xml/Bucket.cs Errors/ErrorResponse.cs ObjectStorageClient.cs ObjectStat.cs Properties/AssemblyInfo.cs V4Authenticator.cs Xml/CreateBucketConfiguration.cs Xml/Grant.cs Xml/GranteeUser.cs Xml/InitiateMultipartUploadResult.cs Xml/Item.cs Xml/ListAllMyBucketsResult.cs Xml/ListBucketResult.cs Xml/ListMultipartUploadsResult.cs Xml/ListPartsResult.cs Xml/Part.cs Xml/Prefix.cs Xml/Upload.cs obj/Release/.NETFramework,Version=v4.5.AssemblyAttribute.cs /target:library /define:TRACE /nostdlib /reference:../packages/RestSharp.105.1.0/lib/net45/RestSharp.dll /reference:/usr/lib/mono/4.5/System.dll /reference:/usr/lib/mono/4.5/System.Xml.Linq.dll /reference:/usr/lib/mono/4.5/System.Data.DataSetExtensions.dll /reference:/usr/lib/mono/4.5/Microsoft.CSharp.dll /reference:/usr/lib/mono/4.5/System.Data.dll /reference:/usr/lib/mono/4.5/System.Xml.dll /reference:/usr/lib/mono/4.5/System.Core.dll /reference:/usr/lib/mono/4.5/mscorlib.dll /warn:4
CSC: error CS2001: Source file `Errors/ConnectionException.cs' could not be found
CSC: error CS2001: Source file `Errors/AccessDeniedException.cs' could not be found
CSC: error CS2001: Source file `Errors/MethodNotAllowedException.cs' could not be found
CSC: error CS2001: Source file `Errors/ForbiddenException.cs' could not be found
CSC: error CS2001: Source file `Errors/InternalServerException.cs' could not be found
CSC: error CS2001: Source file `Errors/RedirectionException.cs' could not be found
CSC: error CS2001: Source file `Errors/ObjectNotFoundException.cs' could not be found
CSC: error CS2001: Source file `Errors/ObjectExistsException.cs' could not be found
CSC: error CS2001: Source file `Errors/MaxBucketsReachedException.cs' could not be found
CSC: error CS2001: Source file `Errors/InvalidRangeException.cs' could not be found
CSC: error CS2001: Source file `Errors/InvalidKeyNameException.cs' could not be found
CSC: error CS2001: Source file `Errors/InvalidBucketNameException.cs' could not be found
CSC: error CS2001: Source file `Errors/InvalidAclNameException.cs' could not be found
CSC: error CS2001: Source file `Errors/InternalClientException.cs' could not be found
CSC: error CS2001: Source file `Errors/BucketNotFoundException.cs' could not be found
CSC: error CS2001: Source file `Errors/BucketExistsException.cs' could not be found
CSC: error CS2001: Source file `Errors/DataSizeMismatchException.cs' could not be found
CSC: error CS2001: Source file `Errors/ClientException.cs' could not be found
CSC: error CS2001: Source file `Xml/AccessControlPolicy.cs' could not be found
CSC: error CS2001: Source file `Xml/Bucket.cs' could not be found
CSC: error CS2001: Source file `Errors/ErrorResponse.cs' could not be found
CSC: error CS2001: Source file `Xml/CreateBucketConfiguration.cs' could not be found
CSC: error CS2001: Source file `Xml/Grant.cs' could not be found
CSC: error CS2001: Source file `Xml/GranteeUser.cs' could not be found
CSC: error CS2001: Source file `Xml/InitiateMultipartUploadResult.cs' could not be found
CSC: error CS2001: Source file `Xml/Item.cs' could not be found
CSC: error CS2001: Source file `Xml/ListAllMyBucketsResult.cs' could not be found
CSC: error CS2001: Source file `Xml/ListBucketResult.cs' could not be found
CSC: error CS2001: Source file `Xml/ListMultipartUploadsResult.cs' could not be found
CSC: error CS2001: Source file `Xml/ListPartsResult.cs' could not be found
CSC: error CS2001: Source file `Xml/Part.cs' could not be found
CSC: error CS2001: Source file `Xml/Prefix.cs' could not be found
CSC: error CS2001: Source file `Xml/Upload.cs' could not be found
For reference implementation and tests look at github.com/minio/minio-go
Authorization
Content-Type
Content-Length
User-Agent
Inner Exception: {"Invalid acl value."}
[TestMethod]
public void PutSmallFileWithQuestionMark()
{
string filePath = "..\\..\\..\\README.md";
FileInfo fileInfo = new FileInfo(filePath);
FileStream file = File.OpenRead(filePath);
client.PutObject(bucket, "small/ob?ject", fileInfo.Length, "text/plain", file);
}
Concatenation happens on the hexadecimally encoded md5's of individual parts on the server side during completemultipart upload.
Verify them and throw appropriate error.
I am running GetObject example from minio-dotnet client library & getting these issues. Both bucket and object exists on play server
$ mc ls play/kline/
[2016-03-22 21:03:54 IST] 13B hello.txt
Configuration file:
var client = new MinioClient("https://play.minio.io:9000", "Q3AM3UQ867SPQQA43P2F", "zuf+tfteSlswRu7BJ86wekitnifILbZam1KYY3TG");
$ mono Minio.Examples/GetObject.exe
<?xml version="1.0" encoding="UTF-8"?>
<Error><Code>InternalError</Code><Message>We encountered an internal error, please try again.</Message><Key></Key><BucketName></BucketName><Resource>/kline/hello.txt</Resource><RequestId>3L137</RequestId><HostId>3L137</HostId></Error>
Unhandled Exception:
Unsuccessful response from server without XML error: InternalServerError: Minio.Errors.InternalClientException: Unsuccessful response from server without XML error: InternalServerError
at Minio.MinioClient.ParseError (IRestResponse response) <0x41062000 + 0x00dbf> in <filename unknown>:0
at Minio.MinioClient.GetObject (System.String bucketName, System.String objectName, System.Action`1 callback) <0x40fbcc40 + 0x000eb> in <filename unknown>:0
at Minio.Examples.GetObject.Main () <0x40f9ed50 + 0x000ef> in <filename unknown>:0
[ERROR] FATAL UNHANDLED EXCEPTION: Unsuccessful response from server without XML error: InternalServerError: Minio.Errors.InternalClientException: Unsuccessful response from server without XML error: InternalServerError
at Minio.MinioClient.ParseError (IRestResponse response) <0x41062000 + 0x00dbf> in <filename unknown>:0
at Minio.MinioClient.GetObject (System.String bucketName, System.String objectName, System.Action`1 callback) <0x40fbcc40 + 0x000eb> in <filename unknown>:0
at Minio.Examples.GetObject.Main () <0x40f9ed50 + 0x000ef> in <filename unknown>:0
Build FAILED.
Warnings:
/home/travis/build/minio/minio-dotnet/Minio.Client.sln (default targets) ->
(Build target) ->
/home/travis/build/minio/minio-dotnet/Minio.Client/Minio.Client.csproj (default targets) ->
/usr/lib/mono/xbuild/12.0/bin/Microsoft.CSharp.targets (CoreCompile target) ->
Client.cs(322,50): warning CS0168: The variable `ex' is declared but never used
Client.cs(676,17): warning CS0219: The variable `queries' is assigned but its value is never used
Errors:
/home/travis/build/minio/minio-dotnet/Minio.Client.sln (default targets) ->
(Build target) ->
/home/travis/build/minio/minio-dotnet/Minio.Client/Minio.Client.csproj (default targets) ->
/usr/lib/mono/xbuild/12.0/bin/Microsoft.Common.targets (_CopyAppConfigFile target) ->
/usr/lib/mono/xbuild/12.0/bin/Microsoft.Common.targets: error : Cannot copy /home/travis/build/minio/minio-dotnet/Minio.Client/App.config to /home/travis/build/minio/minio-dotnet/Minio.Client/bin/Release/Minio.Client.dll.config, as the source file doesn't exist.
2 Warning(s)
1 Error(s)
private string SystemUserAgent = "minio-dotnet/0.0.1 (Windows 8.1; x86_64)";
private string CustomUserAgent = "";
private string FullUserAgent
{
get
{
return SystemUserAgent + " " + CustomUserAgent;
}
}
Convert the APIs to follow this style:
config := minio.Config{
AccessKeyID: "YOUR-ACCESS-KEY-HERE",
SecretAccessKey: "YOUR-PASSWORD-HERE",
}
// Default is Signature Version 4. To enable Signature Version 2 do the following.
// config.Signature = minio.SignatureV2
reader, stat, err := minio.GetObject(config, "https://s3.amazonaws.com/bucket/object") {
if err != nil {
log.Fatalln(err)
}
implement apis:
TraceOn(traceFilePath)
TraceOff()
This should trace the HTTP calls made similar to mc --debug and also should trace any useful information - like if the region is getting used from cache, region map invalidation, if during resume of putObject/fPutObject it should log if it is continuing from where it left off or reuploading etc.
In the functional tests tracing should be 'on'. We should regularly monitor the functional test log to make sure that it is printing what is expected.
I setup the minio server and client at 2 windows machines separately, start the minio server at machine-A, and try the mc.exe in another machine-B to connect it with the credential, it works as expected, like list bucket, and upload file. I tried the .net sample test to list bucket or checking if the bucket exist, always got a bad request exception. I checked the console output of minio server and it said -
time="2015-11-25T15:58:50+08:00" level=error msg="Unknown region in authorizatio
n header." Error={Invalid region *errors.errorString [{81 C:/mygo/src/github.com
/minio/minio/api-signature.go main.isValidRegion map[]} {89 C:/mygo/src/github.c
om/minio/minio/api-signature.go main.stripAccessKeyID map[]} {108 C:/mygo/src/gi
thub.com/minio/minio/api-signature.go main.initSignatureV4 map[]} {84 C:/mygo/sr
c/github.com/minio/minio/signature-handler.go main.signatureHandler.ServeHTTP ma
p[]}] map[host.os:windows host.arch:amd64 host.name:SHA2UA0151LHQ host.cpus:8 me
m.heap.total:3.0MB host.lang:go1.5.1 mem.used:2.2MB mem.total:6.1MB mem.heap.use
d:2.2MB]}
Do i miss anything? Thanks in advance.
trace output should dump xml body if available when s3 returns error.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.