apigee / apigee-api-catalog-drupal

Manage your API catalog within Drupal's content management approach
https://www.drupal.org/project/apigee_api_catalog
GNU General Public License v2.0
17 stars 16 forks source link

Issues upgrading API Catalog - pantheon.apidoc table doesn't exist #106

Closed cbzdok closed 4 years ago

cbzdok commented 4 years ago

When trying to update the API Catalog to the next version we are receiving the following error:

Drupal\Core\Database\DatabaseExceptionWrapper: "SQLSTATE[42S02]: Base table or view not found: 1146 Table 'pantheon.apidoc' doesn't exist

same thing goes for viewing apidocs. I assume there is some configuration issue perhaps with schema name but do not know the right way to resolve this.

Uncaught PHP Exception Drupal\Core\Database\DatabaseExceptionWrapper: "SQLSTATE[42S02]: Base table or view not found: 1146 Table 'pantheon.apidoc' doesn't exist: SELECT revision.revision_id AS revision_id, revision.langcode AS langcode, revision.revision_user AS revision_user, revision.revision_created AS revision_created, revision.revision_log_message AS revision_log_message, revision.revision_default AS revision_default, base.id AS id, base.uuid AS uuid, CASE base.revision_id WHEN revision.revision_id THEN 1 ELSE 0 END AS isDefaultRevision FROM {apidoc} base INNER JOIN {apidoc_revision} revision ON revision.revision_id = base.revision_id WHERE base.id IN (:db_condition_placeholder_0); Array ( [:db_condition_placeholder_0] => 2 ) " at /code/web/core/lib/Drupal/Core/Database/Connection.php line 701

arlina-espinoza commented 4 years ago

Hi @cbzdok , could you specify what version were you using previous to trying to update? Thanks!

cbzdok commented 4 years ago

Hi Arlina thank you for your quick response.

We are using the Apigee Kickstarter and currently on 8.x-2.2 for API Catalog trying to go to 8.x-2.3.

Apigee API Catalog https://www.drupal.org/project/apigee_api_catalog 8.x-2.2 8.x-2.3 (Release notes https://www.drupal.org/project/apigee_api_catalog/releases/8.x-2.3)

On Wed, Sep 2, 2020 at 2:32 AM Arlina Espinoza Rhoton < notifications@github.com> wrote:

Hi @cbzdok https://github.com/cbzdok , could you specify what version were you using previous to trying to update? Thanks!

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/apigee/apigee-devportal-kickstart-drupal/issues/417#issuecomment-685339935, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAPESCKNJLU7AXWUFGTMRQTSDXRITANCNFSM4QSICLCQ .

-- Carey A. Bzdok

arlina-espinoza commented 4 years ago

Moving to the apigee_api_catalog issue queue to follow up.

kscheirer commented 4 years ago

@cbzdok I ran into the same issue. There was also an error on the Status Report page saying something like 'Entity type api_doc was not installed'.

This is not the correct solution, but the following will re-install the apidoc entity type and resolve the error, allowing the site to render again.

drush ev "\Drupal::entityDefinitionUpdateManager()->installEntityType(\Drupal::entityTypeManager()->getDefinition('apidoc'))"

Obviously there should be no need for the entity type since it was converted to a content type.

kscheirer commented 4 years ago

Ok, the real fix is to edit your Home landing page node (probably node/1/edit in most cases). Edit the 3 links from the Cards. They should be links to the new apidoc nodes (probably node/17 - node/22 or so).

If they are links to the old apidoc entities (probably api/1-api/5 or so), that causes this error. Drupal tries to perform an access check, which fails because the entities no longer exist. @cbzdok.

@jbennett13 - probably worth adding to documentation somewhere.

arlina-espinoza commented 4 years ago

That's a great find @kscheirer , thanks! I had been wondering where were old apidoc entities trying to get instantiated, but this makes a lot of sense.

cbzdok commented 4 years ago

Well dang... I was so excited to get past this and I think I sort of did but now i've run into the following error: Uncaught PHP Exception Drupal\Component\Plugin\Exception\InvalidPluginDefinitionException: "The "apidoc" entity type did not specify a access handler." at /code/web/core/lib/Drupal/Core/Entity/EntityTypeManager.php line 272

arlina-espinoza commented 4 years ago

@cbzdok Could you try the steps documented by @kscheirer in this comment: https://github.com/apigee/apigee-devportal-kickstart-drupal/issues/391#issuecomment-696251750

shadcn commented 4 years ago

