Cannot run admin after forest-express-mongoose v9 update

We noticed issues on some features on our admin, we decided to update agent version to v9.
Post upgrade the build won’t succeed on production. Getting following error:

  • Project name: NachamuAdmin
  • Team name: Operations
  • Environment name: Development
1 Like

Hello @aayush-sinha,

Can you please indicate the version you’re upgrading from?

Also, do you have more info about the error? It would be useful to have the stack trace and the error message to help you find the problem.

Hey @GuillaumeGautreau
Previous version details -
“forest-express-mongoose”: “^7.0.5”

Thanks

Ok, then you need to follow the documentation to upgrade to v8 and then to v9:

There are some modifications to make in the code for every major version.

Also, I would need more info about the error to help you more.

Hey @aayush-sinha, I am also facing the same issue. I am not getting exact solution of this problem yet.

@Dann if you have an issue, please create a different ticket with the details about your project and the error.

@GuillaumeGautreau I have upgraded to version 8. All my smart actions have stopped working.
Getting error: {
“error”: “Smart Action: failed to evaluate permissions”
}
Example of smart action route:

{ 
      name: 'Approve Community News',
      type: 'single',
      fields: [
        {
          field: 'Modifications',
          description: 'If Any (Please leave the field blank if no modifications made.)',
          type: 'String',
        },
        {
          field: 'Send Email',
          type: 'Boolean',
          isRequired: true
        }
      ],
    },
router.post('/actions/approve-community-news', permissionMiddlewareCreator.smartAction(), async (req, res) => {
  const attrs = req.body.data.attributes;
  

  try {
   // business logic
    }
  } catch (e) {
    console.log(e);
  }

  res.send({ success: `Post Approved!` });
});

Thanks for the details.

I’m investigating your issue, but on our side we have the info that you are using v8.0.0 of forest-express-mongoose.

The last version on this major is 8.7.10, can you please try to upgrade to this one? Please let me know if it fixes your issue.

It seems that the bug is caused by an error thrown in the code, but this error is not logged. If upgrading does not fix your issue, I’ll make a small improvement in the code to log the actual error, it’ll give us more info to help you.