Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Jan 31 2019 14:07
    jugalde-r7 commented #2352
  • Jan 31 2019 09:36
    takeyourhatoff commented #2427
  • Jan 31 2019 09:35
    takeyourhatoff commented #2427
  • Jan 30 2019 23:10
    diehlaws commented #2427
  • Jan 30 2019 23:09
    diehlaws labeled #2427
  • Jan 30 2019 23:09
    diehlaws labeled #2427
  • Jan 30 2019 21:47
    diehlaws labeled #2352
  • Jan 30 2019 21:47
    diehlaws commented #2352
  • Jan 30 2019 21:12
    diehlaws commented #2342
  • Jan 30 2019 20:58
    diehlaws assigned #2427
  • Jan 30 2019 20:54
    diehlaws unlabeled #81
  • Jan 30 2019 20:54
    diehlaws unlabeled #142
  • Jan 30 2019 20:54
    diehlaws unlabeled #618
  • Jan 30 2019 20:54
    diehlaws unlabeled #81
  • Jan 30 2019 20:54
    diehlaws unlabeled #142
  • Jan 30 2019 20:54
    diehlaws unlabeled #619
  • Jan 30 2019 20:54
    diehlaws unlabeled #628
  • Jan 30 2019 20:54
    diehlaws unlabeled #568
  • Jan 30 2019 20:54
    diehlaws unlabeled #521
  • Jan 30 2019 20:54
    diehlaws unlabeled #487
decore
@waytai
my thingname is right, but returns {
"message": {
"Attributes": null,
"BillingGroupName": null,
"DefaultClientId": null,
"ThingArn": null,
"ThingId": null,
"ThingName": null,
"ThingTypeName": null,
"Version": null
}
}
can any body help me?
Simon Woldemichael
@swoldemi
@shakiakhtar_gitlab authorization token for ECR? https://docs.aws.amazon.com/sdk-for-go/api/service/ecr/#ECR.GetAuthorizationToken
Or for a different AWS service?
Simon Woldemichael
@swoldemi
@waytai Can you set aws.Config.LogLevel in your session and share the output? It's possible you're in the wrong region/have no authorization
    config := &aws.Config{
        LogLevel:   aws.LogLevel(aws.LogDebugWithRequestErrors),
        Region:     aws.String("us-east-1"),
        MaxRetries: aws.Int(5),
    }
    svc := iot.New(session.New(config))
decore
@waytai
I can get shadow getthingshadowinput := &iotdataplane.GetThingShadowInput{ThingName:&thingname}
out, _ := svc.GetThingShadow(getthingshadowinput)
var REGION = "cn-north-1"
decore
@waytai
@swoldemi

func GetAwsIotThing(thingname string) *iot.DescribeThingOutput {

var client = session.Must(session.NewSession(
    aws.NewConfig().
        WithRegion(config.REGION).
        WithEndpoint(config.ENDPOINT).
        WithLogLevel(3),
))


client.Config.Credentials = credentials.NewStaticCredentials(config.AK, config.SK, "")

svc := iot.New(client, &aws.Config{
    DisableParamValidation: aws.Bool(true),
})

descriptthinginput :=  &iot.DescribeThingInput{ThingName: aws.String(thingname)}
out, err := svc.DescribeThing(descriptthinginput)
fmt.Println(err.Error())
return out

}

Simon Woldemichael
@swoldemi
@waytai Are you sure your machine/static access key and secret access key are for Beijing? Can you use the AWS CLI to run aws sts get-caller-identity
Ah you mentioned you're able to view the device shadow
decore
@waytai
I have got device shadow , but tings information I can't get.
Simon Woldemichael
@swoldemi
I'm not really sure where to go from here without seeing some debug output. I don't have much experience with IoT Core and don't have access to an account in the China regions either :\
decore
@waytai
image.png
Simon Woldemichael
@swoldemi
can you call iot.ListThings?
decore
@waytai
image.png
iot.ListThings need NextToken, I do not know where this value come from
Simon Woldemichael
@swoldemi
You can leave it empty, that's just for pagination if you have many Things that get returned. Let's you pick up where you left on after the previous request
iot.cn-north-1.amazonaws.com.cn is the endpoint but your request makes a GET to thing-name.ats.iot.cn-north-1.amazonaws.com.cn
Do you know what ats is?
what's after /thing/? it's cut off in the screenshot @waytai
decore
@waytai
image.png
image.png
Simon Woldemichael
@swoldemi
Ah ats is Amazon Trust Service with some random prefix it looks like. I'm a little confused now https://docs.aws.amazon.com/general/latest/gr/greengrass.html
on WithEndpoint(config.ENDPOINT). what is the value of config.ENDPOINT?
also thank your for you kindly reply.=
Simon Woldemichael
@swoldemi
no problem, from https://docs.aws.amazon.com/general/latest/gr/iot-core.html it doesn't look like theres an ATS endpoint for IoT core. when you called ListThings, did you use that same endpoint?
decore
@waytai
yes,I have use the same endpoint
I konw, thank you
Simon Woldemichael
@swoldemi
what do you see when you run aws iot describe-endpoint --endpoint-type iot:Data
Simon Woldemichael
@swoldemi
what happens if you try to CreateThing then DescribeThing immediately after? Documentation says to use the thingName but worth a shot to attempt the thingId and thingArn, i'm really not sure @waytai
only other thing is authorization, but if you're allowed to ListThing I can't imagine the user behind your credentials is being restricted. getting a 404 instead of a 401 too...
decore
@waytai
root@liu:~# aws iot describe-endpoint --endpoint-type iot:Data
{
"endpointAddress": "athdo18zuldn6.iot.cn-north-1.amazonaws.com.cn"
}
Simon Woldemichael
@swoldemi
maybe aws iot describe-thing --thing-name testliu --region cn-north-1 --debug true --endpoint athdo18zuldn6.iot.cn-north-1.amazonaws.com.cn @waytai
decore
@waytai

