Re: AWS S3 Storage Service gets 403 Forbidden

2023-08-24 Thread Ross Woolf
I just wanted to report that I resolved the issue. Having RAW was one
piece of the puzzle.
The other was I had this configuration:
uri="aws2-s3://bucket-ses-s3-receiving/?...
If you notice there is a slash on the end of receiving.  Once I
changed it to: uri="aws2-s3://bucket-ses-s3-receiving?... (along with
using RAW(myKey)) it all started working.

Thanks for your help.

On Thu, Aug 24, 2023 at 3:08 PM Andrea Cosentino  wrote:
>
> Have a look at
> https://github.com/apache/camel-examples/tree/main/examples/main
>
> Il giorno gio 24 ago 2023 alle ore 22:38 Ross Woolf  ha
> scritto:
>
> > I've never used an external file for the properties.  Can you point me
> > in the right direction?
> >
> > On Thu, Aug 24, 2023 at 2:28 PM Andrea Cosentino 
> > wrote:
> > >
> > > When this happen I usually externalize the properties in a file or I use
> > > the camel main properties to inject parameters..
> > >
> > > Il gio 24 ago 2023, 22:23 Ross Woolf  ha scritto:
> > >
> > > > 
> > > >   > > >
> > uri="aws2-s3://bucket-ses-s3-receiving/?region=us-east-1accessKey=RAW(MY_ACCESS_KEY)secretKey=RAW(MY_SECRET_KEY_WITH+)"
> > > > />
> > > >  
> > > > 
> > > >
> > > > On Thu, Aug 24, 2023 at 2:15 PM Andrea Cosentino 
> > > > wrote:
> > > > >
> > > > > Can you show the route now that you're using RAW?
> > > > >
> > > > > Il gio 24 ago 2023, 22:00 Ross Woolf  ha
> > scritto:
> > > > >
> > > > > > My secret key has a +.  I used RAW( ) on both the access and secret
> > > > > > keys, but the result is the same.  I can set a breakpoint and view
> > the
> > > > > > aws configuration object and both keys make it to the configuration
> > > > > > object as they should be.  But it fails when creating the
> > > > > > HeadBucketRequet object.
> > > > > >
> > > > > >
> > > > > > On Thu, Aug 24, 2023 at 1:23 PM Andrea Cosentino <
> > anco...@gmail.com>
> > > > > > wrote:
> > > > > > >
> > > > > > > Do you have particular characters in your key? Prefix the access
> > key
> > > > > > value
> > > > > > > with RAW() and the secret in the same way.
> > > > > > >
> > > > > > > Il gio 24 ago 2023, 21:13 Ross Woolf  ha
> > > > scritto:
> > > > > > >
> > > > > > > > I am trying to use the AWS S3 Storage Service component.  I
> > have
> > > > been
> > > > > > > > unsuccessful at getting access to the S3 bucket via the
> > > > component.  I
> > > > > > > > always get a 403 Forbidden error.  I am using Camel 3.21.0,
> > and I
> > > > have
> > > > > > > > tried both Java 11 and 17 with the same results.   I can
> > > > successfully
> > > > > > use
> > > > > > > > the AWS CLI to get files from the S3 bucket using the API and
> > the
> > > > > > > > access/secret keys, but using the same keys with the camel S3
> > > > component
> > > > > > > > always fails.
> > > > > > > >
> > > > > > > > The following is my camel route I am trying:
> > > > > > > > 
> > > > > > > > > > > > > > >
> > > > > > > >
> > > > > >
> > > >
> > uri="aws2-s3://bucket-ses-s3-receiving/?region=us-east-1accessKey=MY_ACCESS_KEYsecretKey=MY_SECRET_KEY"
> > > > > > > > />
> > > > > > > >
> > > > > > > > 
> > > > > > > >
> > > > > > > > The following is the relevant portion of the exception:
> > > > > > > > Caused by:
> > software.amazon.awssdk.services.s3.model.S3Exception:
> > > > null
> > > > > > > > (Service: S3, Status Code: 403, Request ID: TA07HFNJRF6D1FGW,
> > > > Extended
> > > > > > > > Request ID:
> > > > > > > >
> > > > > > > >
> > > > > >
> > > >
> > Oxv5vee3vzHsWe5LAvbPuu+/kzI/OKf+5pDilV4hxwFas0M8XgYR0EeuZQwrU0KRT9CN/OUlPrA=)
> > > > > > > > at
> > > > > > > >
> > > > > > > >
> > > > > >
> > > >
> > software.amazon.awssdk.protocols.xml.internal.unmarshall.AwsXmlPredicatedResponseHandler.handleErrorResponse(AwsXmlPredicatedResponseHandler.java:156)
> > > > > > > > at
> > > > > > > >
> > > > > > > >
> > > > > >
> > > >
> > software.amazon.awssdk.protocols.xml.internal.unmarshall.AwsXmlPredicatedResponseHandler.handleResponse(AwsXmlPredicatedResponseHandler.java:108)
> > > > > > > > ...
> > > > > > > >  at
> > > > > > > >
> > > > > > > >
> > > > > >
> > > >
> > software.amazon.awssdk.core.internal.handler.BaseSyncClientHandler.execute(BaseSyncClientHandler.java:76)
> > > > > > > > at
> > > > > > > >
> > > > > > > >
> > > > > >
> > > >
> > software.amazon.awssdk.core.client.handler.SdkSyncClientHandler.execute(SdkSyncClientHandler.java:45)
> > > > > > > > at
> > > > > > > >
> > > > > > > >
> > > > > >
> > > >
> > software.amazon.awssdk.awscore.client.handler.AwsSyncClientHandler.execute(AwsSyncClientHandler.java:56)
> > > > > > > > at
> > > > > > > >
> > > > > > > >
> > > > > >
> > > >
> > software.amazon.awssdk.services.s3.DefaultS3Client.headBucket(DefaultS3Client.java:5249)
> > > > > > > > at
> > > > > > > >
> > > > > > > >
> > > > > >
> > > >
> > org.apache.camel.component.aws2.s3.AWS2S3Endpoint.doStart(AWS2S3Endpoint.java:102)
> > > > > > > > at
> > > > > >
> > > >
> > org.apache.camel.support.service.BaseService.start(BaseService.java:119)
> > > > > > > > at

