VirtusLab-Open-Source/strapi-plugin-comments

Dashboard Error 500: comments.app.components.notification.error

matepaiva opened this issue ยท 13 comments

Debug process

  1. When I visit /admin/plugins/comments/discover to see the comments, a lot of errors happens with the same message as the image below.
  2. I have published and pending comments and I can GET them via API, so that part is working as expected.
  3. The plugin is making a GET request to /comments/moderate/all and that request is returning status 500. I think the problem is there.
  4. Therefore, I verified the log and found the following error: select t0.* from articlesast0 where (t0.id in (124260, NaN)) - ER_BAD_FIELD_ERROR: Unknown column 'NaN' in 'where clause' Error: ER_BAD_FIELD_ERROR: Unknown column 'NaN' in 'where clause'
  5. Here you can see the API GET response that is working fine: https://data.anteprojectos.com.pt/api/comments/api::article.article:124260/flat/

Note: The problem only happens at the backoffice and does not affect the API.

I hope the info above helps you with the debug process :)

image

@matepaiva

can you please provide the article collection you're using and how many of them you've got created? That seems for me like a limit issue as NaN appears in the automated DB query.

Also plugin config is going to be welcome.

Thanks for investigating it with me!

  • I am using the latest version of both plugin and Strapi;
  • my article collection has 10217 items;
  • my config:
comments: {
    enabled: true,
    config: {
      badWords: false,
      moderatorRoles: [],
      approvalFlow: ['api::article.article'],
      entryLabel: {
        'api::article.article': [
          'Title',
          'title',
          'Name',
          'name',
          'Subject',
          'subject',
        ],
      },
    },
  },

i have the exact same error, what i did is add subcomment and then delete the parent thread.

i have the exact same error, what i did is add subcomment and then delete the parent thread.

@khocef you've deleted the thread in database? Or using the delete endpoint of client service?

@cyp3rius using the delete endpoint

remove(commentId: number, pageId: number, authorId: number): Observable<any> {
    return this.http.delete(`http://localhost:1337/api/comments/api::page.page:${pageId}/comment/${commentId}?authorId=${authorId}`);
}

Thanks for confirming, will check that also

@khocef this issue somehow has been fixed in v2.1.7, can you check and confirm?

@matepaiva still working on a big set of entities.

@cyp3rius thank you a lot, its working great now <3

It's happening again in v2.2.1. The error occurs as soon as I have at least one comment. It doesn't show this error when I removed and reinstalled the plugin without any comments.

image

Here is my settings
image

I tried deleting all comments, remove plugin and reinstall, but still no luck at all.

My temporary workaround now is to do this in the lib (add ? to populate.count => populate?.count)
@strapi/database/lib/query/helpers/populate/apply.js
image

@Dope-Engineers case with large set of comments is exactly what we already found but it is a modification in the Strapi core libs. We are working on some custom solution here, directly in a plugin

Sitll happening . The last update brokes my extensions too. We really are waiting your update.,

I had the same issue so I updated to version 2.2.4 and it worked too.

Closing as seems to be fixed in recent releases.