add-env.sh did not successfully enable analytics

Hi everyone,

I have a few environments (dev, test, prod) running in my Apigee Private Cloud v4.15.04.03, all with analytics data working perfectly fine.

I went to create an additional environment today by ssh-ing into the management server VM and running the add-env.sh script. I entered all the prompted info correctly and it claims to have received an HTTP 201 from the API to enable analytics for the env.

At the very end of the add-env.sh script, it says that one can check the overall analytics status with two commands. When I run both commands, they each suggest that analytics has failed to be enabled.

\d analytics."fooBarOrg.fooBarEnv.fact"

Did not find any relation named "analytics."fooBarOrg.fooBarEnv.fact"".

^ i.e. the postgres tables were never created. Why?

<mgmt-svr>/v1/o/fooBarOrg/environments/fooBarEnv/provisioning/axstatus


{
  "environments": [
    {
      "components": [
        {
          "hosts": "[localhost, localhost]",
          "message": "success",
          "name": "qs",
          "status": "SUCCESS",
          "uuid": "[ea0c145b-fd45-4003-90ef-7c479a826634, c7ab40bb-d430-4987-b9d2-e38fdf1dea4b]"
        },
        {
          "hosts": "[localhost:localhost]",
          "message": "",
          "name": "pg",
          "status": "UNKNOWN",
          "uuid": "[ab38e06e-09b6-44a4-9b44-bbbfc282ceec:3d46f771-86c1-4449-959a-c4ad44a41ebb]"
        }
      ],
      "message": "",
      "name": "fooBarEnv"
    }
  ],
  "organization": "fooBarOrg",
  "status": "FAILURE"
}

^ i.e. the postgres server is in an UNKNOWN status and the analytics overall status is FAILURE. Why?

In the Management Server UI, I see this error in red when I browse to any of the pages while the fooBarEnv is selected in the top-right drop-down:

Error fetching analytics data Invalid API Call

I have followed the shell script prompts correctly. I even removed the env and re-tried it 3 times, just for good measure, and the same failure result occurs every time. I see errors in the postgres logs, but they seem to complain about the tables missing, which we already know from the postgres command above.

Does anyone have any idea how this could be happening? Thanks!

Best,

Chris

3 6 1,249
6 REPLIES 6

Not applicable

Hi @Chris,

Did you ever find a resolution to this? I'm having the exact same problem. It looks like it was caused by having a bad reference to a postgres server uUID in the system. Removing that reference allowed the enable-ax.sh script to complete, but I'm getting the same response as you in my environment. Wondering if you ever found a solution.

Thanks,

Braynt

Not applicable

Same error in my on-primse edge-

api request - executing on demand load of a/c cfg from ZK for scope fis.dev 2016-06-07 22:54:04,850 org:fis env:dev qtp393060055-212

ERROR QueryService - QueryServiceImpl.loadDSOnDemand() : Could not find group for scope fis.dev 2016-06-07 22:54:04,852 org:fis env:dev qtp393060055-212 ERROR KERNEL - ErrorMessages.getFormattedMessage() : getFormattedMessage() : Unable to locate a resource bundle for error code Could not resolve scope fis.dev 2016-06-07 22:54:04,854 org:fis env:dev qtp393060055-212 ERROR c.a.a.d.d.i.StatsDAOImpl - StatsDAOImpl.getStats() : Exception while getting stats Could not resolve scope fis.dev com.apigee.rest.framework.ResourceNotFoundException: Could not resolve scope fis.dev at com.apigee.analytics.queryservice.impl.QueryServiceImpl.query(QueryServiceIm.......'

On Edge - UI.

The report timed out Try again with a smaller date range or a larger aggregation interval.

How do i create new environment, with proper analytics configuration ??

@Chris Covney Hey Chris, were you able to resolve this issue?

If yes, can you please share the solution here.

Thanks

Mudit

@Carlos Frias @Maruti Chand

Exact same in on the QA planet.

Not applicable

Not applicable

Hi, we had a similar issue where 'apigee-service apigee-provision add-env' gave the same error. Our axgroup was correct so the previous answer did not help us. We do not know how this situation is created, or what the cause of this situation is. The issue did not automatically resolve and that blocked us to create environments.

We were able to unblock this by restarting all services on both postgres-master and postgres-slave. We did this in two steps first stopping master and slave and than starting slave and master via 'apigee-all stop' and 'apigee-all start'.

After this restart 'apigee-service apigee-provision add-env' run with success.

Restarting components is not an option for us, as we create org/env and enable analytics on-the-fly via management server API REST calls. Is there any other workaround for this bug?