Re: AWS S3 Storage Service gets 403 Forbidden

2023-08-24 Thread Andrea Cosentino
Have a look at
https://github.com/apache/camel-examples/tree/main/examples/main

Il giorno gio 24 ago 2023 alle ore 22:38 Ross Woolf  ha
scritto:

> I've never used an external file for the properties.  Can you point me
> in the right direction?
>
> On Thu, Aug 24, 2023 at 2:28 PM Andrea Cosentino 
> wrote:
> >
> > When this happen I usually externalize the properties in a file or I use
> > the camel main properties to inject parameters..
> >
> > Il gio 24 ago 2023, 22:23 Ross Woolf  ha scritto:
> >
> > > 
> > >   > >
> uri="aws2-s3://bucket-ses-s3-receiving/?region=us-east-1accessKey=RAW(MY_ACCESS_KEY)secretKey=RAW(MY_SECRET_KEY_WITH+)"
> > > />
> > >  
> > > 
> > >
> > > On Thu, Aug 24, 2023 at 2:15 PM Andrea Cosentino 
> > > wrote:
> > > >
> > > > Can you show the route now that you're using RAW?
> > > >
> > > > Il gio 24 ago 2023, 22:00 Ross Woolf  ha
> scritto:
> > > >
> > > > > My secret key has a +.  I used RAW( ) on both the access and secret
> > > > > keys, but the result is the same.  I can set a breakpoint and view
> the
> > > > > aws configuration object and both keys make it to the configuration
> > > > > object as they should be.  But it fails when creating the
> > > > > HeadBucketRequet object.
> > > > >
> > > > >
> > > > > On Thu, Aug 24, 2023 at 1:23 PM Andrea Cosentino <
> anco...@gmail.com>
> > > > > wrote:
> > > > > >
> > > > > > Do you have particular characters in your key? Prefix the access
> key
> > > > > value
> > > > > > with RAW() and the secret in the same way.
> > > > > >
> > > > > > Il gio 24 ago 2023, 21:13 Ross Woolf  ha
> > > scritto:
> > > > > >
> > > > > > > I am trying to use the AWS S3 Storage Service component.  I
> have
> > > been
> > > > > > > unsuccessful at getting access to the S3 bucket via the
> > > component.  I
> > > > > > > always get a 403 Forbidden error.  I am using Camel 3.21.0,
> and I
> > > have
> > > > > > > tried both Java 11 and 17 with the same results.   I can
> > > successfully
> > > > > use
> > > > > > > the AWS CLI to get files from the S3 bucket using the API and
> the
> > > > > > > access/secret keys, but using the same keys with the camel S3
> > > component
> > > > > > > always fails.
> > > > > > >
> > > > > > > The following is my camel route I am trying:
> > > > > > > 
> > > > > > > > > > > > >
> > > > > > >
> > > > >
> > >
> uri="aws2-s3://bucket-ses-s3-receiving/?region=us-east-1accessKey=MY_ACCESS_KEYsecretKey=MY_SECRET_KEY"
> > > > > > > />
> > > > > > >
> > > > > > > 
> > > > > > >
> > > > > > > The following is the relevant portion of the exception:
> > > > > > > Caused by:
> software.amazon.awssdk.services.s3.model.S3Exception:
> > > null
> > > > > > > (Service: S3, Status Code: 403, Request ID: TA07HFNJRF6D1FGW,
> > > Extended
> > > > > > > Request ID:
> > > > > > >
> > > > > > >
> > > > >
> > >
> Oxv5vee3vzHsWe5LAvbPuu+/kzI/OKf+5pDilV4hxwFas0M8XgYR0EeuZQwrU0KRT9CN/OUlPrA=)
> > > > > > > at
> > > > > > >
> > > > > > >
> > > > >
> > >
> software.amazon.awssdk.protocols.xml.internal.unmarshall.AwsXmlPredicatedResponseHandler.handleErrorResponse(AwsXmlPredicatedResponseHandler.java:156)
> > > > > > > at
> > > > > > >
> > > > > > >
> > > > >
> > >
> software.amazon.awssdk.protocols.xml.internal.unmarshall.AwsXmlPredicatedResponseHandler.handleResponse(AwsXmlPredicatedResponseHandler.java:108)
> > > > > > > ...
> > > > > > >  at
> > > > > > >
> > > > > > >
> > > > >
> > >
> software.amazon.awssdk.core.internal.handler.BaseSyncClientHandler.execute(BaseSyncClientHandler.java:76)
> > > > > > > at
> > > > > > >
> > > > > > >
> > > > >
> > >
> software.amazon.awssdk.core.client.handler.SdkSyncClientHandler.execute(SdkSyncClientHandler.java:45)
> > > > > > > at
> > > > > > >
> > > > > > >
> > > > >
> > >
> software.amazon.awssdk.awscore.client.handler.AwsSyncClientHandler.execute(AwsSyncClientHandler.java:56)
> > > > > > > at
> > > > > > >
> > > > > > >
> > > > >
> > >
> software.amazon.awssdk.services.s3.DefaultS3Client.headBucket(DefaultS3Client.java:5249)
> > > > > > > at
> > > > > > >
> > > > > > >
> > > > >
> > >
> org.apache.camel.component.aws2.s3.AWS2S3Endpoint.doStart(AWS2S3Endpoint.java:102)
> > > > > > > at
> > > > >
> > >
> org.apache.camel.support.service.BaseService.start(BaseService.java:119)
> > > > > > > at
> > > > > > >
> > > > > > >
> > > > >
> > >
> org.apache.camel.support.service.ServiceHelper.startService(ServiceHelper.java:113)
> > > > > > > at
> > > > > > >
> > > > >
> > >
> org.apache.camel.impl.engine.RouteService.doWarmUp(RouteService.java:184)
> > > > > > > at
> > > > >
> org.apache.camel.impl.engine.RouteService.warmUp(RouteService.java:121)
> > > > > > > ... 53 more
> > > > > > >
> > > > > > > Is there more I need to provide in the aws2-s3 configuration?
> Or
> > > is
> > > > > there
> > > > > > > a bug with the way Camel implements the API, or an issue with
> the
> > > > > awssdk
> > > > > > > API itself?  I'm stuck and don't know how to figure this out.
> > > > > > > Any help is appreciated.
> 

