1# RDB Error Codes
2
3> **NOTE**
4>
5> This topic describes only module-specific error codes. For details about universal error codes, see [Universal Error Codes](../errorcode-universal.md).
6
7##  14800000 Internal Error
8
9**Error Message**
10
11Inner error.
12
13**Description**
14
15Internal error.
16
17**Possible Causes**
18
19View the error log to determine the cause of the error. Possible causes include the following:
201. The SQL statement fails to be executed.
212. The internal state is abnormal.
223. There is API that is incorrectly used.
234. A system error, such as null pointer, insufficient memory, unexpected restart of data service, I/O error, IPC exception, and JS engine exception, occurs.
24
25**Solution**
26
271. Check whether SQL statements and predicates are correctly used.
282. Check whether a closed object is reused.
293. Check whether the APIs are correctly used.
304. If the problem persists, ask the user to restart or upgrade the application or upgrade the device version.
31
32## 14800010 Invalid Database Path
33
34**Error Message**
35
36Invalid database path.
37
38**Description**
39
40The RDB store path is invalid.
41
42**Possible Causes**
43
44The RDB store path is invalid.
45
46**Solution**
47
48Check the RDB store path.
49
50## 14800011 Database File Corrupted
51
52**Error Message**
53
54Database corrupted.
55
56**Description**
57
58The RDB store is corrupted when an API for adding, deleting, querying, or synchronizing data is invoked.
59
60**Possible Causes**
61
62The RDB store file has been corrupted.
63
64**Solution**
65
66If data loss is acceptable, delete the RDB store and create a new one. Otherwise, restore the RDB store from the backup file. For details, see [Database Backup and Restore](../../database/data-backup-and-restore.md).
67
68## 14800012 Empty Result Set or Invalid Position
69
70**Error Message**
71
72Row out of bounds.
73
74**Description**
75
76The result set is empty or the specified location is invalid.
77
78**Possible Causes**
79
80The result set is empty, or the specified row number in the result set is out of range [0, m - 1]. **m** is **resultsetV9.rowCount**.
81
82**Solution**
83
84Check whether the result set is empty or whether the specified row number is out of range.
85
86## 14800013 Null Column Value or Column Data Type Incompatible With the API Called
87
88**Error Message**
89
90Column out of bounds.
91
92**Description**
93
94The column value is null, or the column data type is incompatible with the API called.
95
96**Possible Causes**
97
98- The result set is empty.
99- The current row number in the result set is out of range [0, m - 1]. **m** is **resultsetV9.rowCount**.
100- The column number is out of the range [0, n - 1]. **n** is **resultsetV9.columnCount**.
101- The API called does not support the type of the column data.
102
103**Solution**
104
1051. Check whether the result set is empty.
1062. Check whether the row number and column number of the result set are out of range.
1073. Check whether the column data type is supported.
108
109## 14800014 RdbStore or ResultSet Closed
110
111**Error Message**
112
113Already closed.
114
115**Description**
116
117The RDB store or result set is closed.
118
119**Possible Causes**
120
121**close()** is called to close the RDB store or result set, or the RDB store or result set fails to be opened.
122
123**Solution**
124
125Open the RDB store or obtain the result set.
126
127## 14800015 RDB Store Not Respond
128
129**Error Message**
130
131The database does not respond.
132
133**Description**
134
135The RDB store does not respond.
136
137**Possible Causes**
138
139A read, write, attach, or detach operation is being performed, and cannot be complete within the specified time (2s by default).
140
141**Solution**
142
1431. Try again later.
1442. For the [attach](./js-apis-data-relationalStore.md#attach12) or [detach](./js-apis-data-relationalStore.md#detach12) API, increase the value of **waitTime**.
145
146## 14800016 Duplicate RDB Alias
147
148**Error Message**
149
150The database is already attached.
151
152**Description**
153
154The RDB store alias already exists.
155
156**Possible Causes**
157
158The RDB store alias already exists.
159
160**Solution**
161
162Stop the attach operation or change the RDB store alias.
163
164## 14800017 Key Configuration Changed
165
166**Error Message**
167
168Config changed.
169
170**Description**
171
172The key configuration of the RDB store has been modified.
173
174**Possible Causes**
175
176Key configuration, such as **area** and **securityLevel**, of the RDB store is changed.
177
178**Solution**
179
180Restore the original configuration if required. Otherwise, delete the old RDB store, use the new configuration to create a new RDB store, and import the data to the new RDB store.
181
182## 14800018 No Match
183
184**Error Message**
185
186No data meets the condition.
187
188**Description**
189
190No data matching the search criteria is found.
191
192**Possible Causes**
193
194The SQL statement used for query is incorrect, or the data does not exist.
195
196**Solution**
197
198Use the correct query statement or add data.
199
200## 14800019 SQL Query Statement Required
201
202**Error Message**
203
204The SQL must be a query statement.
205
206**Description**
207
208The SQL statement used is not a query statement.
209
210**Possible Causes**
211
212The SQL statement used for query does not meet specifications.
213
214**Solution**
215
216Use SQL statements that comply with specifications.
217
218## 14800021 SQLite: Generic Error
219
220**Error Message**
221
222SQLite: Generic error.
223
224**Description**
225
226An SQLite generic error occurs.
227
228**Possible Causes**
229
230An SQL statement is executed to perform any of the following operations:
2311. Insert or update data in a table that is not created.
2322. Insert or update data in a column that does not exist.
2333. Call an undefined function. For details, see SQLITE_ERROR.
234
235**Solution**
236
237Analyze the SQL statement and identify the error.
238
239## 14800022 SQLite: Asynchronous Callback Request Aborted
240
241**Error Message**
242
243SQLite: Callback routine requested an abort.
244
245**Description**
246
247The asynchronous callback request is aborted.
248
249**Possible Causes**
250
2511. The callback in a custom function in SQLite is aborted.
2522. See SQLITE_ABORT.
253
254**Solution**
255
256Check that the hook functions (callbacks) of SQLite are implemented correctly.
257
258## 14800023 SQLite: Access Denied
259
260**Error Message**
261
262SQLite: Access permission denied.
263
264**Description**
265
266SQLite access is denied.
267
268**Possible Causes**
269
2701. SQLite does not have the required permission to access or modify a file.
2712. See SQLITE_PERM.
272
273**Solution**
274
2751. Ensure that the file is not read-only. If the file is read-only, remove the read-only property.
2762. Check that the caller has the required permissions to access the file or folder.
2773. Check whether the file system is read-only. If yes, change it to writable.
2784. Check that the database file is not being used by another process. Terminate the process that is using the file.
2795. When handling permission issues, ensure that you have the permission to change the permissions on the file or folder.
280
281## 14800024 SQLite: Database File Locked
282
283**Error Message**
284
285SQLite: The database file is locked.
286
287**Description**
288
289The SQLite database file is locked.
290
291**Possible Causes**
292
2931. Two processes of the same application, for example, UIability and DataShareability, perform addition, deletion, and modification operations in the same database, or processes in the same group of different applications perform addition, deletion, and modification operations in the same database via the group.
2942. See SQLITE_BUSY.
295
296**Solution**
297
2981. Avoid concurrent database operations from processes.
2992. Wait for a while and try again.
300
301## 14800025 SQLite: Database Table Locked
302
303**Error Message**
304
305SQLite: A table in the database is locked.
306
307**Description**
308
309An SQLite database table is locked.
310
311**Possible Causes**
312
3131. The database file to write has been locked by another process. A transaction is being performed in the RDB store, or the write attempt is blocked by a lock mechanism.
3142. See SQLITE_LOCKED.
315
316**Solution**
317
3181. Check that the database file is not being written by another process or thread.
3192. Check that no write operation is performed after a transaction is started and before the transaction is committed.
3203. Check whether the write operation is blocked by other lock mechanisms (such as file locks).
3214. Check that the database connection instance is closed after the database operation is complete.
3225. In a multi-thread environment, ensure that synchronization mechanisms, such as locks, are used to prevent data races.
323
324## 14800026 SQLite: Insufficient Database Memory
325
326**Error Message**
327
328SQLite: The database is out of memory.
329
330**Description**
331
332The database memory is insufficient.
333
334**Possible Causes**
335
336The data volume is too large or the memory allocated is insufficient.
337
338**Solution**
339
340Reduce the data volume or increase the memory allocated.
341
342## 14800027 SQLite: Attempt to Write a Read-only Database
343
344**Error Message**
345
346SQLite: Attempt to write a readonly database.
347
348**Description**
349
350A write operation is invoked on a read-only database.
351
352**Possible Causes**
353
3541. An attempt is made to write an SQLite database file that is opened in read-only mode. The access is denied because the target file is in a read-only file system or the database is marked as read-only.
3552. See SQLITE_READONLY.
356
357**Solution**
358
3591. Ensure that the caller has the permission to write data to the database file.
3602. If the file system is read-only, change it to read/write.
3613. Check that no read-only parameter is used when the database is opened.
362
363## 14800028 SQLite: I/O Error
364
365**Error Message**
366
367SQLite: Some kind of disk I/O error occurred.
368
369**Description**
370
371A disk I/O error occurs.
372
373**Possible Causes**
374
375The possible causes include the following:
3761. The target file does not exist.
3772. The target file is read-only.
3783. The disk space is insufficient.
3794. The target file is damaged.
3805. See SQLITE_IOERR.
381
382**Solution**
383
3841. Check whether the file path is correct and whether the file exists.
3852. Check that the file is not read-only.
3863. Delete unnecessary files to ensure sufficient disk space.
3874. Check that the caller has permissions to read and write the file.
388
389## 14800029 SQLite: Database Is Full
390
391**Error Message**
392
393SQLite: The database is full.
394
395**Description**
396
397The SQLite database is full.
398
399**Possible Causes**
400
401The data volume is too large or the disk space is insufficient.
402
403**Solution**
404
405Reduce the data volume or increase the disk space.
406
407## 14800030 SQLite: Unable to Open the Database File
408
409**Error Message**
410
411SQLite: Unable to open the database file.
412
413**Description**
414
415The database file fails to be opened.
416
417**Possible Causes**
418
4191. The file does not exist, and the RDB store fails to be created.
4202. The file exists, but the database file is damaged.
4213. The caller does not have the permission to access the file using SQLite.
4224. The disk space is insufficient.
4235. See SQLITE_CANTOPEN.
424
425**Solution**
426
4271. Check that the database file path is correct and the caller has the permission to read and write the file.
4282. Check that the disk space is sufficient.
429
430## 14800031 SQLite: TEXT or BLOB Exceeds the Limit
431
432**Error Message**
433
434SQLite: TEXT or BLOB exceeds size limit.
435
436**Description**
437
438The size of the text or BLOB exceeds the limit.
439
440**Possible Causes**
441
4421. The result set returned exceeds the size limit that SQLite can process.
4432. See SQLITE_TOOBIG.
444
445**Solution**
446
447Divide the query operation into multiple small queries, which process part of the data each time.
448
449## 14800032 SQLite: Abort Due to Constraint Violation
450
451**Error Message**
452
453SQLite: Abort due to constraint violation.
454
455**Description**
456
457The database operation violates the constraint rule and is aborted.
458
459**Possible Causes**
460
4611. The data write operation violates the constraints on the database integrity.
4622. See SQLITE_CONSTRAINT.
463
464**Solution**
465
466Check whether the data to be inserted or updated violates the constraints.
467
468## 14800033 SQLite: Data Types Mismatch
469
470**Error Message**
471
472SQLite: Data type mismatch.
473
474**Description**
475
476The data types mismatch.
477
478**Possible Causes**
479
4801. The data type specified in an SQL statement does not match the type of the data stored in the database.
4812. See SQLITE_MISMATCH.
482
483**Solution**
484
485Check the type of the data in the specified column in the SQL statement and ensure that the type of the data to be inserted, updated, or queried matches the data type of the column.
486
487## 14800034 Incorrect Use of SQLite Library
488
489**Error Message**
490
491SQLite: Library used incorrectly.
492
493**Description**
494
495The SQLite interface is used incorrectly.
496
497**Possible Causes**
498
4991. The database operation or context is incorrect. This error usually occurs in the following cases:
500    - The next operation is performed before a database operation is complete.
501    - A database operation is performed on a closed database connection.
502    - A released or invalid database object is used to perform data operation.
5032. See SQLITE_MISUSE.
504
505**Solution**
506
5071. Check that proper synchronization mechanisms like locks are used between database operations.
5082. Check that a database connection is opened before use and closed after the operation is complete.
5093. Check that all database objects are correctly released after being used.
510
511## 14800047 WAL File Size Exceeds the Default Limit
512
513**Error Message**
514
515The WAL file size exceeds the default limit.
516
517**Description**
518
519The WAL file exceeds 200 MB, which is the default limit.
520
521**Possible Causes**
522
523Data is added, deleted, and modified continuously without closing the read transaction or result set.
524
525**Solution**
526
5271. Check for unclosed result sets or transactions.
528
5292. Close all result sets or transactions.
530
531## 14800050 Failed to Obtain the Subscription Service
532
533**Error Message**
534
535Failed to obtain subscription service.
536
537**Description**
538
539The error code is returned when the subscription service failed to be obtained.
540
541**Possible Causes**
542
543The platform does not support service subscription.
544
545**Solution**
546
547Deploy the subscription service on the platform.
548
549## 14801001 Stage Model Required
550
551**Error Message**
552
553 Only supported in stage mode.
554
555**Description**
556
557This operation can be performed only on the stage model.
558
559**Possible Causes**
560
561The context is not a stage model.
562
563**Solution**
564
565Perform the operation on the stage model.
566
567## 14801002 Invalid dataGroupId in storeConfig
568
569**Error Message**
570
571The data group id is not valid.
572
573**Description**
574
575The **dataGroupId** parameter is invalid.
576
577**Possible Causes**
578
579The **dataGroupId** is not obtained from the AppGallery.
580
581**Solution**
582
583Obtain **dataGroupId** from the AppGallery and pass it to **storeConfig** correctly.
584
585## 14800051 Inconsistent Distributed Table Type
586
587**Error Message**
588
589The type of the distributed table does not match.
590
591**Description**
592
593Different distributed table types are set for the same database table.
594
595**Possible Causes**
596
597The same database table is set with different [DistributedType](js-apis-data-relationalStore.md#distributedtype10).
598
599**Solution**
600
601A database table can be synchronized either between devices or between device and cloud.
602