# The API or Plugin ERROR

**URL:** https://meta.discourse.org/t/the-api-or-plugin-error/322669
**Category:** Development
**Tags:** rest-api
**Created:** [August 21, 2024, 9:59am UTC](https://meta.discourse.org/t/the-api-or-plugin-error/322669 "2024-08-21T09:59:51Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![yangxuan](https://avatars.discourse-cdn.com/v4/letter/y/8e8cbc/32.png) [@yangxuan](https://meta.discourse.org/u/yangxuan)
#### Post date: [August 21, 2024, 9:59am UTC](https://meta.discourse.org/t/the-api-or-plugin-error/322669/1 "2024-08-21T09:59:51Z")

</div>

As an administrator, I clicked on the API or Plugin button and encountered an error. How can I resolve it?

 ![image](https://global.discourse-cdn.com/meta/original/4X/e/5/1/e51d8d597e4e574e88ab671513e6d9f6085056f9.png)

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [August 21, 2024, 10:01am UTC](https://meta.discourse.org/t/the-api-or-plugin-error/322669/2 "2024-08-21T10:01:35Z")

</div>

You’ll need to say more about what you did. Also see the logs on the admin page. There sew also logs on the server at `/var/discourse/shared/standalone/logs/rails/production.log`

---

<div class="post-metadata">

### Author: ![yangxuan](https://avatars.discourse-cdn.com/v4/letter/y/8e8cbc/32.png) [@yangxuan](https://meta.discourse.org/u/yangxuan)
#### Post date: [August 21, 2024, 10:11am UTC](https://meta.discourse.org/t/the-api-or-plugin-error/322669/3 "2024-08-21T10:11:46Z")

</div>

I wrote the following query statement using PostgreSQL, then called the PostgreSQL statement with an API, and when I clicked those two buttons, an error occurred.

SELECT  
u.username,  
g.name AS group\_name  
FROM  
Users u  
JOIN  
Groups g  
ON  
u.primary\_group\_id = g.id  
WHERE  
u.username = ‘yangxuan’

SELECT  
username,  
array\_agg(id) AS ids  
FROM  
Users  
GROUP BY  
username  
HAVING  
COUNT(id) \> 1;

---

<div class="post-metadata">

### Author: ![yangxuan](https://avatars.discourse-cdn.com/v4/letter/y/8e8cbc/32.png) [@yangxuan](https://meta.discourse.org/u/yangxuan)
#### Post date: [August 22, 2024, 1:16am UTC](https://meta.discourse.org/t/the-api-or-plugin-error/322669/4 "2024-08-22T01:16:54Z")

</div>

I checked the log file and found no errors, but there was an error in the front-end, as shown in the figure below. I don’t know if it’s related to this?

 ![image](https://global.discourse-cdn.com/meta/original/4X/7/b/9/7b92efe5ed5240000fe64e68037cf51f056ba1e7.png)

---

<div class="post-metadata">

### Author: ![Lhc\_fl](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/lhc_fl/32/268115_2.png) [@Lhc\_fl](https://meta.discourse.org/u/Lhc_fl)
#### Post date: [August 22, 2024, 6:40am UTC](https://meta.discourse.org/t/the-api-or-plugin-error/322669/5 "2024-08-22T06:40:50Z")

</div>

Can you share what steps you took, which URL you visited, what logs are in the console? What plugins did you install, which third-party plugins?

After the error occurs, try going to `https://yourforum.com/logs` to view the site logs. The latest log may reveal why the error occurred. Copying it here will be more helpful.

---

<div class="post-metadata">

### Author: ![yangxuan](https://avatars.discourse-cdn.com/v4/letter/y/8e8cbc/32.png) [@yangxuan](https://meta.discourse.org/u/yangxuan)
#### Post date: [August 22, 2024, 6:54am UTC](https://meta.discourse.org/t/the-api-or-plugin-error/322669/6 "2024-08-22T06:54:39Z")

</div>

Currently, when clicking on Plugin or API, an error appears in Figure 1. The logs circled in Figure 2 are related to the plugins.

 ![image](https://global.discourse-cdn.com/meta/original/4X/7/c/4/7c40c03e3e8f851d144e8a8b873ea1c0482c861f.png)

 ![image](https://global.discourse-cdn.com/meta/original/4X/1/c/d/1cd0dec82abb4b9a8ee7ce5a7ab83783408085e6.png)

---

<div class="post-metadata">

### Author: ![Lhc\_fl](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/lhc_fl/32/268115_2.png) [@Lhc\_fl](https://meta.discourse.org/u/Lhc_fl)
#### Post date: [August 22, 2024, 7:00am UTC](https://meta.discourse.org/t/the-api-or-plugin-error/322669/7 "2024-08-22T07:00:46Z")

</div>

discourse-username-localization should have been depreciated. Support for unicode usernames is now in core (see [Unicode usernames and group names](https://meta.discourse.org/t/unicode-usernames-and-group-names/117737) ), so you should be able to uninstall it safely.

---

<div class="post-metadata">

### Author: ![yangxuan](https://avatars.discourse-cdn.com/v4/letter/y/8e8cbc/32.png) [@yangxuan](https://meta.discourse.org/u/yangxuan)
#### Post date: [August 22, 2024, 7:13am UTC](https://meta.discourse.org/t/the-api-or-plugin-error/322669/8 "2024-08-22T07:13:00Z")

</div>

Okay, thanks a lot for your help. What exactly caused this front-end error (Error while processing route: adminplugins. index)?

---

<div class="post-metadata">

### Author: ![Lhc\_fl](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/lhc_fl/32/268115_2.png) [@Lhc\_fl](https://meta.discourse.org/u/Lhc_fl)
#### Post date: [August 22, 2024, 7:14am UTC](https://meta.discourse.org/t/the-api-or-plugin-error/322669/9 "2024-08-22T07:14:57Z")

</div>

It is impossible to be sure based on the existing logs. Can you try to expand the console error log and copy the contents here?

---

<div class="post-metadata">

### Author: ![yangxuan](https://avatars.discourse-cdn.com/v4/letter/y/8e8cbc/32.png) [@yangxuan](https://meta.discourse.org/u/yangxuan)
#### Post date: [August 22, 2024, 8:18am UTC](https://meta.discourse.org/t/the-api-or-plugin-error/322669/10 "2024-08-22T08:18:30Z")

</div>

![image](https://global.discourse-cdn.com/meta/original/4X/3/e/f/3efb3d7424651b4690f96a379029fdeeac7a9065.png)

The following file is from the console and the format is a bit messy, so I took a screenshot.

[community.mech-mind.com.cn-1724314264273.log.txt](https://meta.discourse.org/uploads/short-url/h8XSBqfhrfHVeWzBGSGbFafVOQX.txt) (173.3 KB)