I'm seeing the same issue as noted by @cbzdok above.

It looks like we added src/Entity/ApiDoc.php back in the upgrade path PR but missed the access handler (Drupal\apigee_api_catalog\Entity\Access\ApiDocAccessControlHandler).

See https://github.com/apigee/apigee-api-catalog-drupal/pull/85/files#diff-c11abe0d0c4015284f6a155e8d25d8c4

@cbzdok I'm going to check with @arlina-espinoza and get back to you. Thank you.

cbzdok commented 4 years ago

Thank you, do you have any update?

On Sep 24, 2020 at 1:55 AM, <arshad (mailto:notifications@github.com)> wrote:

I'm seeing the same issue as noted by @cbzdok (https://github.com/cbzdok) above.

It looks like we added src/Entity/ApiDoc.php back in the upgrade path PR but missed the access handler (Drupal\apigee_api_catalog\Entity\Access\ApiDocAccessControlHandler).

See https://github.com/apigee/apigee-api-catalog-drupal/pull/85/files#diff-c11abe0d0c4015284f6a155e8d25d8c4

@cbzdok (https://github.com/cbzdok) I'm going to check with @arlina-espinoza (https://github.com/arlina-espinoza) and get back to you. Thank you.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub (https://github.com/apigee/apigee-api-catalog-drupal/issues/106#issuecomment-698129571), or unsubscribe (https://github.com/notifications/unsubscribe-auth/AAPESCOJKPYE4SS2QPLLSJDSHLNL5ANCNFSM4RFUZHUA).

arlina-espinoza commented 4 years ago

@cbzdok We have added back the missing access control handler, and should be available in the next release of the module.

cbzdok commented 4 years ago

Thank you Arlina - do you have a timeframe in which to expect that release? We are dependent upon the resolution to move forward with our dev portal.

On Sep 29, 2020 at 6:32 PM, <Arlina Espinoza Rhoton (mailto:notifications@github.com)> wrote:

@cbzdok (https://github.com/cbzdok) We have added back the missing access control handler, and should be available in the next release of the module.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub (https://github.com/apigee/apigee-api-catalog-drupal/issues/106#issuecomment-701027149), or unsubscribe (https://github.com/notifications/unsubscribe-auth/AAPESCLGLRWE4MSR3DPZXO3SIJN7RANCNFSM4RFUZHUA).

shadcn commented 4 years ago

Apigee API catalog 8.x-2.4 was released yesterday: https://www.drupal.org/project/apigee_api_catalog/releases/8.x-2.4

cbzdok commented 4 years ago

Awesome thank you. Any idea on how to upgrade with the issues present? everytime I try to upgrade the following errors are thrown which is preventing me from moving to the new version:

[01-Oct-2020 17:43:49 UTC] Uncaught PHP Exception Drupal\Component\Plugin\Exception\InvalidPluginDefinitionException: "The "apidoc" entity type did not specify a access handler." at /code/web/core/lib/Drupal/Core/Entity/EntityTypeManager.php line 272 [01-Oct-2020 17:46:11 UTC] Uncaught PHP Exception Drupal\Core\Database\DatabaseExceptionWrapper: "SQLSTATE[42S02]: Base table or view not found: 1146 Table 'pantheon.apidoc' doesn't exist: SELECT base_table.revision_id AS revision_id, base_table.id AS id FROM {apidoc} base_table GROUP BY base_table.revision_id, base_table.id LIMIT 1 OFFSET 0; Array ( ) " at /code/web/core/lib/Drupal/Core/Database/Connection.php line 701 [01-Oct-2020 17:49:42 UTC] Uncaught PHP Exception Drupal\Component\Plugin\Exception\InvalidPluginDefinitionException: "The "apidoc" entity type did not specify a access handler." at /code/web/core/lib/Drupal/Core/Entity/EntityTypeManager.php line 272

On Wed, Sep 30, 2020 at 10:37 PM arshad notifications@github.com wrote:

Apigee API catalog 8.x-2.4 was released yesterday: https://www.drupal.org/project/apigee_api_catalog/releases/8.x-2.4

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/apigee/apigee-api-catalog-drupal/issues/106#issuecomment-701771850, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAPESCPRPBBOULEZSSSX2HLSIPTOJANCNFSM4RFUZHUA .

-- Carey A. Bzdok

cbzdok commented 4 years ago

Is anyone able to help with the current issue mentioned above? Now that the db seems to be in a bad state I am unable to upgrade to the version with the fix.