Error posting API to API Manager (v1.10.0) from GREG (v5.1.0) - wso2

I have followed the instructions laid out in the documentation for GREG (5.1.0) to configure GREG to publish APIs to an external API Manager (1.10.0). I followed the configuration updates (modified the LifeCycle in the configuration.xml) and promoted a REST API. Unfortunately, when I promote the API to Production I don't receive any feedback in the GREG Publisher UI, the API is not imported into API Manager, and I receive the following errors in the GREG logs:
Note: I've scrubbed these logs for potentially sensitive information.
[2016-02-01 15:33:34,432] ERROR {org.wso2.carbon.governance.registry.extensions.executors.apistore.RestServiceToAPIExecutor} - overview_name : xxxxxxxxxxxx
[2016-02-01 15:33:34,451] ERROR {org.wso2.carbon.governance.registry.extensions.executors.apistore.RestServiceToAPIExecutor} - interface_transports : https
[2016-02-01 15:33:34,454] ERROR {org.wso2.carbon.governance.registry.extensions.executors.apistore.RestServiceToAPIExecutor} - uritemplate_httpVerb : get
[2016-02-01 15:33:34,454] ERROR {org.wso2.carbon.governance.registry.extensions.executors.apistore.RestServiceToAPIExecutor} - interface_swagger : /_system/governance/apimgt/applicationdata/api-docs/1.0.0/xxxxxxxxx
[2016-02-01 15:33:34,454] ERROR {org.wso2.carbon.governance.registry.extensions.executors.apistore.RestServiceToAPIExecutor} - contacts_entry : Technical Owner: xxxxxxxxx
[2016-02-01 15:33:34,455] ERROR {org.wso2.carbon.governance.registry.extensions.executors.apistore.RestServiceToAPIExecutor} - overview_endpointURL : http://xxxxxxxx/
[2016-02-01 15:33:34,456] ERROR {org.wso2.carbon.governance.registry.extensions.executors.apistore.RestServiceToAPIExecutor} - uritemplate_authType : None
[2016-02-01 15:33:34,457] ERROR {org.wso2.carbon.governance.registry.extensions.executors.apistore.RestServiceToAPIExecutor} - overview_description : xxxxxxxxx
[2016-02-01 15:33:34,457] ERROR {org.wso2.carbon.governance.registry.extensions.executors.apistore.RestServiceToAPIExecutor} - overview_context : /xxxxxxxx/
[2016-02-01 15:33:34,457] ERROR {org.wso2.carbon.governance.registry.extensions.executors.apistore.RestServiceToAPIExecutor} - overview_version : 0.0.4
[2016-02-01 15:33:34,460] ERROR {org.wso2.carbon.governance.registry.extensions.executors.apistore.RestServiceToAPIExecutor} - uritemplate_urlPattern : /xxxxxx/{id}.xml
[2016-02-01 15:33:34,460] ERROR {org.wso2.carbon.governance.registry.extensions.executors.apistore.RestServiceToAPIExecutor} - overview_provider : admin
[2016-02-01 15:33:34,460] ERROR {org.wso2.carbon.governance.registry.extensions.executors.apistore.RestServiceToAPIExecutor} - endpoints_entry : Prod:https://xxxxxxxxxxxxxxx/xxxxxx/
[2016-02-01 15:33:34,460] ERROR {org.wso2.carbon.governance.registry.extensions.executors.apistore.RestServiceToAPIExecutor} - security_authenticationType : None
I have created a gist with the logs for both API Manager and GREG.

Related

Listing AWS S3 bucket content from Springboot With Apache Camel

