• 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
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 database is abnormal.
59
60**Possible Causes**
61
62The database file is damaged and incomplete, the database FD is incorrectly operated, or the database memory is illegally accessed.
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
981. The result set is empty.
992. The current row number in the result set is out of range [0, m - 1]. **m** is **resultsetV9.rowCount**.
1003. The column number is out of the range [0, n - 1]. **n** is **resultsetV9.columnCount**.
1014. 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 alias already exists.
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## 14800020 Key Damaged or Lost
219
220**Error Message**
221
222The secret key is corrupted or lost.
223
224**Description**
225
226The operation for obtaining the secret key fails.
227
228**Possible Causes**
229
230The root key is lost, the application does not have the permission to read the key file, or the key file is damaged.
231
232**Solution**
233
2341. Check the permission for accessing the key file and the content of the key file.
2352. Rebuild or restore the database.
236
237## 14800021 SQLite: Generic Error
238
239**Error Message**
240
241SQLite: Generic error.
242
243**Description**
244
245An SQLite generic error occurs.
246
247**Possible Causes**
248
249An SQL statement is executed to perform any of the following operations:
2501. Insert or update data in a table that is not created.
2512. Insert or update data in a column that does not exist.
2523. Call an undefined function. For details, see SQLITE_ERROR.
253
254**Solution**
255
256Analyze the SQL statement and identify the error.
257
258## 14800022 SQLite: Asynchronous Callback Request Aborted
259
260**Error Message**
261
262SQLite: Callback routine requested an abort.
263
264**Description**
265
266The asynchronous callback request is aborted. This error is reported by the underlying SQLite.
267
268**Possible Causes**
269
2701. The callback in a custom function in SQLite is aborted.
2712. See SQLITE_ABORT.
272
273**Solution**
274
275Check that the hook functions (callbacks) of SQLite are implemented correctly.
276
277## 14800023 SQLite: Access Denied
278
279**Error Message**
280
281SQLite: Access permission denied.
282
283**Description**
284
285SQLite access is denied.
286
287**Possible Causes**
288
2891. SQLite does not have the required permission to access or modify a file.
2902. See SQLITE_PERM.
291
292**Solution**
293
2941. Ensure that the file is not read-only. If the file is read-only, remove the read-only property.
2952. Check that the caller has the required permissions to access the file or folder.
2963. Check whether the file system is read-only. If yes, change it to writable.
2974. Check that the database file is not being used by another process. Terminate the process that is using the file.
2985. When handling permission issues, ensure that you have the permission to change the permissions on the file or folder.
299
300## 14800024 SQLite: Database File Locked
301
302**Error Message**
303
304SQLite: The database file is locked.
305
306**Description**
307
308The SQLite database file is locked. This error is reported by the underlying SQLite.
309
310**Possible Causes**
311
3121. 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.
3132. See SQLITE_BUSY.
314
315**Solution**
316
3171. Avoid concurrent database operations from processes.
3182. Wait for a while and try again.
319
320## 14800025 SQLite: Database Table Locked
321
322**Error Message**
323
324SQLite: A table in the database is locked.
325
326**Description**
327
328An SQLite database table is locked. This error is reported by the underlying SQLite.
329
330**Possible Causes**
331
3321. 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.
3332. See SQLITE_LOCKED.
334
335**Solution**
336
3371. Check that the database file is not being written by another process or thread.
3382. Check that no write operation is performed after a transaction is started and before the transaction is committed.
3393. Check whether the write operation is blocked by other lock mechanisms (such as file locks).
3404. Check that the database connection instance is closed after the database operation is complete.
3415. In a multi-thread environment, ensure that synchronization mechanisms, such as locks, are used to prevent data races.
342
343## 14800026 SQLite: Insufficient Database Memory
344
345**Error Message**
346
347SQLite: The database is out of memory.
348
349**Description**
350
351The database memory is insufficient. This error is reported by the underlying SQLite.
352
353**Possible Causes**
354
355The data volume is too large or the memory allocated is insufficient.
356
357**Solution**
358
359Reduce the data volume or increase the memory allocated.
360
361## 14800027 SQLite: Attempt to Write a Read-only Database
362
363**Error Message**
364
365SQLite: Attempt to write a readonly database.
366
367**Description**
368
369A write operation is invoked on a read-only database. This error is reported by the underlying SQLite.
370
371**Possible Causes**
372
3731. 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.
3742. See SQLITE_READONLY.
375
376**Solution**
377
3781. Ensure that the caller has the permission to write data to the database file.
3792. If the file system is read-only, change it to read/write.
3803. Check that no read-only parameter is used when the database is opened.
381
382## 14800028 SQLite: I/O Error
383
384**Error Message**
385
386SQLite: Some kind of disk I/O error occurred.
387
388**Description**
389
390A disk I/O error occurs. This error is reported by the underlying SQLite.
391
392**Possible Causes**
393
394The possible causes include the following:
3951. The target file does not exist.
3962. The target file is read-only.
3973. The disk space is insufficient.
3984. The target file is damaged.
3995. See SQLITE_IOERR.
400
401**Solution**
402
4031. Check whether the file path is correct and whether the file exists.
4042. Check that the file is not read-only.
4053. Delete unnecessary files to ensure sufficient disk space.
4064. Check that the caller has permissions to read and write the file.
407
408## 14800029 SQLite: Database Is Full
409
410**Error Message**
411
412SQLite: The database is full.
413
414**Description**
415
416The SQLite database is full. This error is reported by the underlying SQLite.
417
418**Possible Causes**
419
420The data volume is too large or the disk space is insufficient.
421
422**Solution**
423
424Reduce the data volume or increase the disk space.
425
426## 14800030 SQLite: Unable to Open the Database File
427
428**Error Message**
429
430SQLite: Unable to open the database file.
431
432**Description**
433
434The database file fails to be opened. This error is reported by the underlying SQLite.
435
436**Possible Causes**
437
4381. The file does not exist, and the RDB store fails to be created.
4392. The file exists, but the database file is damaged.
4403. The caller does not have the permission to access the file using SQLite.
4414. The disk space is insufficient.
4425. See SQLITE_CANTOPEN.
443
444**Solution**
445
4461. Check that the database file path is correct and the caller has the permission to read and write the file.
4472. Check that the disk space is sufficient.
448
449## 14800031 SQLite: TEXT or BLOB Exceeds the Limit
450
451**Error Message**
452
453SQLite: TEXT or BLOB exceeds size limit.
454
455**Description**
456
457The size of the text or BLOB exceeds the limit. This error is reported by the underlying SQLite.
458
459**Possible Causes**
460
4611. The result set returned exceeds the size limit that SQLite can process.
4622. See SQLITE_TOOBIG.
463
464**Solution**
465
466Divide the query operation into multiple small queries, which process part of the data each time.
467
468## 14800032 SQLite: Abort Due to Constraint Violation
469
470**Error Message**
471
472SQLite: Abort due to constraint violation.
473
474**Description**
475
476The database operation violates the constraint rule and is aborted. This error is reported by the underlying SQLite.
477
478**Possible Causes**
479
4801. The data write operation violates the constraints on the database integrity.
4812. See SQLITE_CONSTRAINT.
482
483**Solution**
484
485Check whether the data to be inserted or updated violates the constraints.
486
487## 14800033 SQLite: Data Types Mismatch
488
489**Error Message**
490
491SQLite: Data type mismatch.
492
493**Description**
494
495The data types mismatch. This error is reported by the underlying SQLite.
496
497**Possible Causes**
498
4991. The data type specified in an SQL statement does not match the type of the data stored in the database.
5002. See SQLITE_MISMATCH.
501
502**Solution**
503
504Check 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.
505
506## 14800034 Incorrect Use of SQLite Library
507
508**Error Message**
509
510SQLite: Library used incorrectly.
511
512**Description**
513
514The SQLite interface is used incorrectly. This error is reported by the underlying SQLite.
515
516**Possible Causes**
517
5181. The database operation or context is incorrect. This error usually occurs in the following cases:
519    - The next operation is performed before a database operation is complete.
520    - A database operation is performed on a closed database connection.
521    - A released or invalid database object is used to perform data operation.
5222. See SQLITE_MISUSE.
523
524**Solution**
525
5261. Check that proper synchronization mechanisms like locks are used between database operations.
5272. Check that a database connection is opened before use and closed after the operation is complete.
5283. Check that all database objects are correctly released after being used.
529
530## 14800047 WAL File Size Exceeds the Default Limit
531
532**Error Message**
533
534The WAL file size exceeds the default limit.
535
536**Description**
537
538The WAL file exceeds 512 MB, which is the default limit.
539
540**Possible Causes**
541
542Data is added, deleted, and modified continuously without closing the read transaction or result set.
543
544**Solution**
545
5461. Check for unclosed result sets or transactions.
547
5482. Close all result sets or transactions.
549
550## 14800050 Failed to Obtain the Subscription Service
551
552**Error Message**
553
554Failed to obtain the subscription service.
555
556**Description**
557
558The error code is returned when the subscription service failed to be obtained.
559
560**Possible Causes**
561
562The platform does not support service subscription.
563
564**Solution**
565
566Deploy the subscription service on the platform.
567
568## 14801001 Stage Model Required
569
570**Error Message**
571
572The operation is supported in the stage model only.
573
574**Description**
575
576This operation can be performed only on the stage model.
577
578**Possible Causes**
579
580The context is not a stage model.
581
582**Solution**
583
584Perform the operation on the stage model.
585
586## 14801002 Invalid dataGroupId in storeConfig
587
588**Error Message**
589
590Invalid data group ID.
591
592**Description**
593
594The **dataGroupId** parameter is invalid.
595
596**Possible Causes**
597
598The **dataGroupId** is not obtained from the AppGallery.
599
600**Solution**
601
602Obtain **dataGroupId** from the AppGallery and pass it to **storeConfig** correctly.
603
604## 14800051 Inconsistent Distributed Table Type
605
606**Error Message**
607
608The type of the distributed table does not match.
609
610**Description**
611
612Different distributed table types are set for the same database table.
613
614**Possible Causes**
615
616The same database table is set with different [DistributedType](js-apis-data-relationalStore.md#distributedtype10).
617
618**Solution**
619
620A database table can be synchronized either between devices or between device and cloud.
621