• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Access Control Error Codes
2
3<!--Kit: Ability Kit-->
4<!--Subsystem: Security-->
5<!--Owner: @xia-bubai-->
6<!--SE: @linshuqing; @hehehe-li-->
7<!--TSE: @leiyuqian-->
8
9> **NOTE**
10>
11> This topic describes only module-specific error codes. For details about universal error codes, see [Universal Error Codes](../errorcode-universal.md).
12
13## 12100001 Invalid Parameters
14
15**Error Message**
16
17Invalid Parameter. Error message: messageInfo.
18
19**Possible Causes**
20
211. The value of **tokenId** is **0**.
222. The permission name is empty or exceeds 256 characters.
233. The **flag** value in the permission authorization or revocation request is invalid.
244. The parameters specified for registering a listener are incorrect.
255. The specified context does not belong to the current application.
266. The requested permissions do not belong to the same permission group.
277. The requested permissions include permissions that are not declared by the application.
288. The type of the requested global switch is invalid.
299. The specified permission is not [a user_grant permission](../../security/AccessToken/permissions-for-all-user.md).
3010. The number of array members exceeds 1024 or all members are invalid.
3111. The start time and end time of the permission usage record to be viewed are invalid.
3212. The specified permission is not declared in the application.
33
34**Solution**
35
36Check that the input parameters are set to valid values by referring to the [API parameters](js-apis-abilityAccessCtrl.md).
37
38<!--Del-->
39## 12100002 TokenId Not Exist
40
41**Error Message**
42
43TokenId does not exist.
44
45**Possible Causes**
46
471. The specified **tokenId** does not exist.
482. The process of the specified **tokenId** is not an application process.
49
50**Solution**
51
52Check the input parameter and confirm that the **tokenId** is the identity of the target application.
53
54<!--Del-->
55## 12100003 Permission Not Exist
56
57**Error Message**
58
59Permission does not exist.
60
61**Possible Causes**
62
631. The specified permission does not exist in the system, including the permission is not defined or the permission type does not match.
642. The specified permission name does not match the **tokenId** in the permission authorization or revocation scenario.
653. The specified permission name is not a sensitive permission that requires user authorization.
66
67**Solution**
68
69Check and correct input parameters. For details about the valid values, see [Permission List](../../security/AccessToken/app-permissions.md).
70<!--DelEnd-->
71
72## 12100004 Listener APIs Not Used in Pairs
73
74**Error Message**
75
76The API is not used in pair with others.
77
78**Possible Causes**
79
801. One of the listener APIs that must be used in pairs is repeatedly called.
812. One of the listener APIs that must be used in pairs is independently called.
82
83**Solution**
84
851. For the APIs that must be used in pairs, for example, **on()** and **off()**, check whether **on()** with the same parameters is called again before **off()** is called.
862. For the APIs that must be used in pairs, for example, **on()** and **off()**, check whether **off()** is called before **on()**.
87
88
89## 12100005 Listener Overflows
90
91**Error Message**
92
93The number of listeners exceeds the limit.
94
95**Possible Causes**
96
97The number of listeners exceeds 200.
98
99**Solution**
100
101Release unused listeners in a timely manner.
102
103<!--Del-->
104## 12100006 Permission Granting or Revocation Not Supported
105
106**Error Message**
107
108The specified application does not support the permissions granted or ungranted as specified.
109
110**Possible Causes**
111
1121. The specified **tokenId** is the identity of a remote device. Distributed granting and revocation are not yet supported.
1132. The specified **tokenId** belongs to a sandbox application, which is not allowed to request the specified permission.
114
115**Solution**
116
1171. Check whether the method of obtaining the **tokenId** is correct.
1182. Check whether the sandbox application works in restrictive mode. Most permissions cannot be granted to a sandbox application in restrictive mode.
119<!--DelEnd-->
120
121## 12100007 System Service Not Working Properly
122
123**Error Message**
124
125The service is abnormal.
126
127**Possible Causes**
128
1291. The permission management service cannot start properly.
1302. The read or write of IPC data fails.
131
132**Solution**
133
134Try again later or restart the device.
135
136<!--Del-->
137## 12100008 Out of Memory
138
139**Error Message**
140
141Out of memory.
142
143**Possible Causes**
144
145The system memory is insufficient.
146
147**Solution**
148
149Try again later or restart the device.
150<!--DelEnd-->
151
152## 12100009 Internal Service Error
153
154**Error Message**
155
156Common inner error.
157
158**Possible Causes**
159
160An internal error occurs in the system service.
161
162**Solution**
163
164Analyze the fault log to identify the error.
165
166## 12100010 Pending Request
167
168**Error Message**
169
170The request already exists.
171
172**Possible Causes**
173
174The last request has not been processed yet.
175
176**Solution**
177
178Wait until the last request is processed.
179
180
181## 12100011 All Requested Permissions Granted
182
183**Error Message**
184
185All permissions in the permission list have been granted.
186
187**Possible Causes**
188
189All requested permissions have been granted.
190
191**Solution**
192
193No action is required. If this error code is returned, the permission has been granted and the permission settings dialog box will not be displayed.
194
195
196## 12100012 Not All Permissions Are Rejected by the User
197
198**Error Message**
199
200The permission list contains the permission that has not been revoked by the user.
201
202**Possible Causes**
203
204The requested permissions include the permissions that are not rejected by the user.
205
206**Solution**
207
208Call **requestPermissionsFromUser** to request permissions from the user first.
209
210
211## 12100013 Global Switch Enabled
212
213**Error Message**
214
215The specific global switch is already open.
216
217**Possible Causes**
218
219The global switch is already turned on.
220
221**Solution**
222
223No action is required. If this error code is returned, the global switch has been enabled and the dialog box for setting the global switch will not be displayed.
224