I have a sprintboot project running v2.5.4 which works fine.
I have access to S3 and im able to list the content of a bucket i have created. So i wanted to experiment with Apache Camel to try to just list the content of a bucket which should be pretty simple according to the examples. But i keep getting errors.
I added 2 dependencies to my build.gradle
implementation group: 'org.apache.camel.springboot', name: 'camel-core-starter', version: '3.13.0'
implementation group: 'org.apache.camel.springboot', name: 'camel-aws2-s3-starter', version: '3.13.0'
and then i simply created a SimpleRouteBuilder.java
#Component
public class SimpleRouteBuilder extends RouteBuilder {
#Override
public void configure() throws Exception {
from("aws2-s3://bucketName?amazonS3Client=#createS3Client&operation=listObjects&accessKey=xxxAccessKeyxxx&secretKey=xxxSecretKeyxxx")
.log("Received body: ");
}
And i keep getting this stacktrace
On my aws s3 client factory i have set the bean name
#Slf4j
#Configuration
public class S3ClientBeanFactory {
#Bean(name = "s3Client")
and this seems to work - when i change the name to something else i get
an error about this :
No bean could be found in the registry for:S3Client
But with the "s3client" set in the camel endpoint url i get this all the time
2021-12-13 12:23:25.036 INFO [,,] 28267 --- [ main] o.a.c.impl.engine.AbstractCamelContext : Apache Camel 3.13.0 (camel-1) shutdown in 4ms (uptime:511ms)
2021-12-13 12:23:25.045 INFO [,,] 28267 --- [ main] o.apache.catalina.core.StandardService : Stopping service [Tomcat]
2021-12-13 12:23:25.069 INFO [,,] 28267 --- [ main] ConditionEvaluationReportLoggingListener :
Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2021-12-13 12:23:25.085 ERROR [,,] 28267 --- [ main] o.s.boot.SpringApplication : Application run failed
org.apache.camel.FailedToStartRouteException: Failed to start route route1 because of null
2021-12-13 12:23:25.036 INFO [,,] 28267 --- [ main] o.a.c.impl.engine.AbstractCamelContext : Apache Camel 3.13.0 (camel-1) shutdown in 4ms (uptime:511ms)
2021-12-13 12:23:25.045 INFO [,,] 28267 --- [ main] o.apache.catalina.core.StandardService : Stopping service [Tomcat]
2021-12-13 12:23:25.069 INFO [,,] 28267 --- [ main] ConditionEvaluationReportLoggingListener :
Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2021-12-13 12:23:25.085 ERROR [,,] 28267 --- [ main] o.s.boot.SpringApplication : Application run failed
org.apache.camel.FailedToStartRouteException: Failed to start route route1 because of null
at org.apache.camel.impl.engine.RouteService.warmUp(RouteService.java:123)
at org.apache.camel.impl.engine.InternalRouteStartupManager.doWarmUpRoutes(InternalRouteStartupManager.java:306)
at org.apache.camel.impl.engine.InternalRouteStartupManager.safelyStartRouteServices(InternalRouteStartupManager.java:189)
at org.apache.camel.impl.engine.InternalRouteStartupManager.doStartOrResumeRoutes(InternalRouteStartupManager.java:147)
at org.apache.camel.impl.engine.AbstractCamelContext.doStartCamel(AbstractCamelContext.java:3201)
at org.apache.camel.impl.engine.AbstractCamelContext.doStartContext(AbstractCamelContext.java:2863)
at org.apache.camel.impl.engine.AbstractCamelContext.doStart(AbstractCamelContext.java:2814)
at org.apache.camel.spring.boot.SpringBootCamelContext.doStart(SpringBootCamelContext.java:43)
at org.apache.camel.support.service.BaseService.start(BaseService.java:119)
at org.apache.camel.impl.engine.AbstractCamelContext.start(AbstractCamelContext.java:2510)
at org.apache.camel.impl.DefaultCamelContext.start(DefaultCamelContext.java:246)
at org.apache.camel.spring.SpringCamelContext.start(SpringCamelContext.java:119)
at org.apache.camel.spring.SpringCamelContext.onApplicationEvent(SpringCamelContext.java:151)
at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:176)
at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:169)
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:143)
at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:421)
at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:378)
at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:938)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:586)
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:145)
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:754)
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:434)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:338)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1343)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1332)
at dk.danskespil.scratchgames.ScratchgamesApplication.main(ScratchgamesApplication.java:22)
Caused by: software.amazon.awssdk.services.s3.model.S3Exception: null (Service: S3, Status Code: 403, Request ID: null, Extended Request ID: FknaUW6/yRkYvJry9d8oIWU2hC4aRk7z8ilAZZxlcDN4s+P4bAoyzWVriJxUYj2bCyzCFFMSGNY=)
Is this operation not possible or what am i missing to do such simple operation ?
I ran into the same issue with Apache Camel component aws2-s3:// which was caused by insufficient rights on AWS S3:
Caused by: software.amazon.awssdk.services.s3.model.S3Exception: null (Service: S3, Status Code: 403, ...)
But I have to mention that S3Client from Amazon SDK works well for reading files with the same rights = the same account.
Explanation: I found that this aws2-s3:// component requires making headBucket API call (and the others) which causes the error because of insufficient rights for making this api call.
Spring doesn't consider configuration beans to be special. It is possible that the route bean is created before the S3 client bean.
I'd try using the #DependsOn({"s3ClientBeanFactory"})-annotation on the route bean. More on it here: Controlling Bean Creation Order with #DependsOn Annotation

