Closed bess closed 6 months ago
For reference, we had a similar issue before: https://github.com/pulibrary/pdc_discovery/issues/462
I'm checking on the payment info now. Since we don't have access to the API, this is currently manifesting in the UI as views/downloads not appearing (though the stats are still being recorded in our account):
I confirmed that there doesn't appear to be an issue with our payment info. The issue is ongoing. As an admin for the sites, I created the original API keys and since my account is also displaying the "Your account does not have access to Stats API." warning when I log in, I've contacted Plausible customer support for guidance.
I notice that when logged in with my Princeton account it shows as "free trial" -- to be fair, I have no idea what it showed last year, but it looks odd.
My account looks the same way, which I agree feels like something has changed for individuals but I can't say for sure.
I got a response from customer service as follows:
"Your API key does not work because your account is an expired trial. But even if you had an active subscription, your API key wouldn't work because only the owner's API key can query stats for the dashboards he owns. Can you please ask Account Owner to generate a key for you?"
I reached out to Tracy to pair on this as soon as possible.
@kelynch the new key in staging seems to be OK...making a call to Plausible does not return an error:
deploy@pdc-discovery-staging1:/opt/pdc_discovery/current$ bundle exec rails c
Loading staging environment (Rails 6.1.7.4)
irb(main):001:0> Plausible.pageviews(174742)
=> 0
whereas the same call in production results in an error:
deploy@pdc-discovery-prod1:/opt/pdc_discovery/current$ bundle exec rails c
Loading production environment (Rails 6.1.7.4)
irb(main):001:0> Plausible.pageviews(174742)
PLAUSIBLE ERROR: (Pageviews for document: 174742) {"error":"The account that owns this API key does not have access to Stats API. Please make sure you're using the API key of a subscriber account and that the subscription plan includes Stats API"}
=> 0
There are no statistics at all in staging, though. But i looks like this has been the case for a very long time:
I suspect we can safely update production with the new keys and test over there.
I've added the production key in princeton_ansible here - https://github.com/pulibrary/princeton_ansible/pull/4636
@kayiwa reprovisioned the production boxes with the keys that @kelynch generated and Plausible shows data again:
I've also added a local development key for Plausible to LastPass
Both of these errors seem to be caused by our inability to connect to plausible: