No Products Displayed in Add new App screen

This is for a private installation.

On the "Add new App" screen we do not see any products listed. We have products available on Edge.

If I add the product manually to the developer on Edge, I can see it on the Dev Portal in the "My Apps" section, but when I try to add a new App from DevPortal the Products list is not showing any products.

Other posts referred to clearing the cache and checking the connection status. Both were done, but we are still seeing no products listed.

anything else we can check?

Update:

We have identified that the products are not displayed if the check box

/admin/config/devconnect/apps - Cache Settings -

Checkbox "enable the API Product Cache"

When the above check box is ticked, no products are displayed in the "Add new App" screen

When the above checkbox is un-ticked, products are displayed

Any suggestions on what can be causing this?

1 4 366
4 REPLIES 4

Any suggestions on what can be causing this?

Mmm, well let's see. Here's how the cache is supposed to work for the API Products list....

  1. first visitor arrives, user1, tries to add an app
  2. Devportal queries the Apigee Edge Mgmt server, gets list of API Products
  3. devportal stores that list in cache
  4. devportal renders the list (dropdown list, or list of radio buttons) in the UI for user1
  5. user1 completes his work
  6. user2 arrives at devportal
  7. devportal uses the cached API Product list to render the list of products in the UI for user2
  8. user2 does whatever she wants to do...
  9. etc

If you untick the box labeled "enable the API Product Cache", then devportal never relies on the cache, and always queries the Management Server for the list of products, for every user.

What I would expect is.... if you untick the box, exercise the UI, then re-tick the box,... the cache would be filled with fresh data. In other words it would cause the cache to be refreshed.

You may also reset the cache explicitly by logging in as an administrator, and clicking the home button and "Flush all caches".

5805-flush-all-caches.png

I would expect that an empty list of API Products might result from a stale cache, ONCE, but after resetting the cache, the API Products list would be filled correctly.

Is that not what is happening?

If not, the easy avoidance here is to just untick the box. There will be performance implications if your devportal is very busy - for example if you have hundreds of visitors per day. If you have 10-20 visitors per day, the performance implication will be negligible.

Flush all caches, does not result in any difference in the behavior. I receive a message that the operation was successful, but the behavior remains the same.

The load right now is negligible and we can work with no caching of products, but I would like to figure out the reason now instead of rushing when the load increases.

Any hints on what else we can check or which logs to view to look for errors?

I have already looked into /admin/reports/dblog but nothing their related to these actions

Mmmm, yes, I would suggest looking at the admin reports but you've done that already. The other thing you can do is instrument the appropriate code in the devconnect module, the specific code where it calls out to the Apigee Edge Mgmt server. Then you can directly inspect the calls out and the responses.

That means spelunking into

~/profiles/apigee/modules/custom/devconnect/devconnect_developer_apps/devconnect_developer_apps.module

...and specifically around function devconnect_developer_apps_get_api_products.

The entity_load() call is the thing that calls out to Apigee Edge. You can see the logic in that module like this:

function devconnect_developer_apps_get_api_products($show_private = FALSE, $names = FALSE, $org_name = 'default') {
  if ($org_name == 'default') {
    $config = devconnect_get_org_settings();
    $org_name = $config['org'];
  }
  if (!variable_get('devconnect_api_product_cache_enable', 1)) {
    return entity_load('api_product', $names, array(
      'show_private' => $show_private,
      'orgName' => $org_name,
    ));
  }
  ...

...which is where it checks for "cache enabled" and then calls out to Edge if the cache is disabled. (In my quick review of that code, it sure seems like the cache ought to be populated with what comes back...)

But anyway, you can investigate what's happening by examining the operation of that function. You can add "log" messages that will appear in /admin/reports/dblog by adding code like this:

  watchdog("label", "Message message message", array(), WATCHDOG_INFO);

Look around in the code for other uses of watchdog to see what the other options are.

Good luck!

This is a fresh install of the Devportal. it is very odd that we would have to go through internal code to correct a basic caching feature!