Re: AWS S3 Storage Service gets 403 Forbidden

2023-08-24 Thread Ross Woolf
I've never used an external file for the properties.  Can you point me
in the right direction?

On Thu, Aug 24, 2023 at 2:28 PM Andrea Cosentino  wrote:
>
> When this happen I usually externalize the properties in a file or I use
> the camel main properties to inject parameters..
>
> Il gio 24 ago 2023, 22:23 Ross Woolf  ha scritto:
>
> > 
> >   > uri="aws2-s3://bucket-ses-s3-receiving/?region=us-east-1accessKey=RAW(MY_ACCESS_KEY)secretKey=RAW(MY_SECRET_KEY_WITH+)"
> > />
> >  
> > 
> >
> > On Thu, Aug 24, 2023 at 2:15 PM Andrea Cosentino 
> > wrote:
> > >
> > > Can you show the route now that you're using RAW?
> > >
> > > Il gio 24 ago 2023, 22:00 Ross Woolf  ha scritto:
> > >
> > > > My secret key has a +.  I used RAW( ) on both the access and secret
> > > > keys, but the result is the same.  I can set a breakpoint and view the
> > > > aws configuration object and both keys make it to the configuration
> > > > object as they should be.  But it fails when creating the
> > > > HeadBucketRequet object.
> > > >
> > > >
> > > > On Thu, Aug 24, 2023 at 1:23 PM Andrea Cosentino 
> > > > wrote:
> > > > >
> > > > > Do you have particular characters in your key? Prefix the access key
> > > > value
> > > > > with RAW() and the secret in the same way.
> > > > >
> > > > > Il gio 24 ago 2023, 21:13 Ross Woolf  ha
> > scritto:
> > > > >
> > > > > > I am trying to use the AWS S3 Storage Service component.  I have
> > been
> > > > > > unsuccessful at getting access to the S3 bucket via the
> > component.  I
> > > > > > always get a 403 Forbidden error.  I am using Camel 3.21.0, and I
> > have
> > > > > > tried both Java 11 and 17 with the same results.   I can
> > successfully
> > > > use
> > > > > > the AWS CLI to get files from the S3 bucket using the API and the
> > > > > > access/secret keys, but using the same keys with the camel S3
> > component
> > > > > > always fails.
> > > > > >
> > > > > > The following is my camel route I am trying:
> > > > > > 
> > > > > > > > > > >
> > > > > >
> > > >
> > uri="aws2-s3://bucket-ses-s3-receiving/?region=us-east-1accessKey=MY_ACCESS_KEYsecretKey=MY_SECRET_KEY"
> > > > > > />
> > > > > >
> > > > > > 
> > > > > >
> > > > > > The following is the relevant portion of the exception:
> > > > > > Caused by: software.amazon.awssdk.services.s3.model.S3Exception:
> > null
> > > > > > (Service: S3, Status Code: 403, Request ID: TA07HFNJRF6D1FGW,
> > Extended
> > > > > > Request ID:
> > > > > >
> > > > > >
> > > >
> > Oxv5vee3vzHsWe5LAvbPuu+/kzI/OKf+5pDilV4hxwFas0M8XgYR0EeuZQwrU0KRT9CN/OUlPrA=)
> > > > > > at
> > > > > >
> > > > > >
> > > >
> > software.amazon.awssdk.protocols.xml.internal.unmarshall.AwsXmlPredicatedResponseHandler.handleErrorResponse(AwsXmlPredicatedResponseHandler.java:156)
> > > > > > at
> > > > > >
> > > > > >
> > > >
> > software.amazon.awssdk.protocols.xml.internal.unmarshall.AwsXmlPredicatedResponseHandler.handleResponse(AwsXmlPredicatedResponseHandler.java:108)
> > > > > > ...
> > > > > >  at
> > > > > >
> > > > > >
> > > >
> > software.amazon.awssdk.core.internal.handler.BaseSyncClientHandler.execute(BaseSyncClientHandler.java:76)
> > > > > > at
> > > > > >
> > > > > >
> > > >
> > software.amazon.awssdk.core.client.handler.SdkSyncClientHandler.execute(SdkSyncClientHandler.java:45)
> > > > > > at
> > > > > >
> > > > > >
> > > >
> > software.amazon.awssdk.awscore.client.handler.AwsSyncClientHandler.execute(AwsSyncClientHandler.java:56)
> > > > > > at
> > > > > >
> > > > > >
> > > >
> > software.amazon.awssdk.services.s3.DefaultS3Client.headBucket(DefaultS3Client.java:5249)
> > > > > > at
> > > > > >
> > > > > >
> > > >
> > org.apache.camel.component.aws2.s3.AWS2S3Endpoint.doStart(AWS2S3Endpoint.java:102)
> > > > > > at
> > > >
> > org.apache.camel.support.service.BaseService.start(BaseService.java:119)
> > > > > > at
> > > > > >
> > > > > >
> > > >
> > org.apache.camel.support.service.ServiceHelper.startService(ServiceHelper.java:113)
> > > > > > at
> > > > > >
> > > >
> > org.apache.camel.impl.engine.RouteService.doWarmUp(RouteService.java:184)
> > > > > > at
> > > > org.apache.camel.impl.engine.RouteService.warmUp(RouteService.java:121)
> > > > > > ... 53 more
> > > > > >
> > > > > > Is there more I need to provide in the aws2-s3 configuration?  Or
> > is
> > > > there
> > > > > > a bug with the way Camel implements the API, or an issue with the
> > > > awssdk
> > > > > > API itself?  I'm stuck and don't know how to figure this out.
> > > > > > Any help is appreciated.
> > > > > >
> > > >
> >


Re: AWS S3 Storage Service gets 403 Forbidden

2023-08-24 Thread Andrea Cosentino
When this happen I usually externalize the properties in a file or I use
the camel main properties to inject parameters..

Il gio 24 ago 2023, 22:23 Ross Woolf  ha scritto:

> 
>   uri="aws2-s3://bucket-ses-s3-receiving/?region=us-east-1accessKey=RAW(MY_ACCESS_KEY)secretKey=RAW(MY_SECRET_KEY_WITH+)"
> />
>  
> 
>
> On Thu, Aug 24, 2023 at 2:15 PM Andrea Cosentino 
> wrote:
> >
> > Can you show the route now that you're using RAW?
> >
> > Il gio 24 ago 2023, 22:00 Ross Woolf  ha scritto:
> >
> > > My secret key has a +.  I used RAW( ) on both the access and secret
> > > keys, but the result is the same.  I can set a breakpoint and view the
> > > aws configuration object and both keys make it to the configuration
> > > object as they should be.  But it fails when creating the
> > > HeadBucketRequet object.
> > >
> > >
> > > On Thu, Aug 24, 2023 at 1:23 PM Andrea Cosentino 
> > > wrote:
> > > >
> > > > Do you have particular characters in your key? Prefix the access key
> > > value
> > > > with RAW() and the secret in the same way.
> > > >
> > > > Il gio 24 ago 2023, 21:13 Ross Woolf  ha
> scritto:
> > > >
> > > > > I am trying to use the AWS S3 Storage Service component.  I have
> been
> > > > > unsuccessful at getting access to the S3 bucket via the
> component.  I
> > > > > always get a 403 Forbidden error.  I am using Camel 3.21.0, and I
> have
> > > > > tried both Java 11 and 17 with the same results.   I can
> successfully
> > > use
> > > > > the AWS CLI to get files from the S3 bucket using the API and the
> > > > > access/secret keys, but using the same keys with the camel S3
> component
> > > > > always fails.
> > > > >
> > > > > The following is my camel route I am trying:
> > > > > 
> > > > > > > > >
> > > > >
> > >
> uri="aws2-s3://bucket-ses-s3-receiving/?region=us-east-1accessKey=MY_ACCESS_KEYsecretKey=MY_SECRET_KEY"
> > > > > />
> > > > >
> > > > > 
> > > > >
> > > > > The following is the relevant portion of the exception:
> > > > > Caused by: software.amazon.awssdk.services.s3.model.S3Exception:
> null
> > > > > (Service: S3, Status Code: 403, Request ID: TA07HFNJRF6D1FGW,
> Extended
> > > > > Request ID:
> > > > >
> > > > >
> > >
> Oxv5vee3vzHsWe5LAvbPuu+/kzI/OKf+5pDilV4hxwFas0M8XgYR0EeuZQwrU0KRT9CN/OUlPrA=)
> > > > > at
> > > > >
> > > > >
> > >
> software.amazon.awssdk.protocols.xml.internal.unmarshall.AwsXmlPredicatedResponseHandler.handleErrorResponse(AwsXmlPredicatedResponseHandler.java:156)
> > > > > at
> > > > >
> > > > >
> > >
> software.amazon.awssdk.protocols.xml.internal.unmarshall.AwsXmlPredicatedResponseHandler.handleResponse(AwsXmlPredicatedResponseHandler.java:108)
> > > > > ...
> > > > >  at
> > > > >
> > > > >
> > >
> software.amazon.awssdk.core.internal.handler.BaseSyncClientHandler.execute(BaseSyncClientHandler.java:76)
> > > > > at
> > > > >
> > > > >
> > >
> software.amazon.awssdk.core.client.handler.SdkSyncClientHandler.execute(SdkSyncClientHandler.java:45)
> > > > > at
> > > > >
> > > > >
> > >
> software.amazon.awssdk.awscore.client.handler.AwsSyncClientHandler.execute(AwsSyncClientHandler.java:56)
> > > > > at
> > > > >
> > > > >
> > >
> software.amazon.awssdk.services.s3.DefaultS3Client.headBucket(DefaultS3Client.java:5249)
> > > > > at
> > > > >
> > > > >
> > >
> org.apache.camel.component.aws2.s3.AWS2S3Endpoint.doStart(AWS2S3Endpoint.java:102)
> > > > > at
> > >
> org.apache.camel.support.service.BaseService.start(BaseService.java:119)
> > > > > at
> > > > >
> > > > >
> > >
> org.apache.camel.support.service.ServiceHelper.startService(ServiceHelper.java:113)
> > > > > at
> > > > >
> > >
> org.apache.camel.impl.engine.RouteService.doWarmUp(RouteService.java:184)
> > > > > at
> > > org.apache.camel.impl.engine.RouteService.warmUp(RouteService.java:121)
> > > > > ... 53 more
> > > > >
> > > > > Is there more I need to provide in the aws2-s3 configuration?  Or
> is
> > > there
> > > > > a bug with the way Camel implements the API, or an issue with the
> > > awssdk
> > > > > API itself?  I'm stuck and don't know how to figure this out.
> > > > > Any help is appreciated.
> > > > >
> > >
>


Re: AWS S3 Storage Service gets 403 Forbidden

2023-08-24 Thread Ross Woolf

 
 