how to resolve pentaho data integration error

I am using kettele tranformation with pdi I wrote the querys with mongodb my mongodb old version 3.4 kettele transformation is well working resently updating my mongodb version 3.6 ofter updating throw error
- ERROR (version 8.0.0.0-28, build 8.0.0.0-28 from 2017-11-05 07.27.50 by buildguy) : org.pentaho.di.core.exception.KettleException:
2018/09/12 13:40:49 - MongoDB Input.0 - com.mongodb.MongoCommandException: Command failed with error 9: 'The 'cursor' option is required, except for aggregate with the explain argument' on server localhost:27017. The full response is { "ok" : 0.0, "errmsg" : "The 'cursor' option is required, except for aggregate with the explain argument", "code" : 9, "codeName" : "FailedToParse" }
2018/09/12 13:40:49 - MongoDB Input.0 - Command failed with error 9: 'The 'cursor' option is required, except for aggregate with the explain argument' on server localhost:27017. The full response is { "ok" : 0.0, "errmsg" : "The 'cursor' option is required, except for aggregate with the explain argument", "code" : 9, "codeName" : "FailedToParse" }
2018/09/12 13:40:49 - MongoDB Input.0 -
2018/09/12 13:40:49 - MongoDB Input.0 - at org.pentaho.di.trans.steps.mongodbinput.MongoDbInput.processRow(MongoDbInput.java:137)
2018/09/12 13:40:49 - MongoDB Input.0 - at org.pentaho.di.trans.step.RunThread.run(RunThread.java:62)
any one please suggest me.

AMAZON SNS import Parse Server Data as JSON

I am shifting my self-hosted parse to Amazon SNS and have followed all instructions on this link properly:
https://aws.amazon.com/blogs/mobile/migrating-from-parse-push-to-amazon-sns/
Now on step 4: Import Parse Push data when i run the java code
java -jar SNSImportTool.jar -s -f <PATH_TO_EXPORTED_PARSE_INSTALLATION_.JSON_FILE>
--apnsName <APNS_PLATFORM_APP_NAME_STEP_3.2.9>
--gcmName <GCM_PLATFORM_APP_NAME_STEP_3.2.9>
--topicName <SNS_TOPIC_NAME_STEP_3.2.10>
--awsaccess <AWS_KEY_ID_STEP_3.3>
--awssecret <SECRET_ACCESS_KEY_STEP_3.3>
i get the following output:
===========================================
Import from Parse to Amazon SNS
===========================================
Verify platform application: app/GCM/appname_MOBILEHUB_111111
Verify platform application: app/APNS/appname_MOBILEHUB_111111
Created 1 channel topics:SNS
Processing token APA91bEApdQ5PFqX77X53LZZevzw9ghwxuhvBwPu5E4Z1og1TTYTLFHv3oF5-AMszqZDfSBWCH4dn_zYK4Emx21j-30k6u0SGQ4KHbAWuuYbPCzSRm-9hvU
Could not create endpoint: Invalid parameter: PlatformApplicationArn Reason: Wrong number of slashes in relative portion of the ARN. (Service: AmazonSNS; Status Code: 400; Error Code: InvalidParameter; Request ID: 12b597de-1a46-5168-b1af-c661430db91f)
Processing token d806a7e6701df9250d8162e47b15ff78b857b285de38113d1b7f504ea92d46b5
Could not create endpoint: PlatformApplication does not exist (Service: AmazonSNS; Status Code: 404; Error Code: NotFound; Request ID: 419d4827-9238-5d46-a584-1998cb74e16e)
to clarify, for items in json that have deviceType as android i get the following error:
Invalid parameter: PlatformApplicationArn Reason: Wrong number of slashes in relative portion of the ARN
and deviceType as ios i get the following error:
Could not create endpoint: PlatformApplication does not exist
my json file looks like this:
{"results":[{ "channels" : ["SNS"], "_id" : "000f0KsszOH1", "_updated_at" : "2017-06-11T00:03:10.712+0000" , "UniqueId" : "79bb118ec2b71c3f", "appIdentifier" : "com.leApp", "parseVersion" : "1.8.0", "timeZone" : "Asia/Riyadh", "installationId" : "f05f3d8a-f045-35fe-a268-855eda3b2c78", "appVersion" : "2.2.8", "deviceType" : "ios", "_created_at" : "2015-12-15T12:49:23.954+0000", "pushType" : "gcm","deviceToken" : "APA99bEApdQ5PFqX77X53LYYevzw4ghwxuhvBwPu4C3Z1og1TTYTLFHv3oF5-AMszqZDfSBWCH4dn_zYK4Emx21j-30k6u0SGQ4KHbAWuuYbPCzSRm-9hvU", "localeIdentifier" : "en-GB" }]}
please advise how to fix these errors.

