woocommerce / pinterest-for-woocommerce

A native Pinterest integration for WooCommerce. Development is managed by Ventures.
https://woocommerce.com/products/pinterest-for-woocommerce/
GNU General Public License v3.0
22 stars 9 forks source link

Investigate No relevant meta tag was found exception #446

Closed adarshakb closed 1 year ago

adarshakb commented 2 years ago

Partner connect failed with exception "No relevant meta tag was found when creating merchant"

Over the last week a majority of errors came from Domain ['https://scarfbank.com/gallery'] verification failed for user scarfbank Domain ['https://www.bathroombutler.com/us'] verification failed for user bathroombutler

Below domains also had errors but number of errors were lower Domain ['https://bathroombutdev.wpengine.com/us'] verification failed for user bathroombutler Domain ['https://jorgephyttasraposo.com'] verification failed for user jaffrayhunter3426

adarshakb commented 2 years ago

Also investigate why this endpoint is called repeatedly when there is this error. This endpoint was called 1.3k times in 2 weeks

Screen Shot 2022-04-18 at 6 04 20 PM
JPry commented 2 years ago

Partner connect failed with exception "No relevant meta tag was found when creating merchant"

I did some digging into the codebase, and I don't see this message (or even one close to it) anywhere. My assumption is that this specific message is actually returned from the Pinterest API. Is there more information about what triggers that error to be returned from the API? Do we know exactly which endpoint is being hit here? It looks like the domain verification, but I want to be sure.

Assuming it is domain verification, there is no payload data being sent with the request, so I'm not sure how our calls can do anything differently. But understanding which endpoint is being hit can help us track down where the issue is originating.

Also investigate why this endpoint is called repeatedly when there is this error. This endpoint was called 1.3k times in 2 weeks

Assuming it is indeed domain verification, the endpoint will be retried in short succession in the case of a failure. This might explain why there is a higher call rate for that endpoint.

alexiglesias31 commented 2 years ago

@jconroy @JPry

Partner connect failed with exception "No relevant meta tag was found when creating merchant"

The message comes from the Pinterest API in the error message field. We couldn't find anything related in the documentation about that message.

cc @adarshakb

alexiglesias31 commented 2 years ago

The back-off functionality could be approached as follows:

jconroy commented 2 years ago

Thanks for the extra info @alexiglesias31 I'll discuss with @JPry

jconroy commented 2 years ago

@JPry where are you at with this one?

(Just capturing another recent "no tag" issue as possibly related)

adarshakb commented 2 years ago

Adding info from Slack thread by @niketpins

a) some websites are behind login e.g. the-falcon.net/ladiva_staging because of which we may not be able to verify from metatag or filename b) Rest of the domains which are failing, both metatag and html file are missing for those. My guess is init_plugin is invoked before verification_data is set https://saucal.slack.com/archives/C01D4U4JS3C/p1656656456455469?thread_ts=1655826809.021029&cid=C01D4U4JS3C

Is there anyway to reach out to 1-2 merchants to find debug logs and more info. We can join the session as well if it helps.

JPry commented 2 years ago

@adarshakb

Rest of the domains which are failing, both metatag and html file are missing for those. My guess is init_plugin is invoked before verification_data is set saucal.slack.com/archives/C01D4U4JS3C/p1656656456455469?thread_ts=1655826809.021029&cid=C01D4U4JS3C

Can you provide more details from that conversation? I don't have access to that Slack instance.

adarshakb commented 2 years ago

Currently domain verification code is injected on init_pluginhttps://github.com/woocommerce/pinterest-for-woocommerce/blob/develop/class-pinterest-for-woocommerce.php#L246 and maybe_inject_verification_code method requires verification_data to inject otherwise skips. When does init_plugin invoked? Is there a possibility that init_plugin is invoked and verification_data is not set and hence code is not injected (assuming init happens only once)?

adarshakb commented 2 years ago

Separate question do we remove injected code after domain verification is complete or it stays there

alexiglesias31 commented 2 years ago

init_plugin is hooked on plugins_loaded and the verification data stays there after domain verification is complete.