root@liu:~# aws iot describe-thing --thing-name testliu --region cn-north-1 --endpoint https://athdo18zuldn6.ats.iot.cn-north-1.amazonaws.com.cn

An error occurred (ResourceNotFoundException) when calling the DescribeThing operation: Not Found

also not use ats

root@liu:~# aws iot describe-thing --thing-name testliu --region cn-north-1 --endpoint https://athdo18zuldn6.iot.cn-north-1.amazonaws.com.cn

An error occurred (ResourceNotFoundException) when calling the DescribeThing operation: Not Found

but use aws iot describe-thing --thing-name testliu can get the result
I have success,
should use "https://iot.cn-north-1.amazonaws.com.cn" this url but not the endpoint url
decore
@waytai
thank you for you great help
decore
@waytai
root@liu:~# aws iot describe-thing --thing-name testliu --region cn-north-1 --endpoint https://iot.cn-north-1.amazonaws.com.cn
success
Simon Woldemichael
@swoldemi
Nice! No problem
Rob Weaver
@roboweaver
OK, I'm having some issues with the configService.SelectAggregateResourceConfig(selectAggregateResourceConfigInput) call
In my IDE, it is showing this func doesn't exist, even though it's clearly here in the docs
Simon Woldemichael
@swoldemi
@roboweaver Hi Rob, what IDE/language server are you using? Certain language servers have issues going through the SDK as a result of large files. package configservice isn't too big, but it would depend on how your language server creates IntelliSense data, etc. Possibly related issue: aws/aws-sdk-go#3168
Rob Weaver
@roboweaver
Figured it out with help from AWS support. I didn't have the latest version of the SDK downloaded (wasn't aware that Go build doesn't update unless you run go get .... I'm using IntelliJ and #golang
All good now tho
Bradley
@BradErz

Hi there,

We recently started running into isseues with the aws-sdk, pimarily we are using sqs/sns. We found out that its now possible to specify the httpclient to the aws-sdk. We found an example in the docs however it seems our services complain hen using this custom httpClient.

// this function is needed to configure the default http client of the AWS sdk,
// if this is not done no timeouts are set leaving connections hanging forever and causing any disconnect from SNS
// SQS to stay disconnected values taken from:
// https://docs.aws.amazon.com/sdk-for-go/v1/developer-guide/custom-http.html#s3-client
// we also wrap the http client inside the faceit tripper so we have metrics about the http request from the sdk
func getDefaultHttpClient() *http.Client {
    customTransport := &http.Transport{
        ResponseHeaderTimeout: 5 * time.Second,
        Proxy:                 http.ProxyFromEnvironment,
        DialContext: (&net.Dialer{
            KeepAlive: 30 * time.Second,
            Timeout:   5 * time.Second,
        }).DialContext,
        MaxIdleConns:          100,
        MaxIdleConnsPerHost:   10,
        IdleConnTimeout:       90 * time.Second,
        TLSHandshakeTimeout:   5 * time.Second,
        ExpectContinueTimeout: 1 * time.Second,
    }
    if err := http2.ConfigureTransport(customTransport); err != nil {
        logger.Get().WithError(err).Error("failed to convert customTransport to http2 failling back to 1.1")
    }
    customTripper := tripper.New(tripper.WithTransport(customTransport))
    return &http.Client{Transport: customTripper}
}

The application begins to log

{"app":"go-template-api","env":"test","error":"RequestError: send request failed\ncaused by: Post \"https://sqs.eu-west-1.amazonaws.com/\": net/http: timeout awaiting response headers","message":"can not get message from the queue","operation":"subscribe","queue_url":"go-template-service-test","severity":"ERROR","thread":"amazon_listener","timestamp":{"seconds":1586351596,"nanos":266864727},"version":"1.0.0"}
{"app":"go-template-api","env":"test","error":"RequestError: send request failed\ncaused by: Post \"https://sqs.eu-west-1.amazonaws.com/\": net/http: timeout awaiting response headers","message":"can not get message from the queue","operation":"subscribe","queue_url":"go-template-service-test","severity":"ERROR","thread":"amazon_listener","timestamp":{"seconds":1586351617,"nanos":668494006},"version":"1.0.0"}

Does anyone have any ideas? is the normal or expected? or some type of misalignment with the sqs api?

I mean obviously the error is coming from this timeout:
ResponseHeaderTimeout: 5 * time.Second

So i guess what im really asking is does anyone have any sensible numbers that work with SQS?