Drupal Developer Portal - Error 404 when using SmartDocs Maven Plugin

Hi, Guys! Need Your help! I am using SmartDocs Maven Plugin on Drupal 8 Portal and when type maven command:

mvn install -Pdev -Dpurl='http://34.91.13.214' -Dpusername=xxx@xxxxxxx.com -Dppassword=xxxx -Dapigee.smartdocs.config.options=create

I get Error 404 - Not found. In console I get huge html with spec values. Not able to understand the reason why it works wrong. As for test I have used sample provided here:

https://github.com/apigee/apigee-smartdocs-maven-plugin/tree/master/samples/Drupal8

Pom.xml is the same. Arguments I sent in maven command. Would be extremely grateful for your help! Thanks!

Console Output:

[INFO] Scanning for projects...
[INFO] 
[INFO] -----------------------< Apigee:DeveloperPortal >-----------------------
[INFO] Building DeveloperPortal 1.0
[INFO] --------------------------------[ pom ]---------------------------------
[INFO] 
[INFO] --- maven-install-plugin:2.4:install (default-install) @ DeveloperPortal ---
[INFO] Installing D:\projects\xx\xx\apigee-jenkins\jenkins-xx-multi-config\dev_portal\pom.xml to C:\Users\alexc\.m2\repository\Apigee\DeveloperPortal\1.0\DeveloperPortal-1.0.pom
[INFO] 
[INFO] --- apigee-smartdocs-maven-plugin:2.0.1:apidoc (smartdocs-deploy) @ DeveloperPortal ---
[INFO] ************************************************************************
[INFO] API Docs
[INFO] ************************************************************************
[INFO] Get OpenAPI Specs from ./specs
[INFO] Getting API doc for httpbin.org
[INFO] Retrieving httpbin.org doc.
[ERROR] 404 Not Found
<!DOCTYPE html>
<html lang="en" dir="ltr" prefix="content: http://purl.org/rss/1.0/modules/content/  dc: http://purl.org/dc/terms/  foaf: http://xmlns.com/foaf/0.1/  og: http://ogp.me/ns#  rdfs: http://www.w3.org/2000/01/rdf-schema#  schema: http://schema.org/  sioc: http://rdfs.org/sioc/ns#  sioct: http://rdfs.org/sioc/types#  skos: http://www.w3.org/2004/02/skos/core#  xsd: http://www.w3.org/2001/XMLSchema# ">
  <head>
    <meta charset="utf-8" />
<meta name="Generator" content="Drupal 8 (https://www.drupal.org)" />
<meta name="MobileOptimized" content="width" />
<meta name="HandheldFriendly" content="true" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="canonical" href="http://34.91.13.214/page-not-found" />
<link rel="shortlink" href="http://34.91.13.214/node/19" />
<link rel="revision" href="http://34.91.13.214/page-not-found" />
0 4 455
4 REPLIES 4

Hi,


Take a look on your REST config of the smart docs, and take a look on alias there

I think it has to be exact same as your

<portal.path>smartdocs</portal.path>

in pom.xml file

(try to remove the alias for "smartdocs" on resource tab)

EDIT1: ow, its for Drupal 7. Anyway this is http service related error - did you manage to get direct response from these API's?

For looking again on your error, where you grab your spec file? Local file or httpbin?

[INFO]GetOpenAPISpecsfrom./specs
[INFO]Getting API doc for httpbin.org
[INFO]Retrieving httpbin.org doc.
[ERROR]404NotFound

Are you able to resolve the spec file directly?

Hey, Denis! Thanks for your answer! Yes, I did the direct request to standart API's and the same response - 404 Error.

Spec file lies in local folder 'specs'. So it is just relative pass.

Currently we are trying to deal with JsonAPI module in DevPortal

We have configured all needed issues on the Portal side. Now we can get JSON response from test APIs. But in Maven SmartDocs Plugin we still have problems - now 403... We have doublechecked creds and they are seemed to be ok... We are using admin user permissions. But yet it doesn't work...

[INFO] ************************************************************************
[INFO] Get OpenAPI Specs from ./specs
[INFO] Getting API doc for Swagger Petstore
[INFO] Retrieving Swagger Petstore doc.
[INFO] API Doc: Swagger Petstore does not exist
[INFO] Importing spec..
[ERROR] 403 Forbidden
{"jsonapi":{"version":"1.0","meta":{"links":{"self":{"href":"http:\/\/jsonapi.org\/format\/1.0\/"}}}},"errors":[{"title":"Forbidden","status":"403","detail":"The current user is not permitted to upload a file for this field. The \u0027add apidoc entities\u0027 permission is required.","links":{"via":{"href":"http:\/\/34.91.13.214\/jsonapi\/apidoc\/apidoc\/spec"},"info":{"href":"http:\/\/www.w3.org\/Protocols\/rfc2616\/rfc2616-sec10.html#sec10.4.4"}}}]}
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  2.539 s
[INFO] Finished at: 2020-04-21T16:55:37+03:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.apigee.smartdocs.config:apigee-smartdocs-maven-plugin:2.0.1:apidoc (smartdocs-deploy) on project DeveloperPortal: Execution smartdocs-deploy of goal com.apigee.smartdocs.config:apigee-smartdocs-maven-plugin:2.0.1:apidoc failed: Update failure: 
403 Forbidden
[ERROR] {"jsonapi":{"version":"1.0","meta":{"links":{"self":{"href":"http:\/\/jsonapi.org\/format\/1.0\/"}}}},"errors":[{"title":"Forbidden","status":"403","detail":"The current user is not permitted to upload a file for this field. The \u0027add apidoc entities\u0027 permission is required.","links":{"via":{"href":"http:\/\/34.91.13.214\/jsonapi\/apidoc\/apidoc\/spec"},"info":{"href":"http:\/\/www.w3.org\/Protocols\/rfc2616\/rfc2616-sec10.html#sec10.4.4"}}}]}
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]

Are you able to manually upload the spec to the portal and render ?

Also - Can you run the maven command using -X and share the console log. Please attach the log after removing the sensitive info (passwords)