-
Notifications
You must be signed in to change notification settings - Fork 277
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
all APIs erroring on POSTS to ElasticSearch #445
Comments
@animaxcg It seems like its not able to connect to the ElasticSearch endpoint. Could you please verify the es endpoint from the console and also check if you are able to reach the url . Also check the secuirty groups to make sure connections are enabled to ES . As long as you have public alb , public subnets , NAT gateways and public ip assignment enabled, it should work . |
when I do a curl from my computer I get: but when I do: curl http://esurl:80/aws/_search (what cloudwatch logs is showing error on). So even if I am missing something in networking between resources in the VPC it gives me the same error when looking at the path: url/aws/_search but no error on url. |
Looks like it give 417 untill batch job runs... maybe should batch job run once as part of deployment so you don't have wait to up to 6 hours before the the assets are found? thanks |
You can either wait or change the cron for aws- data collector jobs in clouwatch. There by you schedule the data collection job right away |
Micro services
Webapp
Setup
public ALB with public subnets (subnet has route table attachment with igw attached
Summary
all APIs erroring on POSTS to ElasticSearch
Reproduce steps
Deploy with public ALB login. no assest found (when looking at assets/volnerabillits cloudwatch logs all have stack traces when trying to do a http post to elasticsearch
Expected Results
The api's to work
Actual Results
assets cloudwatch logs:
<style> .cls-1 { font-size: 229.167px; }2020-06-17T17:59:52.242-05:00
com.zaxxer.hikari.HikariDataSource.getConnection - HikariPool-1 - Start completed.
17-06-2020 23:00:07.536 [http-nio-80-exec-1] ERROR
c.t.p.api.commons.utils.PacHttpUtils.doHttpPost - URL: http://somedomain.us-east-1.es.amazonaws.com:80/aws/_search/?size=0 Body:
{
"size": "0",
"query": {
"bool": {
"must": [
{
"term": {
"latest": "true"
}
},
{
"term": {
"_entity": "true"
}
}
]
}
},
"aggs": {
"name": {
"terms": {
"field": "_type",
"size": 1000
}
}
}
}
17-06-2020 23:00:07.538 [http-nio-80-exec-1] ERROR
<x:xmpmeta xmlns:x="adobe:ns:meta/" x:xmptk="Adobe XMP Core 5.6-c142 79.160924, 2017/07/13-01:06:39 ">
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<rdf:Description rdf:about=""/>
</rdf:RDF>
</x:xmpmeta>
Pacbot Titillium Aa ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwzyz&£$%[]!?*º c.t.p.api.commons.utils.PacHttpUtils.doHttpPost - URL: http://somedomain.us-east-1.es.amazonaws.com:80/aws/_search/?size=0 Body: { "size": "0", "query": { "bool": { "must": [ { "term": { "latest": "true" } }, { "term": { "_entity": "true" } }, { "terms": { "_type": [ "ec2", "s3", "appelb", "asg", "classicelb", "stack", "dynamodb", "efs", "emr", "lambda", "nat", "eni", "rdscluster", "rdsdb", "redshift", "sg", "snapshot", "subnet", "targetgroup", "volume", "vpc", "api", "iamuser", "iamrole", "rdssnapshot", "account", "checks", "kms", "phd", "cloudfront", "elasticip", "routetable", "internetgateway", "launchconfig", "networkacl", "vpngateway", "asgpolicy", "snstopic", "dhcpoption", "peeringconnection", "customergateway", "vpnconnection", "directconnect", "virtualinterface", "elasticsearch", "elasticache" ] } } ] } }, "aggs": { "name": { "terms": { "field": "tags.Application.keyword", "size": 10000 }, "aggs": { "providers": { "terms": { "field": "_cloudType.keyword", "size": 10000 } } } } } } 17-06-2020 23:00:07.543 [http-nio-80-exec-3] ERROR 17-06-2020 23:00:07.543 [http-nio-80-exec-3] ERROR 17-06-2020 23:00:07.545 [http-nio-80-exec-3] ERROR 17-06-2020 23:00:07.545 [http-nio-80-exec-3] ERROR
c.t.p.a.a.r.AssetRepositoryImpl.getDistributionDataFromES - error retrieving inventory from ES
java.lang.Exception: unable to execute post request to http://somedomain.us-east-1.es.amazonaws.com:80/aws/_search/?size=0 because Not Found
at com.tmobile.pacman.api.commons.utils.PacHttpUtils.doHttpPost(PacHttpUtils.java:93)
at com.tmobile.pacman.api.asset.repository.AssetRepositoryImpl.getDistributionDataFromES(AssetRepositoryImpl.java:354)
2020-06-17T18:00:07.546-05:00
at com.tmobile.pacman.api.asset.repository.AssetRepositoryImpl.getTotalDistributionForIndexAndTypeWithProviders(AssetRepositoryImpl.java:281)
2020-06-17T18:00:07.546-05:00
at com.tmobile.pacman.api.asset.repository.AssetRepositoryImpl.getApplicationAssetCountByAssetGroupWithProvider(AssetRepositoryImpl.java:249)
2020-06-17T18:00:07.546-05:00
at com.tmobile.pacman.api.asset.repository.AssetRepositoryImpl.getApplicationAssetCountByAssetGroup(AssetRepositoryImpl.java:225)
2020-06-17T18:00:07.546-05:00
at com.tmobile.pacman.api.asset.repository.AssetRepositoryImpl.getApplicationByAssetGroup(AssetRepositoryImpl.java:215)
2020-06-17T18:00:07.546-05:00
at com.tmobile.pacman.api.asset.repository.AssetRepositoryImpl$$FastClassBySpringCGLIB$$26e07b49.invoke()
2020-06-17T18:00:07.546-05:00
at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)
2020-06-17T18:00:07.546-05:00
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:746)
2020-06-17T18:00:07.546-05:00
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
2020-06-17T18:00:07.546-05:00
at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:139)
2020-06-17T18:00:07.546-05:00
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185)
2020-06-17T18:00:07.546-05:00
at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:688)
2020-06-17T18:00:07.546-05:00
at com.tmobile.pacman.api.asset.repository.AssetRepositoryImpl$$EnhancerBySpringCGLIB$$587823aa.getApplicationByAssetGroup()
2020-06-17T18:00:07.546-05:00
at com.tmobile.pacman.api.asset.service.AssetServiceImpl.getAssetGroupInfo(AssetServiceImpl.java:206)
2020-06-17T18:00:07.546-05:00
at com.tmobile.pacman.api.asset.service.AssetServiceImpl$$FastClassBySpringCGLIB$$74f7e251.invoke()
2020-06-17T18:00:07.546-05:00
at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)
2020-06-17T18:00:07.546-05:00
at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:684)
2020-06-17T18:00:07.546-05:00
at com.tmobile.pacman.api.asset.service.AssetServiceImpl$$EnhancerBySpringCGLIB$$7829db24.getAssetGroupInfo()
2020-06-17T18:00:07.546-05:00
at com.tmobile.pacman.api.asset.controller.AssetController.getAssetGroupInfo(AssetController.java:169)
2020-06-17T18:00:07.546-05:00
at com.tmobile.pacman.api.asset.controller.AssetController$$FastClassBySpringCGLIB$$b72bbe2d.invoke()
2020-06-17T18:00:07.546-05:00
at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)
2020-06-17T18:00:07.546-05:00
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:746)
2020-06-17T18:00:07.546-05:00
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
2020-06-17T18:00:07.546-05:00
at org.springframework.security.access.intercept.aopalliance.MethodSecurityInterceptor.invoke(MethodSecurityInterceptor.java:69)
2020-06-17T18:00:07.546-05:00
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185)
2020-06-17T18:00:07.546-05:00
at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:688)
2020-06-17T18:00:07.546-05:00
at com.tmobile.pacman.api.asset.controller.AssetController$$EnhancerBySpringCGLIB$$d2034a6d.getAssetGroupInfo()
2020-06-17T18:00:07.546-05:00
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
2020-06-17T18:00:07.546-05:00
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
2020-06-17T18:00:07.546-05:00
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
2020-06-17T18:00:07.546-05:00
at java.lang.reflect.Method.invoke(Method.java:498)
2020-06-17T18:00:07.546-05:00
at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:209)
2020-06-17T18:00:07.546-05:00
at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:136)
2020-06-17T18:00:07.546-05:00
at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:102)
2020-06-17T18:00:07.546-05:00
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:877)
2020-06-17T18:00:07.546-05:00
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:783)
2020-06-17T18:00:07.546-05:00
at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87)
2020-06-17T18:00:07.546-05:00
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:991)
2020-06-17T18:00:07.546-05:00
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:925)
on the front end it shows 500s and 417s when calling API's for assets/vulnerabilities etc
I have tried also with 1.2 and 1.5 and 1.6 and get the same issue. is there something on the routing that is missing from the documentation
https://github.com/tmobile/pacbot/blob/master/installer/FAQs.md
The text was updated successfully, but these errors were encountered: