Chrome Web Store API / userlicenses returns error 500

346 views
Skip to first unread message

Rob Biemans

unread,
Mar 2, 2019, 8:09:44 AM3/2/19
to Chromium Extensions
Hello All,

There seem to be general issue with the Chrome Web Store API / Userlicenses which returns 500 internal server error for every new extension that want to use the google payment gateway inside their extension.

However, when trying to check the license the following URL  https://www.googleapis.com/chromewebstore/v1.1/userlicenses/my-extension-id-in-web-store returns Status Code 500.
Full response: {"error":{"errors":[{"domain":"global","reason":"backendError","message":"Backend Error"}],"code":500,"message":"Backend Error"}}

Another developer I found that has the exact same issue: https://issuetracker.google.com/issues/123485216


Steps to reproduce:
Add a new project to https://console.developers.google.com, enable Chrome Web Store API, get the OAuth 2.0 credentials for Chrome App, add the client ID to the manifest of the Chrome extension
"oauth2": {
        "client_id": "the-generated-client-id",
        "scopes": [
            "https://www.googleapis.com/auth/chromewebstore.readonly"
    ]}


I have tried many times the https://developer.chrome.com/webstore/one_time_payments#verifying-payment official guide, yet no succesful results.

Please help!

With kind regards.
Rob

backend_error.png
Message has been deleted

Adam Shiervani

unread,
Mar 3, 2019, 7:48:08 AM3/3/19
to Chromium Extensions
Hey,
I have the same problem, i've tried for countless hours to get this thing 
working with every possible combination of every possible variable.
During this i've used a handful of resources, but mainly:

   - Chrome Web Store Tutorial 
   <https://developer.chrome.com/webstore/one_time_payments> 
   - One time payment Sample App 
   <https://github.com/GoogleChrome/chrome-app-samples/tree/master/samples/one-time-payment>
   - Chromium Apps Announce Forum post regarding 500's on the 
   /userlicenses/ endpoint 
   <https://groups.google.com/a/chromium.org/d/msg/chromium-apps/UXE_ASCN0gc/gYxAdy-4nDQJ>
    

I don't know if this is relevant, but the extension i'm trying to get this 
working with has this i the *Chrome Web Store Developer Dashboard* :

> This item is paid and uses *Chrome Web Store Payments*.
> Subscription type: *subscription charged per month*



So, this is the code that i try to get working:

async function get_token () {
let token
try {
token = await chromep.identity.getAuthToken({ interactive: true })
} catch (e) {
return console.error(e.message)
}
if (token) {
console.log('Chrome.identity.getAuthToken returned a token', token)
return token
}
}

async function get_license () {
const CWS_LICENSE_API_URL =
const license = await fetch(`${CWS_LICENSE_API_URL}/<ID>`, {
method: 'GET',
headers: new Headers({ Authorization: `Bearer ${await get_token()}` })
})
}


I've tried every possible combination i find relevant to the task. As far as i see there is 4 different variables that matter for the request: - The *"key" *property in the manifest - The *id* to retrieve the license([...]/v1.1/userlicenses/<EXTENSION_ID>) - The oauth2.*scope *property in the manifest.json - The generated *oauth2.client_id *in the manifest.json. - I generate this in the same account as a published the Chrome extension. I used Google API Console> Credentials > Create Credentials > OAuth Client ID > Chrome App For every variable described above i've tried to use: - The ID of the dev build i'm that's i'm developing in. - The ID of the published extension - Installed the published Chrome extension and used the* "key"* found in *~/Library/Application Support/Google/Chrome/Default/Extensions/<PUBLISHED_CHROME_EXTENSION_ID>/manifest.json* - I even tried to use all the variable supplied Sample app <https://github.com/GoogleChrome/chrome-app-samples/tree/master/samples/one-time-payment> The token retrieval works great, i get prompted and see the correct scopes and logo, *but *when i then use the token i get a 500 with the following response:
{
"error": {
"errors": [{
"domain": "global",
"reason": "backendError",
"message": "Backend Error"
}],
"code": 500,
"message": "Backend Error"
}
}

The strange thing here is when i use the same token for 
*https://www.googleapis.com/chromewebstore/v1.1/items/<EXTENSION_ID>?projection=draft *i 
get a *200* with the following payload:
{
"kind": "chromewebstore#item",
"id": "<EXTENSION_ID>",
"publicKey": "<PUB_KEY>",
"uploadState": "NOT_FOUND",
"crxVersion": "<VERSION>"
}

Hopefully this helps to debug the problem. Regards, Adam

Rob Biemans

unread,
Mar 3, 2019, 8:22:44 AM3/3/19
to Chromium Extensions
Hello Adam,

Have you tried the possible solution from Dmitry Titov from your link with a new app, if I correctly understand you?; https://groups.google.com/a/chromium.org/forum/#!msg/chromium-apps/UXE_ASCN0gc/gYxAdy-4nDQJ



Op zondag 3 maart 2019 13:48:08 UTC+1 schreef Adam Shiervani:

Rob Biemans

unread,
Mar 3, 2019, 10:14:19 AM3/3/19
to Chromium Extensions
I just retried to follow the steps provided by Dmitry Titov, yet no success.

This is very frustrating, looks like Google aren't planning to solve the issue (as it is a month old now). I guess we have to change payment gateways, that will hurt Google's wallet in the end.

Op zondag 3 maart 2019 14:22:44 UTC+1 schreef Rob Biemans:

marcis

unread,
Mar 26, 2019, 8:00:27 PM3/26/19
to Chromium Extensions, robbie...@gmail.com
Same problem here!

Same code is working for an old extension, but not for a new one I just published last week.

Is it really so hard to fix a 500 error?

Regards

Serge V.

unread,
Apr 28, 2019, 12:46:25 PM4/28/19
to Chromium Extensions, robbie...@gmail.com
Exactly the same problem.

Did a lot of things to figure out.

Installed the <One Time Payment Sample> app. Works fine. Checked of my implementation of authentication/verification with its source code. Everything is correct.

For experiment enabled the <Google People API> in the API console. Works fine, the answer is 200.

Created and tried other projects and other client IDs in the API console. Useless.

Wrote to support via the interactive form. Waiting.

Has anyone recently (in weeks) successfully published an extension with license verification through the Chrome Web Store API?  Would like to check the actions.

marcis

unread,
Aug 29, 2019, 11:23:04 AM8/29/19
to Chromium Extensions, robbie...@gmail.com
Any news about this? :(


El sábado, 2 de marzo de 2019, 14:09:44 (UTC+1), Rob Biemans escribió:

Trading Connector

unread,
Aug 29, 2019, 11:32:30 AM8/29/19
to Chromium Extensions, robbie...@gmail.com
+1


On Saturday, March 2, 2019 at 2:09:44 PM UTC+1, Rob Biemans wrote:

Simeon Vincent

unread,
Aug 30, 2019, 1:52:31 PM8/30/19
to Chromium Extensions, robbie...@gmail.com
The CWS team rolled out a bug fix for this this morning. Please retry and let us know if you're still observing unexpected 500s on this endpoint.

Simeon - @dotproto
Extensions Developer Advocate

Trading Connector

unread,
Aug 30, 2019, 2:23:35 PM8/30/19
to Chromium Extensions, robbie...@gmail.com
I confirm it is working now. Thank you!
Reply all
Reply to author
Forward
0 new messages