• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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
15This error code is reported if an internal error is thrown.
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##  14800001 Invalid Arguments
33
34**Error Message**
35
36Invalid arguments. Possible causes: 1. Parameter is out of valid range; 2. Missing GROUP BY clause.
37
38**Description**
39
40This error code is reported if the arguments are invalid.
41
42**Possible Causes**
43
44The input arguments do not meet the API requirements, such as the value range, length, and format.
45
46**Solution**
47
48Modify the arguments according to the API reference.
49
50## 14800010 Invalid Database Path
51
52**Error Message**
53
54Failed to open or delete the database by an invalid database path.
55
56**Description**
57
58This error code is reported if the database fails to be opened or deleted due to invalid database path.
59
60**Possible Causes**
61
62The RDB store path is invalid.
63
64**Solution**
65
66Check the RDB store path.
67
68## 14800011 Database File Corrupted
69
70**Error Message**
71
72Failed to open the database because it is corrupted.
73
74**Description**
75
76This error code is reported if the database is abnormal and fails to be opened.
77
78**Possible Causes**
79
80The database file is damaged and incomplete, the database FD is incorrectly operated, or the database memory is illegally accessed.
81
82**Solution**
83
84If 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).
85
86## 14800012 Empty Result Set or Invalid Position
87
88**Error Message**
89
90ResultSet is empty or pointer index is out of bounds.
91
92**Description**
93
94This error code is reported if the result set is empty or the specified location is invalid.
95
96**Possible Causes**
97
98The result set is empty, or the specified row number in the result set is out of range [0, m - 1]. **m** is **resultsetV9.rowCount**.
99
100**Solution**
101
102Check whether the result set is empty or whether the specified row number is out of range.
103
104## 14800013 Null Column Value or Column Data Type Incompatible With the API Called
105
106**Error Message**
107
108Resultset is empty or column index is out of bounds.
109
110**Description**
111
112This error code is reported if the column value is null, or the column data type is incompatible with the API called.
113
114**Possible Causes**
115
1161. The result set is empty.
1172. The current row number in the result set is out of range [0, m - 1]. **m** is **resultsetV9.rowCount**.
1183. The column number is out of the range [0, n - 1]. **n** is **resultsetV9.columnCount**.
1194. The API called does not support the type of the column data.
120
121**Solution**
122
1231. Check whether the result set is empty.
1242. Check whether the row number and column number of the result set are out of range.
1253. Check whether the column data type is supported.
126
127## 14800014 RdbStore or ResultSet Closed
128
129**Error Message**
130
131The RdbStore or ResultSet is already closed.
132
133**Description**
134
135This error code is reported if the RDB store or result set is closed.
136
137**Possible Causes**
138
139**close()** is called to close the RDB store or result set, or the RDB store or result set fails to be opened.
140
141**Solution**
142
143Open the RDB store or obtain the result set.
144
145## 14800015 RDB Store Not Respond
146
147**Error Message**
148
149The database does not respond.
150
151**Description**
152
153This error code is reported if the RDB store does not respond.
154
155**Possible Causes**
156
157A read, write, attach, or detach operation is being performed, and cannot be complete within the specified time (2s by default).
158
159**Solution**
160
1611. Try again later.
1622. If the [attach](arkts-apis-data-relationalStore-RdbStore.md#attach12) or [detach](arkts-apis-data-relationalStore-RdbStore.md#detach12) API is used, modify the value of **waitTime** to increase the waiting duration.
163
164## 14800016 Duplicate RDB Alias
165
166**Error Message**
167
168The database alias already exists.
169
170**Description**
171
172This error code is reported if the RDB store alias already exists.
173
174**Possible Causes**
175
176The RDB store alias already exists.
177
178**Solution**
179
180Stop the attach operation or change the RDB store alias.
181
182## 14800017 Key Configuration Changed
183
184**Error Message**
185
186StoreConfig is changed.
187
188**Description**
189
190This error code is reported if the key configuration of the RDB store has been modified.
191
192**Possible Causes**
193
194Key configuration, such as **area**, **securityLevel**, or the read/write permission of the RDB store is changed.
195
196**Solution**
197
198Restore 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.
199Check whether the read/write permission on the database file is modified using chmod. Ensure that the current user has sufficient permissions to read and write the database file.
200
201## 14800018 No Match
202
203**Error Message**
204
205No data meets the condition.
206
207**Description**
208
209This error code is reported if no data matching the search criteria is found.
210
211**Possible Causes**
212
213The SQL statement used for query is incorrect, or the data does not exist.
214
215**Solution**
216
217Use the correct query statement or add data.
218
219## 14800019 SQL Query Statement Required
220
221**Error Message**
222
223The SQL must be a query statement.
224
225**Description**
226
227This error code is reported if the SQL statement used is not a query statement.
228
229**Possible Causes**
230
231The SQL statement used for query does not meet specifications.
232
233**Solution**
234
235Use SQL statements that comply with specifications.
236
237## 14800020 Key Damaged or Lost
238
239**Error Message**
240
241The secret key is corrupted or lost.
242
243**Description**
244
245This error code is reported if obtaining the secret key fails.
246
247**Possible Causes**
248
249The root key is lost, the application does not have the permission to read the key file, or the key file is damaged.
250
251**Solution**
252
2531. Check the permission for accessing the key file and the content of the key file.
2542. Rebuild or restore the database.
255
256## 14800021 SQLite: Generic Error
257
258**Error Message**
259
260SQLite: Generic error. Possible causes: Insert failed or the updated data does not exist.
261
262**Description**
263
264This error code is reported if an SQLite generic error occurs.
265
266**Possible Causes**
267
268An SQL statement is executed to perform any of the following operations:
2691. Insert or update data in a table that is not created.
2702. Insert or update data in a column that does not exist.
2713. Call an undefined function. For details, see SQLITE_ERROR.
272
273**Solution**
274
275Analyze the SQL statement and identify the error.
276
277## 14800022 SQLite: Asynchronous Callback Request Aborted
278
279**Error Message**
280
281SQLite: Callback routine requested an abort.
282
283**Description**
284
285This error code is reported if the asynchronous callback request is aborted.
286
287**Possible Causes**
288
2891. The callback in a custom function in SQLite is aborted.
2902. See SQLITE_ABORT.
291
292**Solution**
293
294Check that the hook functions (callbacks) of SQLite are implemented correctly.
295
296## 14800023 SQLite: Access Denied
297
298**Error Message**
299
300SQLite: Access permission denied.
301
302**Description**
303
304This error code is reported if the SQLite access is denied.
305
306**Possible Causes**
307
3081. SQLite does not have the required permission to access or modify a file.
3092. See SQLITE_PERM.
310
311**Solution**
312
3131. Ensure that the file is not read-only. If the file is read-only, remove the read-only property.
3142. Check that the caller has the required permissions to access the file or folder.
3153. Check whether the file system is read-only. If yes, change it to writable.
3164. Check that the database file is not being used by another process. Terminate the process that is using the file.
3175. When handling permission issues, ensure that you have the permission to change the permissions on the file or folder.
318
319## 14800024 SQLite: Database File Locked
320
321**Error Message**
322
323SQLite: The database file is locked.
324
325**Description**
326
327This error code is reported if the SQLite database file is locked.
328
329**Possible Causes**
330
3311. 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.
3322. See SQLITE_BUSY.
333
334**Solution**
335
3361. Avoid concurrent database operations from processes.
3372. Wait for a while and try again.
338
339## 14800025 SQLite: Database Table Locked
340
341**Error Message**
342
343SQLite: A table in the database is locked.
344
345**Description**
346
347This error code is reported if an SQLite database table is locked.
348
349**Possible Causes**
350
3511. 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.
3522. See SQLITE_LOCKED.
353
354**Solution**
355
3561. Check that the database file is not being written by another process or thread.
3572. Check that no write operation is performed after a transaction is started and before the transaction is committed.
3583. Check whether the write operation is blocked by other lock mechanisms (such as file locks).
3594. Check that the database connection instance is closed after the database operation is complete.
3605. In a multi-thread environment, ensure that synchronization mechanisms, such as locks, are used to prevent data races.
361
362## 14800026 SQLite: Insufficient Database Memory
363
364**Error Message**
365
366SQLite: The database is out of memory.
367
368**Description**
369
370This error code is reported if the database memory is insufficient.
371
372**Possible Causes**
373
374The data volume is too large or the memory allocated is insufficient.
375
376**Solution**
377
378Reduce the data volume or increase the memory allocated.
379
380## 14800027 SQLite: Attempt to Write a Read-only Database
381
382**Error Message**
383
384SQLite: Attempt to write a readonly database.
385
386**Description**
387
388This error code is reported if a write operation is invoked on a read-only database.
389
390**Possible Causes**
391
3921. 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.
3932. See SQLITE_READONLY.
394
395**Solution**
396
3971. Ensure that the caller has the permission to write data to the database file.
3982. If the file system is read-only, change it to read/write.
3993. Check that no read-only parameter is used when the database is opened.
400
401## 14800028 SQLite: I/O Error
402
403**Error Message**
404
405SQLite: Some kind of disk I/O error occurred.
406
407**Description**
408
409This error code is reported if a disk I/O error occurs.
410
411**Possible Causes**
412
413The possible causes include the following:
4141. The target file does not exist.
4152. The target file is read-only.
4163. The disk space is insufficient.
4174. The target file is damaged.
4185. See SQLITE_IOERR.
419
420**Solution**
421
4221. Check whether the file path is correct and whether the file exists.
4232. Check that the file is not read-only.
4243. Delete unnecessary files to ensure sufficient disk space.
4254. Check that the caller has permissions to read and write the file.
426
427## 14800029 SQLite: Database Is Full
428
429**Error Message**
430
431SQLite: The database is full.
432
433**Description**
434
435This error code is reported if the SQLite database is full.
436
437**Possible Causes**
438
439The data volume is too large or the disk space is insufficient.
440
441**Solution**
442
443Reduce the data volume or increase the disk space.
444
445## 14800030 SQLite: Unable to Open the Database File
446
447**Error Message**
448
449SQLite: Unable to open the database file.
450
451**Description**
452
453This error code is reported if the database file fails to be opened.
454
455**Possible Causes**
456
4571. The file does not exist, and the RDB store fails to be created.
4582. The file exists, but the database file is damaged.
4593. The caller does not have the permission to access the file using SQLite.
4604. The disk space is insufficient.
4615. See SQLITE_CANTOPEN.
462
463**Solution**
464
4651. Check that the database file path is correct and the caller has the permission to read and write the file.
4662. Check that the disk space is sufficient.
467
468## 14800031 SQLite: TEXT or BLOB Exceeds the Limit
469
470**Error Message**
471
472SQLite: TEXT or BLOB exceeds size limit.
473
474**Description**
475
476This error code is reported if the size of the text or BLOB exceeds the limit.
477
478**Possible Causes**
479
4801. The result set returned exceeds the size limit that SQLite can process.
4812. See SQLITE_TOOBIG.
482
483**Solution**
484
485Divide the query operation into multiple small queries, which process part of the data each time.
486
487## 14800032 SQLite: Abort Due to Constraint Violation
488
489**Error Message**
490
491SQLite: Abort due to constraint violation.
492
493**Description**
494
495This error code is reported if the database operation violates the constraint rule and is aborted.
496
497**Possible Causes**
498
4991. The data write operation violates the constraints on the database integrity.
5002. See SQLITE_CONSTRAINT.
501
502**Solution**
503
504Check whether the data to be inserted or updated violates the constraints.
505
506## 14800033 SQLite: Data Types Mismatch
507
508**Error Message**
509
510SQLite: Data type mismatch.
511
512**Description**
513
514This error code is reported if the data types mismatch.
515
516**Possible Causes**
517
5181. The data type specified in an SQL statement does not match the type of the data stored in the database.
5192. See SQLITE_MISMATCH.
520
521**Solution**
522
523Check 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.
524
525## 14800034 Incorrect Use of SQLite Library
526
527**Error Message**
528
529SQLite: Library used incorrectly.
530
531**Description**
532
533This error code is reported if the SQLite interface is used incorrectly.
534
535**Possible Causes**
536
5371. The database operation or context is incorrect. This error usually occurs in the following cases:
538    - The next operation is performed before a database operation is complete.
539    - A database operation is performed on a closed database connection.
540    - A released or invalid database object is used to perform data operation.
5412. See SQLITE_MISUSE.
542
543**Solution**
544
5451. Check that proper synchronization mechanisms like locks are used between database operations.
5462. Check that a database connection is opened before use and closed after the operation is complete.
5473. Check that all database objects are correctly released after being used.
548
549## 14800047 WAL File Size Exceeds the Default Limit
550
551**Error Message**
552
553The WAL file size exceeds the default limit.
554
555**Description**
556
557This error code is reported if the WAL file exceeds 512 MB, which is the default limit.
558
559**Possible Causes**
560
561Data is added, deleted, and modified continuously without closing the read transaction or result set.
562
563**Solution**
564
565Check for unclosed result sets or transactions.
566
567Close all result sets or transactions.
568
569## 14800050 Failed to Obtain the Subscription Service
570
571**Error Message**
572
573Failed to obtain the subscription service.
574
575**Description**
576
577The error code is reported if the subscription service failed to be obtained.
578
579**Possible Causes**
580
581The platform does not support service subscription.
582
583**Solution**
584
585Deploy the subscription service on the platform.
586
587## 14801001 Stage Model Required
588
589**Error Message**
590
591The operation is supported in the stage model only.
592
593**Description**
594
595This error code is reported if this operation is not performed on the stage model.
596
597**Possible Causes**
598
599The context is not a stage model.
600
601**Solution**
602
603Perform the operation on the stage model.
604
605## 14801002 Invalid dataGroupId in storeConfig
606
607**Error Message**
608
609Invalid data group ID.
610
611**Description**
612
613This error code is reported if the **dataGroupId** parameter is invalid.
614
615**Possible Causes**
616
617The **dataGroupId** is not obtained from the AppGallery.
618
619**Solution**
620
621Obtain **dataGroupId** from the AppGallery and pass it to **storeConfig** correctly.
622
623## 14800051 Inconsistent Distributed Table Type
624
625**Error Message**
626
627The type of the distributed table does not match.
628
629**Description**
630
631This error code is reported if different distributed table types are set for the same database table.
632
633**Possible Causes**
634
635The same database table is set with different [DistributedType](arkts-apis-data-relationalStore-e.md#distributedtype10).
636
637**Solution**
638
639A database table can be synchronized either between devices or between device and cloud.
640