• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# RPC Error Codes
2<!--Kit: IPC Kit-->
3<!--Subsystem: Communication-->
4<!--Owner: @xdx19211@luodonghui0157-->
5<!--SE: @zhaopeng_gitee-->
6<!--TSE: @maxiaorong2-->
7
8> **NOTE**
9>
10> This topic describes only module-specific error codes. For details about universal error codes, see [Universal Error Codes](../errorcode-universal.md).
11
12The APIs of the **rpc** module return exceptions since API version 9. The following describes the error codes.
13
14## 1900001 Failed to Call mmap
15
16**Error Message**
17
18Failed to call mmap.
19
20**Description**
21
22The mmap function failed.
23
24**Possible Causes**
25
261. The mapping area is too large.
272. There is no sufficient memory for mapping.
28
29**Solution**
30
311. Check whether the memory specified in **Ashmem::create()** is too large.
322. Check whether the system has sufficient memory for the mapping operation.
33
34## 1900002 Failed to Call ioctl
35
36**Error Message**
37
38Failed to call ioctl.
39
40**Description**
41
42Failed to call **ioctl** with the shared memory file descriptor.
43
44**Possible Causes**
45
461. Invalid kernel parameters are set.
472. The specified type does not comply with the types specified when the shared memory is mapped.
48
49**Solution**
50
511. Check whether the specified parameters are **PROT_EXEC**, **PROT_READ**, and **PROT_WRITE** of the **Ashmem** class.
522. Check whether the type specified is one of the types specified when the shared memory is mapped.
53
54## 1900003 Failed to Write Data to the Shared Memory
55
56**Error Message**
57
58Failed to write data to the shared memory.
59
60**Description**
61
62Failed to write data to the shared memory.
63
64**Possible Causes**
65
661. The size of a single write or total size of continuous writes exceeds the size of the shared memory.
672. The PROT_WRITE mode is not enabled for the shared memory.
68
69**Solution**
70
711. Check whether the data to be read exceeds the total size of the shared memory mapped.
722. Check that PROT_WRITE is enabled for the shared memory.
73
74## 1900004 Failed to Read Data from the Shared Memory
75
76**Error Message**
77
78Failed to read data from the shared memory.
79
80**Description**
81
82Failed to read data from the shared memory.
83
84**Possible Causes**
85
861. The size of a single write or total size of continuous writes exceeds the size of the shared memory.
872. The PROT_READ mode is not enabled for the shared memory.
88
89**Solution**
90
911. Check whether the data to be read exceeds the total size of the shared memory mapped.
922. Check that PROT_READ is enabled for the shared memory.
93
94## 1900005 Operation Allowed Only for the Proxy Object
95
96**Error Message**
97
98Operation allowed only for the proxy object.
99
100**Description**
101
102This operation is allowed only on the proxy object.
103
104**Possible Causes**
105
106A method supported only by the **RemoteProxy** object is called for the **RemoteObject** object.
107
108**Solution**
109
110Check whether a method supported only by the **RemoteProxy** object is called for the **RemoteObject** object.
111
112## 1900006 Operation Allowed Only for the Remote Object
113
114**Error Message**
115
116Operation allowed only for the remote object.
117
118**Description**
119
120This operation is allowed only on the remote object.
121
122**Possible Causes**
123
124A method supported only by the **RemoteObject** object is called for the **RemoteProxy** object.
125
126**Solution**
127
128Check whether a method supported only by the **RemoteObject** object is called for the **RemoteProxy** object.
129
130## 1900007 Failed to Communicate with the Remote Object
131
132**Error Message**
133
134Communication failed.
135
136**Description**
137
138Failed to communicate with the remote object over IPC.
139
140**Possible Causes**
141
1421. The remote object has been destroyed.
1432. The remote object is re-created, but the proxy object held by the local end has expired.
144
145**Solution**
146
1471. Check whether the remote object has been destroyed.
1482. Check whether an observer for listening for the dead status of the remote object is registered, and whether the remote object is destructed and created again.
149
150## 1900008 Invalid IPC Object
151
152**Error Message**
153
154The proxy or remote object is invalid.
155
156**Description**
157
158The proxy or remote object is invalid.
159
160**Possible Causes**
161
1621. The proxy object is invalid.
1632. The remote object has been destroyed.
164
165**Solution**
166
1671. Check whether an exception occurs when the proxy object is obtained.
1682. Check whether the remote object is destructed.
169
170## 1900009 Failed to Write Data to MessageSequence
171
172**Error Message**
173
174Failed to write data to the message sequence.
175
176**Description**
177
178Failed to write data to **MessageSequence**.
179
180**Possible Causes**
181
182The default **MessageSequence** space is full.
183
184**Solution**
185
186Use the method provided by **MessageSequence** to check whether **MessageSequence** has sufficient space.
187
188## 1900010 Failed to Read Data from MessageSequence
189
190**Error Message**
191
192Failed to read data from the message sequence.
193
194**Description**
195
196Failed to read data from **MessageSequence**.
197
198**Possible Causes**
199
200The data read sequence is different from the data write sequence.
201
202**Solution**
203
204Check that the data read sequence is the same as the data write sequence.
205
206## 1900011 Memory Allocation Failed
207
208**Error Message**
209
210Memory allocation failed.
211
212**Description**
213
214Failed to allocate memory during serialization.
215
216**Possible Causes**
217
218The data to write is too large.
219
220**Solution**
221
222Check whether the data to write is too large or whether parameters are set improperly.
223
224## 1900012 JS Callback Failed
225
226**Error Message**
227
228Failed to call the JS callback function.
229
230**Description**
231
232Failed to invoke the JS callback.
233
234**Possible Causes**
235
236The JS function of the service returns a failure message.
237
238**Solution**
239
240Check whether the JS function is successfully executed.
241
242## 1900013 Failed to Invoke dup
243
244**Error Message**
245
246Failed to call dup.
247
248**Description**
249
250Failed to call dup.
251
252**Possible Causes**
253
2541. The file handle resources of the process are used up.
2552. The specified **fd** is closed.
256
257**Solution**
258
2591. Check whether the input parameter **fd** is valid.
2602. Check whether there are file handle resources of the process.
261