HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

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.


  • Options
    charrondevcharrondev Developer Lead (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?

  • Options


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

      "status": 404,

      "description": null


  • Options
    charrondevcharrondev Developer Lead (PHP, JS) Montreal Vanilla Staff

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

  • Options
  • Options

    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.

  • Options

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

    ed@dev:~/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

    ed@dev:~/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

  • Options

    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?

  • Options

    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.

  • Options
    charrondevcharrondev Developer Lead (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.

  • Options

    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!

  • Options
    charrondevcharrondev Developer Lead (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?

  • Options

    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.


Sign In or Register to comment.