Users running a non-download version of Vanilla (pulled from github), on branch release/2019.016 or master from the last 2 weeks should upgrade to release/2019.017 or latest master for security reasons. Downloaded official open sources releases are not affected.

dist/admin/async~mountEditor.min.js problem in Vanilla 3.1

After upgrading to 3.1 (from 2.8.3 to 3.0.2 to 3.1), I noticed that the Dashboard->Settings->Technical->APIv2 page wasn't working... just showing the message "No API definition provided." The actual API URLs were working (i.e. /vanilla/api/v2/xxxx).

It appears that the file: dist/admin/async~mountEditor.min.js

in 3.1 is referencing /api/v2/open-api/v3, which doesn't work.

If I change the reference in async~mountEditor.min.js to /api/v2/open-api/v2, the problem is resolved and I can see the normal API calls on this page. I doubt that this is the correct solution, but I don't know much about the internals of Vanilla.

Comments

  • charrondevcharrondev Application Developer (PHP, JS) Montreal Vanilla Staff

    Vanilla 3.1 definitely ships with an /api/v2/open-api/v3 endpoint. See the controller here:

    Do you have a particular error when trying to access that endpoint?

  • {

      "message": "/api/v2/open-api/v3 not found.",

      "status": 404,

      "description": null

    }

  • charrondevcharrondev Application Developer (PHP, JS) Montreal Vanilla Staff

    Could you share me the contents of your /dashboard/controllers/api/OpenApiApiController ?

  • Looks like the install of 3.1 left the old file there too in dashboard/controllers... and I don't see anything in the upgrade notes that say to remove it.

  • There seems to be some extra things in plugins/swagger-ui in my installed tree vs. the dist files:


    [email protected]:~/dist/tmp$ ls -al /var/www/html/vanilla/plugins/swagger-ui/

    total 76

    drwxr-xr-x 6 www-data www-data 4096 Apr 23 18:07 .

    drwxr-xr-x 30 www-data www-data 4096 Aug 15 16:05 ..

    -rw-r--r-- 1 www-data www-data  466 Aug 16 13:05 addon.json

    -rw-r--r-- 1 www-data www-data  50 Sep 24 2018 .babelrc

    drwxr-xr-x 2 www-data www-data 4096 Sep 24 2018 design

    drwxr-xr-x 2 www-data www-data 4096 Aug 16 13:38 js

    drwxr-xr-x 5 www-data www-data 4096 Apr 23 18:07 src

    -rw-r--r-- 1 www-data www-data 34054 Aug 16 13:05 swagger.png

    -rw-r--r-- 1 www-data www-data 1337 Aug 16 13:05 SwaggerUIPlugin.php

    drwxr-xr-x 3 www-data www-data 4096 Apr 23 18:07 views

    -rw-r--r-- 1 www-data www-data  365 Aug 16 13:05 yarn.lock

    [email protected]:~/dist/tmp$ ls -al package/plugins/swagger-ui/

    total 64

    drwxr-xr-x 4 ed ed 4096 Jul 10 16:28 .

    drwxr-xr-x 30 ed ed 4096 Jul 10 16:28 ..

    -rw-r--r-- 1 ed ed  466 Jul 10 16:28 addon.json

    drwxr-xr-x 4 ed ed 4096 Jul 10 16:28 src

    -rw-r--r-- 1 ed ed 34054 Jul 10 16:28 swagger.png

    -rw-r--r-- 1 ed ed 1337 Jul 10 16:28 SwaggerUIPlugin.php

    drwxr-xr-x 3 ed ed 4096 Jul 10 16:28 views

    -rw-r--r-- 1 ed ed  365 Jul 10 16:28 yarn.lock

  • I upgraded from 2.6 to 3.2 and have the identical issue. R_J has been trying to help me work through this but so far no joy.

    I even went so far as to set up a test environment, restore my pre-upgrade site and database and carefully upgrade again. Same results; the API V2 panel was displaying endpoints in Vanilla 2.6 and in 3.2 all I get is "No API definition provided."

    Details can be found here.

    Is there a resolution to this?

  • http://<myUrl>/api/v2/open-api/v3 yields a 404.

    http://<myUrl>/api/v2/open-api/v2 yields a response with a lot of json which probably would generate the panel.

  • charrondevcharrondev Application Developer (PHP, JS) Montreal Vanilla Staff

    @toolsmythe Out of curiosity, is your site served out of a subfolder? Eg. mysite.com/forum ?

    We've been having a lot of issues with URLs in subdomains in recent months and are tackling it for the next release. As part of that process many of our developers have switched our local setups to serve out of a subfolder, and discovered a lot of issues (and fixed most of them). This was one of them.

  • It is. I hit it as a subdomain.

    Thanks so much for getting back to me! Looking forward to the fixes!!

    One thing I found in 3.2 that I'm guessing is not folder related is when I edit a post and attempt to save it I get an error message that complains of a missing column called 'Active'. I then cancel out of the edit and find out that the save actually worked.

    I tracked the table down to the Media table (though utility/structure does not catch this). Added the column and the issue went away.

    This happened in both my live and dev instances.

    Thanks again!

  • charrondevcharrondev Application Developer (PHP, JS) Montreal Vanilla Staff

    Did you run a /utility/update after upgrading? That should have added the active column for you. The code for it is here:

    If you did, but it didn't work, do you happen to have a very large amount of records in your GDN_Media table?

  • Sorry for the long delay; I somehow missed this question.

    Yes, I DID run /utility/update.

    And no. This is a very small, very specialized site. Not a lot of records anywhere actually.

    JP

Sign In or Register to comment.