I've added a new environment prod using apigee-adminapi script. After that I ran apigee-provision enable-ax.
When I switch to the prod environment in Apigee UI, I see "Error fetching analytics data Data Access Error.".
In Postgres logs I see this error (<ORG_NAME> - my org name):
SELECT developer,developer_app,sum(message_count) AS mtrc0,sum(error_count) AS mtrc1,date_trunc('month', timestamp at time zone '-0:0:0')::timestamp without time zone AS time_unit FROM analytics."<ORG_NAME>.prod.agg_app" WHERE timestamp >= '2017-5-26 22:0:0' AND timestamp < '2017-6-2 22:0:0' AND ((developer_app != 'na' ) and (developer_app != '(not set)' )) AND developer_app IN ( SELECT developer_app FROM ( SELECT developer_app FROM analytics."<ORG_NAME>.prod.agg_app" WHERE timestamp >= '2017-5-26 22:0:0' AND timestamp < '2017-6-2 22:0:0' AND ((developer_app != 'na' ) and (developer_app != '(not set)' )) GROUP BY developer,developer_app ORDER BY sum(message_count) DESC,sum(error_count) DESC LIMIT 5 OFFSET 0 ) AS subquery ) GROUP BY developer,developer_app,time_unit ORDER BY sum(message_count) DESC,sum(error_count) DESC LIMIT 14400 OFFSET 0 2017-06-02 22:56:43 UTC [10011]: [61-1] user=<USERNAME> db=apigee host=10.227.14.26 ERROR: relation "analytics.<ORG_NAME>.prod.agg_app" does not exist at character 146
How did you solve this issue? I am getting the same error.
Answer by Ian MacLeish · Jan 20 at 05:18 PM
Hi!
This error can be caused if you created a new environment, but did not enable analytics for that env. The command you need to run will look something like this:
/opt/apigee/apigee-service/bin/apigee-service apigee-provision enable-ax -f configFile
You can follow the steps outlined below to do this. You may also need to restart your env once you run this command.
[1] https://docs.apigee.com/private-cloud/v4.50.00/creating-organization-environment-and-virtual-host#createanenvironment-createanenvironmentbyusingapicalls
Error while fetching Stat: Invalid API Call 3 Answers
postgres status recovering 2 Answers
Analytic Data not appearing in UI 5 Answers
Working with the Analytics Group API 2 Answers