On Thu, Aug 24, 2023 at 2:15 PM Andrea Cosentino  wrote:
>
> Can you show the route now that you're using RAW?
>
> Il gio 24 ago 2023, 22:00 Ross Woolf  ha scritto:
>
> > My secret key has a +.  I used RAW( ) on both the access and secret
> > keys, but the result is the same.  I can set a breakpoint and view the
> > aws configuration object and both keys make it to the configuration
> > object as they should be.  But it fails when creating the
> > HeadBucketRequet object.
> >
> >
> > On Thu, Aug 24, 2023 at 1:23 PM Andrea Cosentino 
> > wrote:
> > >
> > > Do you have particular characters in your key? Prefix the access key
> > value
> > > with RAW() and the secret in the same way.
> > >
> > > Il gio 24 ago 2023, 21:13 Ross Woolf  ha scritto:
> > >
> > > > I am trying to use the AWS S3 Storage Service component.  I have been
> > > > unsuccessful at getting access to the S3 bucket via the component.  I
> > > > always get a 403 Forbidden error.  I am using Camel 3.21.0, and I have
> > > > tried both Java 11 and 17 with the same results.   I can successfully
> > use
> > > > the AWS CLI to get files from the S3 bucket using the API and the
> > > > access/secret keys, but using the same keys with the camel S3 component
> > > > always fails.
> > > >
> > > > The following is my camel route I am trying:
> > > > 
> > > > > > >
> > > >
> > uri="aws2-s3://bucket-ses-s3-receiving/?region=us-east-1accessKey=MY_ACCESS_KEYsecretKey=MY_SECRET_KEY"
> > > > />
> > > >
> > > > 
> > > >
> > > > The following is the relevant portion of the exception:
> > > > Caused by: software.amazon.awssdk.services.s3.model.S3Exception: null
> > > > (Service: S3, Status Code: 403, Request ID: TA07HFNJRF6D1FGW, Extended
> > > > Request ID:
> > > >
> > > >
> > Oxv5vee3vzHsWe5LAvbPuu+/kzI/OKf+5pDilV4hxwFas0M8XgYR0EeuZQwrU0KRT9CN/OUlPrA=)
> > > > at
> > > >
> > > >
> > software.amazon.awssdk.protocols.xml.internal.unmarshall.AwsXmlPredicatedResponseHandler.handleErrorResponse(AwsXmlPredicatedResponseHandler.java:156)
> > > > at
> > > >
> > > >
> > software.amazon.awssdk.protocols.xml.internal.unmarshall.AwsXmlPredicatedResponseHandler.handleResponse(AwsXmlPredicatedResponseHandler.java:108)
> > > > ...
> > > >  at
> > > >
> > > >
> > software.amazon.awssdk.core.internal.handler.BaseSyncClientHandler.execute(BaseSyncClientHandler.java:76)
> > > > at
> > > >
> > > >
> > software.amazon.awssdk.core.client.handler.SdkSyncClientHandler.execute(SdkSyncClientHandler.java:45)
> > > > at
> > > >
> > > >
> > software.amazon.awssdk.awscore.client.handler.AwsSyncClientHandler.execute(AwsSyncClientHandler.java:56)
> > > > at
> > > >
> > > >
> > software.amazon.awssdk.services.s3.DefaultS3Client.headBucket(DefaultS3Client.java:5249)
> > > > at
> > > >
> > > >
> > org.apache.camel.component.aws2.s3.AWS2S3Endpoint.doStart(AWS2S3Endpoint.java:102)
> > > > at
> > org.apache.camel.support.service.BaseService.start(BaseService.java:119)
> > > > at
> > > >
> > > >
> > org.apache.camel.support.service.ServiceHelper.startService(ServiceHelper.java:113)
> > > > at
> > > >
> > org.apache.camel.impl.engine.RouteService.doWarmUp(RouteService.java:184)
> > > > at
> > org.apache.camel.impl.engine.RouteService.warmUp(RouteService.java:121)
> > > > ... 53 more
> > > >
> > > > Is there more I need to provide in the aws2-s3 configuration?  Or is
> > there
> > > > a bug with the way Camel implements the API, or an issue with the
> > awssdk
> > > > API itself?  I'm stuck and don't know how to figure this out.
> > > > Any help is appreciated.
> > > >
> >


Re: AWS S3 Storage Service gets 403 Forbidden

2023-08-24 Thread Andrea Cosentino
Can you show the route now that you're using RAW?

Il gio 24 ago 2023, 22:00 Ross Woolf  ha scritto:

> My secret key has a +.  I used RAW( ) on both the access and secret
> keys, but the result is the same.  I can set a breakpoint and view the
> aws configuration object and both keys make it to the configuration
> object as they should be.  But it fails when creating the
> HeadBucketRequet object.
>
>
> On Thu, Aug 24, 2023 at 1:23 PM Andrea Cosentino 
> wrote:
> >
> > Do you have particular characters in your key? Prefix the access key
> value
> > with RAW() and the secret in the same way.
> >
> > Il gio 24 ago 2023, 21:13 Ross Woolf  ha scritto:
> >
> > > I am trying to use the AWS S3 Storage Service component.  I have been
> > > unsuccessful at getting access to the S3 bucket via the component.  I
> > > always get a 403 Forbidden error.  I am using Camel 3.21.0, and I have
> > > tried both Java 11 and 17 with the same results.   I can successfully
> use
> > > the AWS CLI to get files from the S3 bucket using the API and the
> > > access/secret keys, but using the same keys with the camel S3 component
> > > always fails.
> > >
> > > The following is my camel route I am trying:
> > > 
> > > > >
> > >
> uri="aws2-s3://bucket-ses-s3-receiving/?region=us-east-1accessKey=MY_ACCESS_KEYsecretKey=MY_SECRET_KEY"
> > > />
> > >
> > > 
> > >
> > > The following is the relevant portion of the exception:
> > > Caused by: software.amazon.awssdk.services.s3.model.S3Exception: null
> > > (Service: S3, Status Code: 403, Request ID: TA07HFNJRF6D1FGW, Extended
> > > Request ID:
> > >
> > >
> Oxv5vee3vzHsWe5LAvbPuu+/kzI/OKf+5pDilV4hxwFas0M8XgYR0EeuZQwrU0KRT9CN/OUlPrA=)
> > > at
> > >
> > >
> software.amazon.awssdk.protocols.xml.internal.unmarshall.AwsXmlPredicatedResponseHandler.handleErrorResponse(AwsXmlPredicatedResponseHandler.java:156)
> > > at
> > >
> > >
> software.amazon.awssdk.protocols.xml.internal.unmarshall.AwsXmlPredicatedResponseHandler.handleResponse(AwsXmlPredicatedResponseHandler.java:108)
> > > ...
> > >  at
> > >
> > >
> software.amazon.awssdk.core.internal.handler.BaseSyncClientHandler.execute(BaseSyncClientHandler.java:76)
> > > at
> > >
> > >
> software.amazon.awssdk.core.client.handler.SdkSyncClientHandler.execute(SdkSyncClientHandler.java:45)
> > > at
> > >
> > >
> software.amazon.awssdk.awscore.client.handler.AwsSyncClientHandler.execute(AwsSyncClientHandler.java:56)
> > > at
> > >
> > >
> software.amazon.awssdk.services.s3.DefaultS3Client.headBucket(DefaultS3Client.java:5249)
> > > at
> > >
> > >
> org.apache.camel.component.aws2.s3.AWS2S3Endpoint.doStart(AWS2S3Endpoint.java:102)
> > > at
> org.apache.camel.support.service.BaseService.start(BaseService.java:119)
> > > at
> > >
> > >
> org.apache.camel.support.service.ServiceHelper.startService(ServiceHelper.java:113)
> > > at
> > >
> org.apache.camel.impl.engine.RouteService.doWarmUp(RouteService.java:184)
> > > at
> org.apache.camel.impl.engine.RouteService.warmUp(RouteService.java:121)
> > > ... 53 more
> > >
> > > Is there more I need to provide in the aws2-s3 configuration?  Or is
> there
> > > a bug with the way Camel implements the API, or an issue with the
> awssdk
> > > API itself?  I'm stuck and don't know how to figure this out.
> > > Any help is appreciated.
> > >
>


Re: AWS S3 Storage Service gets 403 Forbidden

2023-08-24 Thread Ross Woolf
My secret key has a +.  I used RAW( ) on both the access and secret
keys, but the result is the same.  I can set a breakpoint and view the
aws configuration object and both keys make it to the configuration
object as they should be.  But it fails when creating the
HeadBucketRequet object.


On Thu, Aug 24, 2023 at 1:23 PM Andrea Cosentino  wrote:
>
> Do you have particular characters in your key? Prefix the access key value
> with RAW() and the secret in the same way.
>
> Il gio 24 ago 2023, 21:13 Ross Woolf  ha scritto:
>
> > I am trying to use the AWS S3 Storage Service component.  I have been
> > unsuccessful at getting access to the S3 bucket via the component.  I
> > always get a 403 Forbidden error.  I am using Camel 3.21.0, and I have
> > tried both Java 11 and 17 with the same results.   I can successfully use
> > the AWS CLI to get files from the S3 bucket using the API and the
> > access/secret keys, but using the same keys with the camel S3 component
> > always fails.
> >
> > The following is my camel route I am trying:
> > 
> > >
> > uri="aws2-s3://bucket-ses-s3-receiving/?region=us-east-1accessKey=MY_ACCESS_KEYsecretKey=MY_SECRET_KEY"
> > />
> >
> > 
> >
> > The following is the relevant portion of the exception:
> > Caused by: software.amazon.awssdk.services.s3.model.S3Exception: null
> > (Service: S3, Status Code: 403, Request ID: TA07HFNJRF6D1FGW, Extended
> > Request ID:
> >
> > Oxv5vee3vzHsWe5LAvbPuu+/kzI/OKf+5pDilV4hxwFas0M8XgYR0EeuZQwrU0KRT9CN/OUlPrA=)
> > at
> >
> > software.amazon.awssdk.protocols.xml.internal.unmarshall.AwsXmlPredicatedResponseHandler.handleErrorResponse(AwsXmlPredicatedResponseHandler.java:156)
> > at
> >
> > software.amazon.awssdk.protocols.xml.internal.unmarshall.AwsXmlPredicatedResponseHandler.handleResponse(AwsXmlPredicatedResponseHandler.java:108)
> > ...
> >  at
> >
> > software.amazon.awssdk.core.internal.handler.BaseSyncClientHandler.execute(BaseSyncClientHandler.java:76)
> > at
> >
> > software.amazon.awssdk.core.client.handler.SdkSyncClientHandler.execute(SdkSyncClientHandler.java:45)
> > at
> >
> > software.amazon.awssdk.awscore.client.handler.AwsSyncClientHandler.execute(AwsSyncClientHandler.java:56)
> > at
> >
> > software.amazon.awssdk.services.s3.DefaultS3Client.headBucket(DefaultS3Client.java:5249)
> > at
> >
> > org.apache.camel.component.aws2.s3.AWS2S3Endpoint.doStart(AWS2S3Endpoint.java:102)
> > at org.apache.camel.support.service.BaseService.start(BaseService.java:119)
> > at
> >
> > org.apache.camel.support.service.ServiceHelper.startService(ServiceHelper.java:113)
> > at
> > org.apache.camel.impl.engine.RouteService.doWarmUp(RouteService.java:184)
> > at org.apache.camel.impl.engine.RouteService.warmUp(RouteService.java:121)
> > ... 53 more
> >
> > Is there more I need to provide in the aws2-s3 configuration?  Or is there
> > a bug with the way Camel implements the API, or an issue with the awssdk
> > API itself?  I'm stuck and don't know how to figure this out.
> > Any help is appreciated.
> >


Re: AWS S3 Storage Service gets 403 Forbidden

