APIs & Integrations

cameroncollecti
Contributor

IOError during CRM Extension data-fetch

SOLVE

I have a CRM Extension trying to load when a contact page is being opened in a test hub, and I'm not seeing my data-fetch uri being requested. In the monitoring section of my developer account, I see an IOError. I can copy paste the request in my browser and I see the request.

Any help would be appreciated.

0 Upvotes
1 Accepted solution
Kevin_Griffin
Solution
Member

IOError during CRM Extension data-fetch

SOLVE

@Connor_Barley, we got it.

So, the way we automatically provision certs was missing the addition of intermediate certs, so the cert chain was not "complete" enough for postman / curl (but apparently for chrome ?).

https://www.ssllabs.com/ssltest/index.html pointed out that deficiency.

we manually re-provisioned the certs (in gcloud for us) and all is well.

As you'll see if you check our monitoring page, we got our first 200.

Greatly appreciate the help.

View solution in original post

22 Replies 22
cameroncollecti
Contributor

IOError during CRM Extension data-fetch

SOLVE

Thanks for your help @Connor_Barley. I reconfigured my ssl cert and I am now getting 200's as well.

Thanks again!

cbarley
HubSpot Alumni
HubSpot Alumni

IOError during CRM Extension data-fetch

SOLVE

@Kevin_Griffin that is amazing. So happy you were able to get that and thank you for the link to SSL labs and helping out a fellow developer! This is incredibly helpful.

Kevin_Griffin
Member

IOError during CRM Extension data-fetch

SOLVE

@cameroncollective I ran the same test on your cert as I did on ours, https://www.ssllabs.com/ssltest/analyze.html

Looks like you have the exact same issue,

This server's certificate chain is incomplete. Grade capped to B.

Additional Certificates (if supplied)
Chain issues	Incomplete
0 Upvotes
cbarley
HubSpot Alumni
HubSpot Alumni

IOError during CRM Extension data-fetch

SOLVE

Got it. I included more details on the info i gave to our developers so I hope they can clarify what the restrictions are on the certs we accept, if there are any restrictions. Hope to get back to you as soon as possible

0 Upvotes
Kevin_Griffin
Solution
Member

IOError during CRM Extension data-fetch

SOLVE

@Connor_Barley, we got it.

So, the way we automatically provision certs was missing the addition of intermediate certs, so the cert chain was not "complete" enough for postman / curl (but apparently for chrome ?).

https://www.ssllabs.com/ssltest/index.html pointed out that deficiency.

we manually re-provisioned the certs (in gcloud for us) and all is well.

As you'll see if you check our monitoring page, we got our first 200.

Greatly appreciate the help.

cbarley
HubSpot Alumni
HubSpot Alumni

IOError during CRM Extension data-fetch

SOLVE

