Closed btcdevops-apps closed 2 years ago
@btcdevops-apps Options (1) and (3) are not using Helidon APIs. As for (2), have you followed the structure of this test?
https://github.com/oracle/helidon/tree/master/examples/integrations/oci/objectstorage-cdi
Note that there's two files application.yaml
and ~/helidon/conf/examples.yaml
from which configuration is read. See ObjectStorageCdiMain
. This is used to separate common from user-specific config ---the Yaml config that you included in this issue isn't formatted properly, so it's hard to provide feedback based on it.
@spericas thanks for the quick response. please see below for the yaml structure I'm using. Note: the helidon/conf/examples.yaml file used in ObjectStorageCdiMain is not available in the repository master so I'm unable to verify mine matches.
@spericas thanks for the quick response. please see below for the yaml structure I'm using. Note: the helidon/conf/examples.yaml file used in ObjectStorageCdiMain is not available in the repository master so I'm unable to verify mine matches.
Please make sure to study the example and the docs (https://helidon.io/docs/v2/#/mp/oci/02_object-storage) to understand how to use the Helidon API.
Thanks @spericas I eventually had to construct my objects manually following this example .
The helidon mp example currently seems to require the oci config in directory .oci which really seems questionable for a containerized application that should not really have a dependency on oci cli tool.
Hence the example I followed allows me to put the config file anywhere such as class path and load it at runtime.
This will make it easier for me to change the content using oke configmaps/secrets @ deployment time.
Your input was very useful and gave me insights i needed.
Environment Details
Helidon Version: 2.3.3
Helidon MP
JDK version:
openjdk version "11.0.12" 2021-07-20 OpenJDK Runtime Environment GraalVM CE 21.2.0 (build 11.0.12+6-jvmci-21.2-b08) OpenJDK 64-Bit Server VM GraalVM CE 21.2.0 (build 11.0.12+6-jvmci-21.2-b08, mixed mode, sharing)
OS: OEL 8
Docker version (if applicable):
Problem Description - helidon-integrations-cdi-oci-objectstorage (bucket crud exceptions)
unable to interact with objectstorage - bucket. I am trying to upload files into an oci bucket in my tenancy. I have configured the application.yaml file
oci: objectstorage: namespace: ${tenancy.namespace} namespaceName: ${tenancy.namespace} region: ${tenancy.region} bucket: ${app.cerpsys.endvi.cloud.bucket} compartment: ${bucket.compartment.ocid} auth: fingerprint: ${user.pem.fingerprint} keyFile: ${user.pem.key.path} passphraseCharacters: ${user.pem.key.passphrase} user: ${user.ocid} tenancy: ${tenancy.ocid} compartment: ${bucket.compartment.ocid} user: ${user.ocid} fingerprint: ${user.pem.fingerprint} tenancy: ${tenancy.ocid} region: ${tenancy.region} key-pem: ${user.pem.key.path} passphraseCharacters: ${user.pem.key.passphrase} compartment: ${bucket.compartment.ocid}
Exceptions Encountered vary depending on code snippet as below:
`com.oracle.bmc.model.BmcException: (401, Unknown, false) Detailed exception information not available (opc-request-id: lhr-1:h85rkflxTcu-tfH6foCqgidpbnXbqGoey_Mbj1v5o1b-6ZTRTHCzG9a6xeumCf) at com.oracle.bmc.http.internal.ResponseHelper.throwIfNotSuccessful(ResponseHelper.java:128) at com.oracle.bmc.http.internal.ResponseConversionFunctionFactory$ValidatingParseResponseFunction.apply(ResponseConversionFunctionFactory.java:88) -----------------------------snippet below--------- //@Inject ObjectStorage ociTenancyObjectStorage; String objectName = payload.getStorageURL(); System.out.println(objectName);
``
java.util.concurrent.CompletionException: io.helidon.webclient.WebClientException: Connection reset by the host at java.base/java.util.concurrent.CompletableFuture.encodeRelay(CompletableFuture.java:367) at java.base/java.util.concurrent.CompletableFuture.completeRelay(CompletableFuture.java:376) at java.base/java.util.concurrent.CompletableFuture$UniRelay.tryFire(CompletableFuture.java:1019) --------------------------------------snippet below-------------------------------------------
com.oracle.bmc.model.BmcException: (401, Unknown, false) Detailed exception information not available (opc-request-id: lhr-1:xNJN_MPIF38c701Blzb1yyK3tShdcb77FLqSO5Nu8DiAtDq8x9xrnZaRs1rtD--B) at com.oracle.bmc.http.internal.ResponseHelper.throwIfNotSuccessful(ResponseHelper.java:128) at com.oracle.bmc.http.internal.ResponseConversionFunctionFactory$ValidatingParseResponseFunction.apply(ResponseConversionFunctionFactory.java:88) at ------------------snippet below----------------
//@Inject ObjectStorage ociTenancyObjectStorage; UploadManager uploadManager = new UploadManager(ociTenancyObjectStorage,getUploadConfiguration()); PutObjectRequest putObjectRequest = PutObjectRequest.builder() .bucketName(ociBucketName) .namespaceName(ociTenancyNamespace) .contentType(payload.getFileMimeType()) .objectName(objectName) .build(); UploadManager.UploadRequest request = UploadManager.UploadRequest .builder(MultiPartFileUtility.FileManager.getFile(payload.getOptionalDiscPath().get())) .allowOverwrite(true) .build(putObjectRequest); UploadManager.UploadResponse response = uploadManager.upload(request);
`Steps to reproduce