2023-08-24 Thread Andrea Cosentino
Do you have particular characters in your key? Prefix the access key value
with RAW() and the secret in the same way.

Il gio 24 ago 2023, 21:13 Ross Woolf  ha scritto:

> I am trying to use the AWS S3 Storage Service component.  I have been
> unsuccessful at getting access to the S3 bucket via the component.  I
> always get a 403 Forbidden error.  I am using Camel 3.21.0, and I have
> tried both Java 11 and 17 with the same results.   I can successfully use
> the AWS CLI to get files from the S3 bucket using the API and the
> access/secret keys, but using the same keys with the camel S3 component
> always fails.
>
> The following is my camel route I am trying:
> 
>
> uri="aws2-s3://bucket-ses-s3-receiving/?region=us-east-1accessKey=MY_ACCESS_KEYsecretKey=MY_SECRET_KEY"
> />
>
> 
>
> The following is the relevant portion of the exception:
> Caused by: software.amazon.awssdk.services.s3.model.S3Exception: null
> (Service: S3, Status Code: 403, Request ID: TA07HFNJRF6D1FGW, Extended
> Request ID:
>
> Oxv5vee3vzHsWe5LAvbPuu+/kzI/OKf+5pDilV4hxwFas0M8XgYR0EeuZQwrU0KRT9CN/OUlPrA=)
> at
>
> software.amazon.awssdk.protocols.xml.internal.unmarshall.AwsXmlPredicatedResponseHandler.handleErrorResponse(AwsXmlPredicatedResponseHandler.java:156)
> at
>
> software.amazon.awssdk.protocols.xml.internal.unmarshall.AwsXmlPredicatedResponseHandler.handleResponse(AwsXmlPredicatedResponseHandler.java:108)
> ...
>  at
>
> software.amazon.awssdk.core.internal.handler.BaseSyncClientHandler.execute(BaseSyncClientHandler.java:76)
> at
>
> software.amazon.awssdk.core.client.handler.SdkSyncClientHandler.execute(SdkSyncClientHandler.java:45)
> at
>
> software.amazon.awssdk.awscore.client.handler.AwsSyncClientHandler.execute(AwsSyncClientHandler.java:56)
> at
>
> software.amazon.awssdk.services.s3.DefaultS3Client.headBucket(DefaultS3Client.java:5249)
> at
>
> org.apache.camel.component.aws2.s3.AWS2S3Endpoint.doStart(AWS2S3Endpoint.java:102)
> at org.apache.camel.support.service.BaseService.start(BaseService.java:119)
> at
>
> org.apache.camel.support.service.ServiceHelper.startService(ServiceHelper.java:113)
> at
> org.apache.camel.impl.engine.RouteService.doWarmUp(RouteService.java:184)
> at org.apache.camel.impl.engine.RouteService.warmUp(RouteService.java:121)
> ... 53 more
>
> Is there more I need to provide in the aws2-s3 configuration?  Or is there
> a bug with the way Camel implements the API, or an issue with the awssdk
> API itself?  I'm stuck and don't know how to figure this out.
> Any help is appreciated.
>


AWS S3 Storage Service gets 403 Forbidden

2023-08-24 Thread Ross Woolf
I am trying to use the AWS S3 Storage Service component.  I have been
unsuccessful at getting access to the S3 bucket via the component.  I
always get a 403 Forbidden error.  I am using Camel 3.21.0, and I have
tried both Java 11 and 17 with the same results.   I can successfully use
the AWS CLI to get files from the S3 bucket using the API and the
access/secret keys, but using the same keys with the camel S3 component
always fails.

The following is my camel route I am trying:

   
   


The following is the relevant portion of the exception:
Caused by: software.amazon.awssdk.services.s3.model.S3Exception: null
(Service: S3, Status Code: 403, Request ID: TA07HFNJRF6D1FGW, Extended
Request ID:
Oxv5vee3vzHsWe5LAvbPuu+/kzI/OKf+5pDilV4hxwFas0M8XgYR0EeuZQwrU0KRT9CN/OUlPrA=)
at
software.amazon.awssdk.protocols.xml.internal.unmarshall.AwsXmlPredicatedResponseHandler.handleErrorResponse(AwsXmlPredicatedResponseHandler.java:156)
at
software.amazon.awssdk.protocols.xml.internal.unmarshall.AwsXmlPredicatedResponseHandler.handleResponse(AwsXmlPredicatedResponseHandler.java:108)
...
 at
software.amazon.awssdk.core.internal.handler.BaseSyncClientHandler.execute(BaseSyncClientHandler.java:76)
at
software.amazon.awssdk.core.client.handler.SdkSyncClientHandler.execute(SdkSyncClientHandler.java:45)
at
software.amazon.awssdk.awscore.client.handler.AwsSyncClientHandler.execute(AwsSyncClientHandler.java:56)
at
software.amazon.awssdk.services.s3.DefaultS3Client.headBucket(DefaultS3Client.java:5249)
at
org.apache.camel.component.aws2.s3.AWS2S3Endpoint.doStart(AWS2S3Endpoint.java:102)
at org.apache.camel.support.service.BaseService.start(BaseService.java:119)
at
org.apache.camel.support.service.ServiceHelper.startService(ServiceHelper.java:113)
at org.apache.camel.impl.engine.RouteService.doWarmUp(RouteService.java:184)
at org.apache.camel.impl.engine.RouteService.warmUp(RouteService.java:121)
... 53 more

Is there more I need to provide in the aws2-s3 configuration?  Or is there
a bug with the way Camel implements the API, or an issue with the awssdk
API itself?  I'm stuck and don't know how to figure this out.
Any help is appreciated.


Camel 4.0 upgrade causes SEDA Hang

2023-08-24 Thread Tim Janusz
Hi all,

We're currently trying to upgrade our Camel from 3.20.2, spring boot 2.7.12
running on Java 11 to spring.boot.version=3.1.2 and camel.version=4.0.0
running on Java 17.

