1e41f4b71Sopenharmony_ci# RPC Error Codes
2e41f4b71Sopenharmony_ci
3e41f4b71Sopenharmony_ci> **NOTE**
4e41f4b71Sopenharmony_ci>
5e41f4b71Sopenharmony_ci> This topic describes only module-specific error codes. For details about universal error codes, see [Universal Error Codes](../errorcode-universal.md).
6e41f4b71Sopenharmony_ci
7e41f4b71Sopenharmony_ciThe APIs of the **rpc** module return exceptions since API version 9.
8e41f4b71Sopenharmony_ci
9e41f4b71Sopenharmony_ci## 1900001 Failed to Call mmap
10e41f4b71Sopenharmony_ci
11e41f4b71Sopenharmony_ci**Error Message**
12e41f4b71Sopenharmony_ci
13e41f4b71Sopenharmony_ciCall mmap function failed.
14e41f4b71Sopenharmony_ci
15e41f4b71Sopenharmony_ci**Description**
16e41f4b71Sopenharmony_ci
17e41f4b71Sopenharmony_ciThe mmap function failed.
18e41f4b71Sopenharmony_ci
19e41f4b71Sopenharmony_ci**Possible Causes**
20e41f4b71Sopenharmony_ci
21e41f4b71Sopenharmony_ci1. The mapping area is too large.
22e41f4b71Sopenharmony_ci2. There is no sufficient memory for mapping.
23e41f4b71Sopenharmony_ci
24e41f4b71Sopenharmony_ci**Solution**
25e41f4b71Sopenharmony_ci
26e41f4b71Sopenharmony_ci1. Check whether the memory specified in **Ashmem::create()** is too large.
27e41f4b71Sopenharmony_ci2. Check whether the system has sufficient memory for the mapping operation.
28e41f4b71Sopenharmony_ci
29e41f4b71Sopenharmony_ci## 1900002 Failed to Call ioctl
30e41f4b71Sopenharmony_ci
31e41f4b71Sopenharmony_ci**Error Message**
32e41f4b71Sopenharmony_ci
33e41f4b71Sopenharmony_ciCall os ioctl function failed.
34e41f4b71Sopenharmony_ci
35e41f4b71Sopenharmony_ci**Description**
36e41f4b71Sopenharmony_ci
37e41f4b71Sopenharmony_ciFailed to call **ioctl** with the shared memory file descriptor.
38e41f4b71Sopenharmony_ci
39e41f4b71Sopenharmony_ci**Possible Causes**
40e41f4b71Sopenharmony_ci
41e41f4b71Sopenharmony_ci1. Invalid kernel parameters are set.
42e41f4b71Sopenharmony_ci2. The specified type does not comply with the types specified when the shared memory is mapped.
43e41f4b71Sopenharmony_ci
44e41f4b71Sopenharmony_ci**Solution**
45e41f4b71Sopenharmony_ci
46e41f4b71Sopenharmony_ci1. Check whether the specified parameters are **PROT_EXEC**, **PROT_READ**, and **PROT_WRITE** of the **Ashmem** class.
47e41f4b71Sopenharmony_ci2. Check whether the type specified is one of the types specified when the shared memory is mapped.
48e41f4b71Sopenharmony_ci
49e41f4b71Sopenharmony_ci## 1900003 Failed to Write Data to the Shared Memory
50e41f4b71Sopenharmony_ci
51e41f4b71Sopenharmony_ci**Error Message**
52e41f4b71Sopenharmony_ci
53e41f4b71Sopenharmony_ciWrite to ashmem failed.
54e41f4b71Sopenharmony_ci
55e41f4b71Sopenharmony_ci**Description**
56e41f4b71Sopenharmony_ci
57e41f4b71Sopenharmony_ciFailed to write data to the shared memory.
58e41f4b71Sopenharmony_ci
59e41f4b71Sopenharmony_ci**Possible Causes**
60e41f4b71Sopenharmony_ci
61e41f4b71Sopenharmony_ci1. The size of a single write or total size of continuous writes exceeds the size of the shared memory.
62e41f4b71Sopenharmony_ci2. The PROT_WRITE mode is not enabled for the shared memory.
63e41f4b71Sopenharmony_ci
64e41f4b71Sopenharmony_ci**Solution**
65e41f4b71Sopenharmony_ci
66e41f4b71Sopenharmony_ci1. Check whether the data to be written to the shared memory exceeds the total size of the shared memory mapped.
67e41f4b71Sopenharmony_ci2. Check that PROT_WRITE is enabled for the shared memory.
68e41f4b71Sopenharmony_ci
69e41f4b71Sopenharmony_ci## 1900004 Failed to Read Data from the Shared Memory
70e41f4b71Sopenharmony_ci
71e41f4b71Sopenharmony_ci**Error Message**
72e41f4b71Sopenharmony_ci
73e41f4b71Sopenharmony_ciRead from ashmem failed.
74e41f4b71Sopenharmony_ci
75e41f4b71Sopenharmony_ci**Description**
76e41f4b71Sopenharmony_ci
77e41f4b71Sopenharmony_ciFailed to read data from the shared memory.
78e41f4b71Sopenharmony_ci
79e41f4b71Sopenharmony_ci**Possible Causes**
80e41f4b71Sopenharmony_ci
81e41f4b71Sopenharmony_ci1. The size of a single write or total size of continuous writes exceeds the size of the shared memory.
82e41f4b71Sopenharmony_ci2. The PROT_READ mode is not enabled for the shared memory.
83e41f4b71Sopenharmony_ci
84e41f4b71Sopenharmony_ci**Solution**
85e41f4b71Sopenharmony_ci
86e41f4b71Sopenharmony_ci1. Check whether the data to be written to the shared memory exceeds the total size of the shared memory mapped.
87e41f4b71Sopenharmony_ci2. Check that PROT_READ is enabled for the shared memory.
88e41f4b71Sopenharmony_ci
89e41f4b71Sopenharmony_ci## 1900005 Operation Allowed Only for the Proxy Object
90e41f4b71Sopenharmony_ci
91e41f4b71Sopenharmony_ci**Error Message**
92e41f4b71Sopenharmony_ci
93e41f4b71Sopenharmony_ciOnly proxy object permitted.
94e41f4b71Sopenharmony_ci
95e41f4b71Sopenharmony_ci**Description**
96e41f4b71Sopenharmony_ci
97e41f4b71Sopenharmony_ciThis operation is allowed only on the proxy object.
98e41f4b71Sopenharmony_ci
99e41f4b71Sopenharmony_ci**Possible Causes**
100e41f4b71Sopenharmony_ci
101e41f4b71Sopenharmony_ciA method supported only by the **RemoteProxy** object is called for the **RemoteObject** object.
102e41f4b71Sopenharmony_ci
103e41f4b71Sopenharmony_ci**Solution**
104e41f4b71Sopenharmony_ci
105e41f4b71Sopenharmony_ciCheck whether a method supported only by the **RemoteProxy** object is called for the **RemoteObject** object.
106e41f4b71Sopenharmony_ci
107e41f4b71Sopenharmony_ci## 1900006 Operation Allowed Only for the Remote Object
108e41f4b71Sopenharmony_ci
109e41f4b71Sopenharmony_ci**Error Message**
110e41f4b71Sopenharmony_ci
111e41f4b71Sopenharmony_ciOnly remote object permitted.
112e41f4b71Sopenharmony_ci
113e41f4b71Sopenharmony_ci**Description**
114e41f4b71Sopenharmony_ci
115e41f4b71Sopenharmony_ciThis operation is allowed only on the remote object.
116e41f4b71Sopenharmony_ci
117e41f4b71Sopenharmony_ci**Possible Causes**
118e41f4b71Sopenharmony_ci
119e41f4b71Sopenharmony_ciA method supported only by the **RemoteObject** object is called for the **RemoteProxy** object.
120e41f4b71Sopenharmony_ci
121e41f4b71Sopenharmony_ci**Solution**
122e41f4b71Sopenharmony_ci
123e41f4b71Sopenharmony_ciCheck whether a method supported only by the **RemoteObject** object is called for the **RemoteProxy** object.
124e41f4b71Sopenharmony_ci
125e41f4b71Sopenharmony_ci## 1900007 Failed to Communicate with the Remote Object
126e41f4b71Sopenharmony_ci
127e41f4b71Sopenharmony_ci**Error Message**
128e41f4b71Sopenharmony_ci
129e41f4b71Sopenharmony_ciCommunication failed.
130e41f4b71Sopenharmony_ci
131e41f4b71Sopenharmony_ci**Description**
132e41f4b71Sopenharmony_ci
133e41f4b71Sopenharmony_ciFailed to communicate with the remote object over IPC.
134e41f4b71Sopenharmony_ci
135e41f4b71Sopenharmony_ci**Possible Causes**
136e41f4b71Sopenharmony_ci
137e41f4b71Sopenharmony_ci1. The remote object has been destroyed.
138e41f4b71Sopenharmony_ci2. The remote object is re-created, but the proxy object held by the local end has expired.
139e41f4b71Sopenharmony_ci
140e41f4b71Sopenharmony_ci**Solution**
141e41f4b71Sopenharmony_ci
142e41f4b71Sopenharmony_ci1. Check whether the remote object has been destroyed.
143e41f4b71Sopenharmony_ci2. 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.
144e41f4b71Sopenharmony_ci
145e41f4b71Sopenharmony_ci## 1900008 Invalid IPC Object
146e41f4b71Sopenharmony_ci
147e41f4b71Sopenharmony_ci**Error Message**
148e41f4b71Sopenharmony_ci
149e41f4b71Sopenharmony_ciProxy or remote object is invalid.
150e41f4b71Sopenharmony_ci
151e41f4b71Sopenharmony_ci**Description**
152e41f4b71Sopenharmony_ci
153e41f4b71Sopenharmony_ciThe proxy or remote object is invalid.
154e41f4b71Sopenharmony_ci
155e41f4b71Sopenharmony_ci**Possible Causes**
156e41f4b71Sopenharmony_ci
157e41f4b71Sopenharmony_ci1. The proxy object is invalid.
158e41f4b71Sopenharmony_ci2. The remote object has been destroyed.
159e41f4b71Sopenharmony_ci
160e41f4b71Sopenharmony_ci**Solution**
161e41f4b71Sopenharmony_ci
162e41f4b71Sopenharmony_ci1. Check whether an exception occurs when the proxy object is obtained.
163e41f4b71Sopenharmony_ci2. Check whether the remote object is destructed.
164e41f4b71Sopenharmony_ci
165e41f4b71Sopenharmony_ci## 1900009 Failed to Write Data to MessageSequence
166e41f4b71Sopenharmony_ci
167e41f4b71Sopenharmony_ci**Error Message**
168e41f4b71Sopenharmony_ci
169e41f4b71Sopenharmony_ciWrite data to message sequence failed.
170e41f4b71Sopenharmony_ci
171e41f4b71Sopenharmony_ci**Description**
172e41f4b71Sopenharmony_ci
173e41f4b71Sopenharmony_ciFailed to write data to **MessageSequence**.
174e41f4b71Sopenharmony_ci
175e41f4b71Sopenharmony_ci**Possible Causes**
176e41f4b71Sopenharmony_ci
177e41f4b71Sopenharmony_ciThe default **MessageSequence** space is full.
178e41f4b71Sopenharmony_ci
179e41f4b71Sopenharmony_ci**Solution**
180e41f4b71Sopenharmony_ci
181e41f4b71Sopenharmony_ciUse the method provided by **MessageSequence** to check whether **MessageSequence** has sufficient space.
182e41f4b71Sopenharmony_ci
183e41f4b71Sopenharmony_ci## 1900010 Failed to Read Data from MessageSequence
184e41f4b71Sopenharmony_ci
185e41f4b71Sopenharmony_ci**Error Message**
186e41f4b71Sopenharmony_ci
187e41f4b71Sopenharmony_ciRead data from message sequence failed.
188e41f4b71Sopenharmony_ci
189e41f4b71Sopenharmony_ci**Description**
190e41f4b71Sopenharmony_ci
191e41f4b71Sopenharmony_ciFailed to read data from **MessageSequence**.
192e41f4b71Sopenharmony_ci
193e41f4b71Sopenharmony_ci**Possible Causes**
194e41f4b71Sopenharmony_ci
195e41f4b71Sopenharmony_ciThe data read sequence is different from the data write sequence.
196e41f4b71Sopenharmony_ci
197e41f4b71Sopenharmony_ci**Solution**
198e41f4b71Sopenharmony_ci
199e41f4b71Sopenharmony_ciCheck that the data read sequence is the same as the data write sequence.
200e41f4b71Sopenharmony_ci
201e41f4b71Sopenharmony_ci## 1900011 Memory Allocation Failed
202e41f4b71Sopenharmony_ci
203e41f4b71Sopenharmony_ci**Error Message**
204e41f4b71Sopenharmony_ci
205e41f4b71Sopenharmony_ciSequence memory alloc failed.
206e41f4b71Sopenharmony_ci
207e41f4b71Sopenharmony_ci**Description**
208e41f4b71Sopenharmony_ci
209e41f4b71Sopenharmony_ciFailed to allocate memory during serialization.
210e41f4b71Sopenharmony_ci
211e41f4b71Sopenharmony_ci**Possible Causes**
212e41f4b71Sopenharmony_ci
213e41f4b71Sopenharmony_ciThe data to write is too large.
214e41f4b71Sopenharmony_ci
215e41f4b71Sopenharmony_ci**Solution**
216e41f4b71Sopenharmony_ci
217e41f4b71Sopenharmony_ciCheck whether the data to write is too large or whether parameters are set improperly.
218e41f4b71Sopenharmony_ci
219e41f4b71Sopenharmony_ci## 1900012 JS Callback Failed
220e41f4b71Sopenharmony_ci
221e41f4b71Sopenharmony_ci**Error Message**
222e41f4b71Sopenharmony_ci
223e41f4b71Sopenharmony_ciCall JS callback function failed.
224e41f4b71Sopenharmony_ci
225e41f4b71Sopenharmony_ci**Description**
226e41f4b71Sopenharmony_ci
227e41f4b71Sopenharmony_ciFailed to invoke the JS callback.
228e41f4b71Sopenharmony_ci
229e41f4b71Sopenharmony_ci**Possible Causes**
230e41f4b71Sopenharmony_ci
231e41f4b71Sopenharmony_ciThe JS function of the service returns a failure message.
232e41f4b71Sopenharmony_ci
233e41f4b71Sopenharmony_ci**Solution**
234e41f4b71Sopenharmony_ci
235e41f4b71Sopenharmony_ciCheck whether the JS function is successfully executed.
236e41f4b71Sopenharmony_ci
237e41f4b71Sopenharmony_ci## 1900013 Failed to Invoke dup
238e41f4b71Sopenharmony_ci
239e41f4b71Sopenharmony_ci**Error Message**
240e41f4b71Sopenharmony_ci
241e41f4b71Sopenharmony_ciCall os dup function failed.
242e41f4b71Sopenharmony_ci
243e41f4b71Sopenharmony_ci**Description**
244e41f4b71Sopenharmony_ci
245e41f4b71Sopenharmony_ciFailed to call dup.
246e41f4b71Sopenharmony_ci
247e41f4b71Sopenharmony_ci**Possible Causes**
248e41f4b71Sopenharmony_ci
249e41f4b71Sopenharmony_ci1. The file handle resources of the process are used up.
250e41f4b71Sopenharmony_ci2. The specified **fd** is closed.
251e41f4b71Sopenharmony_ci
252e41f4b71Sopenharmony_ci**Solution**
253e41f4b71Sopenharmony_ci
254e41f4b71Sopenharmony_ci1. Check whether the input parameter** fd** is valid.
255e41f4b71Sopenharmony_ci2. Check whether there are file handle resources of the process.
256