Problems connecting to Google IoT core via MQTT in C - c

I've set up the sample program from here: https://github.com/GoogleCloudPlatform/cpp-docs-samples/tree/master/iot/mqtt-ciotc
When I try to run the example, the only error message that I get is:
'Failed to connect, return code 1'
I then moved on and tried the NodeJs version https://github.com/GoogleCloudPlatform/nodejs-docs-samples/tree/master/iot/mqtt_example
Using the same roots.pem, private and public keys, the NodeJs example works perfectly. I can view the incoming messages on Google Console.
Is there any tools available to help me debug what the issue is with the C example? Or any suggestions on what the problem could be?
Thanks,
A

There is a wide range of reasons to why this could be happening, including unsupported versions. The Documentation for Cloud IoT provides some steps that you should verify first, but since you connected from the NodeJS code, we can discard some suggestions. What you could do to check errors is to use gcloud:
gcloud iot devices describe DEVICE_ID --project=PROJECT_ID --region=REGION --registry=REGISTRY_ID
The devices describe command may show additional error messages that can be used to help debug, including to verify that your device's credentials are not expired. Although some errors may not show up, my impression is that bad username or password errors would appear.

Related

Java IOException during API request to Stripe (APIConnectionException)

The specific action we are trying to performe is to create a charge request with Stripe:
Charge charge = Charge.create(params);
Using Stripe's Java implementation (version 5.35.1) we encounter a APIConnectionException when running the application on the deployed App Engine server. Interestingly, the issue does not occur using App Engine's local dev server.
We contacted Stripe and they said everything is fine on their side. They explained that "this error indicates that your server is not able to contact our API and that it ends up timing out waiting for an answer. Usually, this is due to something misconfigured on your server such as a DNS not redirecting to Stripe properly."
We were wondering if there are some configuration settings on App Engine which cause the problem. However, since there is no specific error message we cound not figure out what might cause the connection problem.
Similar problems which did not provide enough help to resolve this issue: https://issuetracker.google.com/35901039
Thanks for your help!
The problem seems to have solved itself. It occured for a couple of days and since a few hours the exact same code is working fine. Just like in https://issuetracker.google.com/issues/35901039 the problem is suddenly gone for some reason.

Failed to fetch component listing from server. C heck your network settings and try again

Am getting below error from Win8 machine.
D:\EO\downloads1\google-cloud-sdk-168.0.0-windows-x86-bundled-python\google-clou
d-sdk>install.bat
Welcome to the Google Cloud SDK!
To help improve the quality of this product, we collect anonymized usage data
and anonymized stacktraces when crashes are encountered; additional information
is available at https://cloud.google.com/sdk/usage-statistics. You may choose
to opt out of this collection now (by choosing 'N' at the below prompt), or at
any time in the future by running the following command:
gcloud config set disable_usage_reporting true
Do you want to help improve the Google Cloud SDK (Y/n)? y
to_install
ERROR: (gcloud.components.list) Failed to fetch component listing from server. C
heck your network settings and try again.
Thanks,
Sekhar
I had the same problem. It was due to our enterprise proxy performing TLS inspection and resigning with a custom cert. This cert is trusted by our managed devices browsers. However gcloud uses it's own truststore. You can add additional certs by storing them in PEM format and configuring gcloud as follows:
gcloud config set core/custom_ca_certs_file C:\path\to\cert-pem\proxy-certs.pem

Problems using Twitter4j on GAE throws 401 just after deploy

Well, I'm having a weird error here:
I'm developing one GAE app to read some Twitter Data, and after read a lot of docs, I have it working on my test server (Running on my pc) but after deploy and test on the real (my appspot domain) it shows this message:
401:Authentication credentials (https://dev.twitter.com/pages/auth) were missing or >incorrect. Ensure that you have set valid consumer key/secret, access token/secret, and the >system clock is in sync.
message - Could not authenticate you
code - 32
I've tried to recreate my OAuthAppToken and OAuthAppTokenSecret keys, even changing the permissions to "Write, Read and Direct Messages" and even assingning one Callback URL but nothing seems to work...
I've tried using twitter4j.properties OR using setOAuthConsumer(TW_CONSUMER_KEY, TW_CONSUMER_SECRET) OR a ConfigurationBuilder whith the correct constants and I'm experimenting the same Issue.
I'm working with AppEngine 1.8.3 and Twitter4j 3.0.4
Iv'e been writing on log and the Twitter object seems to be well created... I dont understand why is working on my PC but not on the real app.
On some other post someone says that could be because it needs to use Sync clock.. but he doesn't explains where to change that property...
Did someone had a clue?
Ok, the problem was me (and Twitter.... well..... I really think it was Twitter problem for being so dark on his api messages)...
On testing server I was looking for an existing account and on the cloud I was looking for an inexistent one. So, It was my mistake. But seriously, what about Twitter saying: "Access Forbidden"? That doesn't have any sense...

Google app engine down: Server Error

I built a system running on: http://www.hijgoo.com.tw and all the sudden, there was the following message and it did persist. I am using GAE SDK 1.7.2 with Python 2.7. Can anyone help?
Error: Server Error
The server encountered an error and could not complete your request.
If the problem persists, please report your problem and mention this error message and the query that caused it.
Looks like you have a session that does not contain the key account, but your code assumes that it does.
The reason for this isn't easy to see without the actual code, but it sounds like a programming error.

Silverlight error message [Arg_VersionString]. Don't know where to begin

One of the users of a silverlight app I wrote gets this error message:
[Arg_VersionString] Arguments:
Debugging resource strings are
unavailable. Often the key and
arguments provide sufficient
information to diagnose the problem.
See
http://go.microsoft.com/fwlink/?linkid=106663&Version=4.0.50524.0&File=mscorlib.dll&Key=Arg_VersionString
I checked the log of the asp.net application that is hosting the silverlight plugin and I see no exceptions. The services seem to be working properly, I even witness the trace of this user running the app, and I can confirm that the service successfully returned data.
Something must be happening on the client side, but I don't know where to start. The software is in production already, there are no debugging tools on that server other than DbgView and the problem only seems to be occuring for this particular user.
What would you do?
In order to reduce the size of the Silverlight plugin, The strings of error messages were removed. So if any unhandled exception gets thrown this is the message you will recieve.
In order to get the full version of the exception the user has to have the Silverlight Developer Runtime and not the client runtime installed.
If you have a record of the data returned to the client, you might try using Fiddler to inject that data into the client running on your machine and see if it fails. If it does you should get back the full error message.

Resources