@cameroncollective, I was able to make a successful GET request to your URL (https://srv1.cameroncollective.com/learning_api/fetch) here when SSL certificate verification was turned off as @Kevin_Griffin mentioned, so your hunch about the certificate is probably right. I'm going to get clarification from the CRM extensions team so that I can provide more details on what we require for SSL certs.

0 Upvotes
cbarley
HubSpot Alumni
HubSpot Alumni

IOError during CRM Extension data-fetch

SOLVE

Nevermind, I found it :stuck_out_tongue_closed_eyes:. Should've googled a bit more

cbarley
HubSpot Alumni
HubSpot Alumni

IOError during CRM Extension data-fetch

SOLVE

Got it @Kevin_Griffin, so you're all set now? Glad I could help. If I could now flip the tables on you, how were you able to disable the SSL verification in Postman? I'm not aware of where to find that setting!

0 Upvotes
Kevin_Griffin
Member

IOError during CRM Extension data-fetch

SOLVE

Turn SSL verification off:

Settings > General > SSL verification

Sadly though, no, not sorted.

We're thinking maybe something is wrong with the cert chain. Not sure you guys can help us, we're investigating on our side. I follow up if we resolve it, hopefully it will help others in the future with cert issues.

Kevin_Griffin
Member

IOError during CRM Extension data-fetch

SOLVE

@Connor_Barley looks like it's the let's encrypt certs for us.

I had SSL verification off in postman, if I turn it on - it fails.
If I turn it off, it works, Chrome etc think the cert is valid though.

Also greatly appreciate you digging in :slight_smile:

cbarley
HubSpot Alumni
HubSpot Alumni

IOError during CRM Extension data-fetch

SOLVE

Hi @Kevin_Griffin, taking a closer look at your fetch URL, there's definitely something strange going on. When I make a GET request to https://sleipnir.scoir.rocks/api/three-eyed-raven/test in Postman, I don't get any response back. I deployed a simple app to mirror yours up to Heroku and was able to get 200 responses on all object types in HubSpot. You can find the app here: https://obscure-cliffs-47038.herokuapp.com/

The only difference I can see between your app and mine is that if you check the Network on your webpage and look at the response, your JSON is formatted like this:

Whereas mine looks like this:

I also made your app have the same base URI structure as mine. Here's what my HubSpot app looks like:

Screenshot

Captured with Lightshot

could it be something as simple as some sort of typo on your end? Here's my simple app in Github as well: https://github.com/cbarley10/hubspot-crm-extensions

I can keep digging in with my team, but thought I'd share my findings with you first.

@cameroncollective, I'm still investigating your issue

Kevin_Griffin
Member

IOError during CRM Extension data-fetch

SOLVE

@Connor_Barley I still receive IOError.

0 Upvotes
Kevin_Griffin
Member

IOError during CRM Extension data-fetch

SOLVE

Do those actions need to map to valid endpoints?
I can remove them, I was just using the sample.

I updated the endpoint to omit actions entirely, just returning

{
	"results": [
	  {
		"objectId": 245,
		"title": "testages",
		"reported_by": "msmith@hubspot.com",
		"reporter_type": "Account Manager",
		"ticket_type": "Bug"
	  }]
	}

Still IOError

0 Upvotes
cbarley
HubSpot Alumni
HubSpot Alumni

IOError during CRM Extension data-fetch

SOLVE

Hi @Kevin_Griffin can you try changing the URIs of the data that comes back to be one of your baseURI's to see if this fixes your issue?

@cameroncollective, it looks like your data is stringified when I go to your fetch URL, can you make the data that gets returned just be JSON, rather than the stringified version of your JSON object?

cameroncollecti
Contributor

IOError during CRM Extension data-fetch

SOLVE

Hey @Connor_Barley My test app is now returning a JSON object with the correct mime type etc. and not a JSON-like string.

Here is why I think it's a cert\CA issue.

This is a packet capture on my server when I open a contact's detail page triggering the data-fetch call.

I would have guess that was the issue with the Let's Encrypt cert, but this is a legit Comodo cert.

0 Upvotes
cbarley
HubSpot Alumni
HubSpot Alumni

IOError during CRM Extension data-fetch

SOLVE

Hi @cameroncollective, I'm still looking into this to see what's going on. I don't think this has to do with your SSL cert. I'm looking to see if there's something with the format of your JSON data, but I'm still checking. @Kevin_Griffin, what is your App id so I can take a look?

0 Upvotes
Kevin_Griffin
Member

IOError during CRM Extension data-fetch

SOLVE

This is my app ID 184159

Kevin_Griffin
Member

IOError during CRM Extension data-fetch

SOLVE

I have this extact issue.

Is it appropriate to address here, or should I create a new issue?

As a side note, when I copy the URL from the Monitoring > CRM Extensions tab, and invoke via curl/browser/postman - I get json.

{
	"results": [
	  {
		"objectId": 245,
		"title": "testages",
		"reported_by": "msmith@hubspot.com",
		"reporter_type": "Account Manager",
		"ticket_type": "Bug"
	  }
	  ],
	  "settingsAction": {
		"type": "IFRAME",
		"width": 890,
		"height": 748,
		"uri": "https://example.com/settings-iframe-contents",
		"label": "Settings"
	  },
	  "primaryAction": {
		"type": "IFRAME",
		"width": 890,
		"height": 748,
		"uri": "https://example.com/create-iframe-contents",
		"label": "Create Ticket"
	  }
	}

I set my object type up to contain properties for reported_by/reporter_type/ticket_type.

Is there any other documentation on the structure/required properties of "object types"?

Is there any other resource to debug the integration? or a way to get a more detailed failure?

0 Upvotes
cameroncollecti
Contributor

IOError during CRM Extension data-fetch

SOLVE

Hey @Connor_Barley I left the server running and it will return a fairly static object to the data-fetch request.

After poking around a bit, I still don't see the request hitting nginx, However with tcpdump, I see traffic from you guys trying to open a SSL/TLS connection. My guess is that you guys don't like my SSL certificate signed by Let's Encrypt CA?

0 Upvotes
cameroncollecti
Contributor

IOError during CRM Extension data-fetch

SOLVE

I switched my cert to Comodo, and I'm still getting the same IOError, so I still must be doing something dumb.

0 Upvotes