Receiving "424 failed dependency" errors on forest-express-mongoose when upgraded to any of the v9 variants

@Florian_Gonzales

Feature(s) impacted

All data display.

Observed behavior

When I modify to package.json generated by forest-cli (v3.0.5) so that project would depend on any of v9 versions of the the forest-express-mongoose package, any attempt to view data from the client or the backend causes 424 - FAILED_DEPENDENCY errors.

This doesn’t happen when I upgrade to later v8 variants like v8.7.9, and the data is displayed normally. I can also observe the same problem when I instead, just override the dependency for forest-express through package.json so that it would resolve v9.0.1 (which is what I actually need).

For easy reproduction of the problem, here’s some package.json versions where I can observe the problem:

  "dependencies": {
    "body-parser": "1.19.0",
    "chalk": "~1.1.3",
    "cookie-parser": "1.4.4",
    "cors": "2.8.5",
    "debug": "~4.0.1",
    "dotenv": "~6.1.0",
    "express": "~4.17.1",
    "express-jwt": "6.1.2",
    "forest-cli": "^3.0.5",
    "forest-express-mongoose": "^9.0.3",
    "mongoose": "~5.13.9",
    "morgan": "1.9.1",
    "require-all": "^3.0.0"
  }
.....
  "dependencies": {
    "body-parser": "1.19.0",
    "chalk": "~1.1.3",
    "cookie-parser": "1.4.4",
    "cors": "2.8.5",
    "debug": "~4.0.1",
    "dotenv": "~6.1.0",
    "express": "~4.17.1",
    "express-jwt": "6.1.2",
    "forest-express-mongoose": "^8.0.0",
    "morgan": "1.9.1",
    "require-all": "^3.0.0",
    "mongoose": "~5.13.9"
  },
  "overrides": {
    "forest-express-mongoose": {
      "forest-express": "^10.0.1 "
    }
  }

Here’s one that works correctly:

  "dependencies": {
    "body-parser": "1.19.0",
    "chalk": "~1.1.3",
    "cookie-parser": "1.4.4",
    "cors": "2.8.5",
    "debug": "~4.0.1",
    "dotenv": "~6.1.0",
    "express": "~4.17.1",
    "express-jwt": "6.1.2",
    "forest-express-mongoose": "^8.7.9",
    "morgan": "1.9.1",
    "require-all": "^3.0.0",
    "mongoose": "~5.13.9"
  }

I’m not sure what FAILED_DEPENDENCY refers to in this context as I couldnt track where the status code is returned, but if this is indeed related to node dependencies, I appreciate a version of the dependency tree that might work!

Thanks!

Expected behavior

I expect to see my data in the newer versions of the project.

Failure Logs

Browser logs:

XHRGET http://localhost:3310/forest/action/count?fields[action]=condition,execution,id,name&timezone=Europe/London
[HTTP/1.1 424 Failed Dependency 4ms] HttpError: HTTP Error 424: Failed Dependency

Context

  • Project name: zi-studio
  • Team name: zi-studio
  • Environment name: development & mongo
  • Agent type & version: detailed above
  • Recent changes made on your end if any: detailed above

Hello @psilocybe,

Thanks for your feedback.

This new version 9 requires your project to use the roles for access control. This feature has been introduced with an older version of forest-express-mongoose and requires a migration on your side to be fully active.

For information, you can find the documentation here about migrating to v9.

Starting from v9, roles must be used in projects, and thus you need to migrate your access control to the new role system, as explained in this documentation.

Your project required a manual action from our side to activate the possibility to migrate, and we just did the change.

Your next steps, to be able to upgrade to v9:

  1. Use the version 8 of forest-express-mongoose for now
  2. Access the project settings of your project
  3. Open the roles tab
  4. Click on “Learn more” in the warning area, indicating that a new version is present
  5. Migrate your different profiles to roles
  6. Restart your agents
  7. Validate that everything is OK with users, or adjust role permissions
  8. Once done, you’ll be able to migrate to v9

Thas was indeed the problem @GuillaumeGautreau, many thanks!