Sending email contents as HTML in WSO2 ESB

Success Email
Email SUBJECT : [ENV] Details of the message(process name)
Ex : [DEV] : WSO2 ESB INFO : XXXX_UpdatePromotionHeaderProxy Completed
DateTime :
Transaction ID :
Process Name :
File Name :
Error Email
Email SUBJECT : [ENV] Details of the message(process name)
Ex : [DEV] : WSO2 ESB ERROR : UpdatePromotionHeaderProxy FAILED
DateTime :
Transaction ID :
Process Name :
File Name :
Error Code :
Error Description :
Error Stack Trace :

WSO2 API Publisher SAML SSO login fails

I configured WSO2 API Publisher (1.10.0) SAML SSO however login fails with the following error:
TID: [-1234] [] [2016-02-10 18:33:16,643] WARN {org.wso2.carbon.identity.sso.saml.processors.SPInitSSOAuthnRequestProcessor} - Destination validation for Authentication Request failed. Received: [null]. Expected one in the list: [https://identity.mydomain.pt:443/samlsso]
File publisher/site/conf/site.json:
"ssoConfiguration" : {
"enabled" : "true",
"issuer" : "apis-publisher",
"identityProviderURL" : "https://identity.mydomain.pt:443/samlsso",
"keyStorePassword" : "wso2carbon",
"identityAlias" : "wso2carbon",
"responseSigningEnabled":"true",
"keyStoreName" :"/home/wso2/wso2am-1.10.0/repository/resources/security/wso2carbon.jks",
//"nameIdPolicy" : "urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified", //If not specified, 'urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified' will be used
},
and the service provider configuration (sso-idp-config.xml):
<!-- API MANAGER PUBLISHER -->
<ServiceProvider>
<Issuer>apis-publisher</Issuer>
<AssertionConsumerServiceURLs>
<AssertionConsumerServiceURL>https://mgt.apis.mydomain.pt:443/publisher/jagg/jaggery_acs.jag</AssertionConsumerServiceURL>
<AssertionConsumerServiceURL>https://mgt.apis.mydomain.pt/publisher/jagg/jaggery_acs.jag</AssertionConsumerServiceURL>
</AssertionConsumerServiceURLs>
<DefaultAssertionConsumerServiceURL>https://mgt.apis.mydomain.pt:443/publisher/jagg/jaggery_acs.jag</DefaultAssertionConsumerServiceURL>
<EnableSingleLogout>true</EnableSingleLogout>
<SLOResponseURL/>
<SLORequestURL/>
<SAMLDefaultSigningAlgorithmURI>http://www.w3.org/2000/09/xmldsig#rsa-sha1</SAMLDefaultSigningAlgorithmURI>
<SAMLDefaultDigestAlgorithmURI>http://www.w3.org/2000/09/xmldsig#sha1</SAMLDefaultDigestAlgorithmURI>
<SignResponse>true</SignResponse>
<ValidateSignatures>true</ValidateSignatures>
<EncryptAssertion>false</EncryptAssertion>
<CertAlias>wso2carbon</CertAlias>
<EnableAttributeProfile>false</EnableAttributeProfile>
<IncludeAttributeByDefault>false</IncludeAttributeByDefault>
<ConsumingServiceIndex/>
<EnableAudienceRestriction>false</EnableAudienceRestriction>
<AudiencesList>
<Audience>apis-publisher</Audience>
</AudiencesList>
<EnableRecipients>false</EnableRecipients>
<RecipientList>
<Recipient/>
</RecipientList>
<EnableIdPInitiatedSSO>false</EnableIdPInitiatedSSO>
<EnableIdPInitSLO>false</EnableIdPInitSLO>
<ReturnToURLList>
<ReturnToURL/>
</ReturnToURLList>
</ServiceProvider>
I did the same configuration for the API Store and login is working.
I solve my problem by turning off signatures validation.
<ValidateSignatures>false</ValidateSignatures>