We are seeing weird behaviour in one of our applications where our SEDA
component just 'hangs' after a specific set of interactions involving
dynamically adding/removing routes via the dynamicRouter feature.

Some notes:
 - We use SEDA component (where things seem to hang)
 - flow is basically:
  initialize camel,
  process msg1 to create dynamic route and process message on it,
  process msg2 which deletes route,
  process msg3 which re-creates route and processes it,
  process msg4 which deletes route,
  process msg5 which re-creates route and HANGS at this point
 - Basically the 2nd time we delete the route and re-create again (which
has the same name as before) is when we see the 'hang' for processing
(super weird)
 - This only happens in version 4.x same code works fine in 3.x

We're really wondering what could've changed between version 3.x and 4.x
that causes this now to hang?

I've included some sudo code below with log snippets to help clarify

Our main RouteBuilder creates these two
from("servlet:dialcommand")
  .routeId("dialCommandServletRoute")
  .convertBodyTo(String::class.java)
  .to("seda:dialcommandqueue?timeout=$commandTimeout")
  .removeHeader("args")


from("seda:dialcommandqueue?concurrentConsumers=$concurrentConsumerCount=$commandTimeout")
  .setExchangePattern(ExchangePattern.InOut)
  .routeId("dialcommandprocess")
  .dynamicRouter { it: Exchange -> dialDynamicRouting(it) }

Our dynamic router logic is like this:
fun dialDynamicRouting(exchange: Exchange): String? {

 // when we need to kill a route
   is KillRoute -> {
 context.routeController.stopRoute(routeId)
 context.removeRoute(routeId)

exchange.`in`.body = success("OK", exchange.`in`.getHeader("id",
String::class.java))
 return null

 // when we add a new route dynamically
val dialCommandRoute = createDialCommandRoute(routeId, contextId,
contextKey, concurrency)
// add to camel context
context.addRoutes(dialCommandRoute)
context.getRoute(routeId).properties["contextId"] = contextId
return dialCommandRoute.from

The "createDialCommandRoute" logic dynamic router created uses this type of
code
from(from)
  .routeId(routeId)
  .process {
val message = it.`in`
val body = message.body
if (body is DialCommand<*>) {
  body.id = message.getHeader("id", String::class.java) ?:
body.standardOptions.id ?: body.id
  body.configureLogContext()
}
  }.id("[$routeId] prepare command object")
  .log(LoggingLevel.INFO, "[\${headers.id}] \${body.procName}")
  .process { it: Exchange -> it.`in`.body = run(it) }
  }

With DEBUG level logging enabled we can see where it hangs is basically
right between when it would normally
process items off that newly created route.

Log Sample 1: Example logs of a valid run where it creates the new route
and start processing it
2023-08-22  INFO 54168 --- [ialcommandqueue]
c.g.dm.automation.etl.route.Operator : Route dialCommandRoute-6fddd8cf
does not exist. This command (RecoverUnfinishedOperations) will create the
route.
2023-08-22  INFO 54168 --- [ialcommandqueue]
c.g.dm.automation.etl.route.Operator : Creating route:
dialCommandRoute-6fddd8cf
2023-08-22 DEBUG 54168 --- [ialcommandqueue]
o.a.c.impl.engine.AbstractCamelContext   :
seda://dialcommand:6fddd8cf?concurrentConsumers=8=0 converted to
endpoint: seda://dialcommand:6fddd8cf?concurrentConsumers=8=0 by
component: org.apache.camel.component.seda.SedaComponent@4a23350
2023-08-22 DEBUG 54168 --- [ialcommandqueue]
o.a.c.i.e.InternalRouteStartupManager: Warming up route id:
dialCommandRoute-6fddd8cf having autoStartup=true
2023-08-22 DEBUG 54168 --- [ialcommandqueue]
o.a.c.i.e.InternalRouteStartupManager: Route: dialCommandRoute-6fddd8cf
>>> Route[seda://dialcommand:6fddd8cf?concurrentConsumers=8=0 ->
null]
2023-08-22 DEBUG 54168 --- [ialcommandqueue]
o.a.c.i.e.InternalRouteStartupManager: Starting consumer (order: 1004)
on route: dialCommandRoute-6fddd8cf
2023-08-22 DEBUG 54168 --- [ialcommandqueue]
o.a.c.i.e.BaseExecutorServiceManager : Created new ThreadPool for
source:
Consumer[seda://dialcommand:6fddd8cf?concurrentConsumers=8=0] with
name: seda://dialcommand:6fddd8cf?concurrentConsumers=8=0. ->
org.apache.camel.util.concurrent.RejectableThreadPoolExecutor@10881933[Running,
pool size = 0, active threads = 0, queued tasks = 0, completed tasks =
0][seda://dialcommand:6fddd8cf?concurrentConsumers=8=0]
2023-08-22 DEBUG 54168 --- [ialcommandqueue]
o.a.c.i.e.InternalRouteStartupManager: Route: dialCommandRoute-6fddd8cf
started and consuming from: seda://dialcommand:6fddd8cf

-- NOTE: this is where we see it now runs our route's process method on
different thread
2023-08-22  INFO 54168 --- [  e70c0565-main] 

Bind multipart data to attachments using Servlet on Undertow/Spring Boot

2023-08-24 Thread Souheil Allaoui
Hi community,

I can not get the servlet option 'attachmentMultipartBinding=true'
to work in combination with the Undertow embedded server in
Spring Boot.

When sending HTTP multipart/form-data requests to a Servlet endpoint
configured with the option attachmentMultipartBinding=true, the
different parts of the request should be bound the Camel Exchange as
attachments. This does not work when running the route in Spring Boot
with the Undertow embedded server. When using Tomcat/Jetty it does
work.

I have created a simple route that logs the number of attachments to
demo the problem: https://github.com/souheilallaoui/camel-file-upload.
Am I missing something here or is it a bug?

I am using Spring Boot 2.7.5 with Camel 3.18.3

Regards,
Souheil