1# File Management 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 7The error codes of the file management subsystem consist of the following:<br>- Basic file I/O error codes<br>- User data management error codes<br>- User file access error codes<br>- Spatial statistics error codes 8 9## Basic File I/O Error Codes 10 11### 13900001 Operation Not Permitted 12 13**Error Message** 14 15Operation not permitted 16 17**Possible Causes** 18 19The current operation on the file is not allowed. 20 21**Solution** 22 23Check the permission for the file. 24 25### 13900002 File or Directory Not Exist 26 27**Error Message** 28 29No such file or directory 30 31**Possible Causes** 32 33The file or directory does not exist. 34 35**Solution** 36 37Check whether the file directory exists. 38 39### 13900003 Process Not Exist 40 41**Error Message** 42 43No such process 44 45**Possible Causes** 46 47The process does not exist. 48 49**Solution** 50 511. Check whether the process is killed unexpectedly. 522. Check whether the service related to the process has started. 53 54### 13900004 System Call Interrupted 55 56**Error Message** 57 58Interrupted system call 59 60**Possible Causes** 61 62The system call is interrupted by another thread. 63 64**Solution** 65 661. Check the multi-thread code logic. 672. Invoke the system call again. 68 69### 13900005 I/O Error 70 71**Error Message** 72 73I/O error 74 75**Possible Causes** 76 77The I/O request is invalid. 78 79**Solution** 80 81Initiate the I/O request again. 82 83### 13900006 Device or Address Not Exist 84 85**Error Message** 86 87No such device or address 88 89**Possible Causes** 90 91The device information or address is incorrect. 92 93**Solution** 94 95Check that the device information or address is correct. 96 97### 13900007 Long Parameter List 98 99**Error Message** 100 101Arg list too long 102 103**Possible Causes** 104 105The parameter list is too long. 106 107**Solution** 108 109Reduce the number of parameters. 110 111### 13900008 Invalid File Descriptor 112 113**Error Message** 114 115Bad file descriptor 116 117**Possible Causes** 118 119This file descriptor is closed. 120 121**Solution** 122 123Check whether the file descriptor is closed. 124 125### 13900009 Child Process Not Exist 126 127**Error Message** 128 129No child processes 130 131**Possible Causes** 132 133The child process cannot be created. 134 135**Solution** 136 137Check the maximum number of processes in the system. 138 139### 13900010 Resource Unavailable 140 141**Error Message** 142 143Try again 144 145**Possible Causes** 146 147The resources are blocked. 148 149**Solution** 150 151Request resources. 152 153### 13900011 Memory Overflow 154 155**Error Message** 156 157Out of memory 158 159**Possible Causes** 160 161A memory overflow occurs. 162 163**Solution** 1641. Check the memory overhead. 1652. Control the memory overhead. 166 167### 13900012 Permission Denied 168 169**Error Message** 170 171Permission denied 172 173**Possible Causes** 174 175 176 1771. You do not have the permission to operate the file. 1782. The file sandbox path is incorrect. 179 180**Solution** 1811. Check that you have the permission to operate the file. 1822. Check that the file sandbox path is correct. 183 184### 13900013 Incorrect Address 185 186**Error Message** 187 188Bad address 189 190**Possible Causes** 191 192The address is incorrect. 193 194**Solution** 195 196Check that the address is correct. 197 198### 13900014 Device or Resource Not Available 199 200**Error Message** 201 202Device or resource busy 203 204**Possible Causes** 205 206The requested resource is unavailable. 207 208**Solution** 209 210Request the resource again. 211 212### 13900015 File Already Exists 213 214**Error Message** 215 216File exists 217 218**Possible Causes** 219 220The file to be created already exists. 221 222**Solution** 223 224Check whether the file path is correct. 225 226### 13900016 Invalid Cross-Device Link 227 228**Error Message** 229 230Cross-device link 231 232**Possible Causes** 233 234The link between devices is incorrect. 235 236**Solution** 237 238Check the devices and create the link correctly. 239 240### 13900017 Device Not Exist 241 242**Error Message** 243 244No such device 245 246**Possible Causes** 247 248The device is not identified. 249 250**Solution** 251 252Check the connection to the target device. 253 254### 13900018 Invalid Directory 255 256**Error Message** 257 258Not a directory 259 260**Possible Causes** 261 262The specified directory is invalid. 263 264**Solution** 265 266Check that the directory is correct. 267 268### 13900019 The Specified Object Is a Directory 269 270**Error Message** 271 272Is a directory 273 274**Possible Causes** 275 276The specified object is a directory. 277 278**Solution** 279 280Check that the specified data is correct. 281 282### 13900020 Invalid Parameter 283 284**Error Message** 285 286Invalid argument 287 288**Possible Causes** 289 290Invalid input parameter is detected. 291 292**Solution** 293 294Check that the input parameters are valid. 295 296### 13900021 Too Many File Descriptors Opened 297 298**Error Message** 299 300File table overflow 301 302**Possible Causes** 303 304The number of file descriptors opened has reached the limit. 305 306**Solution** 307 308Close the file descriptors that are no longer required. 309 310### 13900022 Too Many Files Opened 311 312**Error Message** 313 314Too many open files 315 316**Possible Causes** 317 318The number of files opened has reached the limit. 319 320**Solution** 321 322Close the files that are not required. 323 324### 13900023 Text File Not Respond 325 326**Error Message** 327 328Text file busy 329 330**Possible Causes** 331 332The executable file of the program is in use. 333 334**Solution** 335 336Close the program that is being debugged. 337 338### 13900024 File Oversized 339 340**Error Message** 341 342File too large 343 344**Possible Causes** 345 346The file size exceeds the limit. 347 348**Solution** 349 350Check whether the file size exceeds the limit. 351 352### 13900025 Insufficient Space on the Device 353 354**Error Message** 355 356No space left on device 357 358**Possible Causes** 359 360The device storage space is insufficient. 361 362**Solution** 363 364Clear the space of the device. 365 366### 13900026 Invalid Shift 367 368**Error Message** 369 370Illegal seek 371 372**Possible Causes** 373 374Seek is used in pipe or FIFO. 375 376**Solution** 377 378Check the use of seek. 379 380### 13900027 Read-Only File System 381 382**Error Message** 383 384Read-only file system 385 386**Possible Causes** 387 388The file system allows read operations only. 389 390**Solution** 391 392Check whether the file is read-only. 393 394### 13900028 Links Reach the Limit 395 396**Error Message** 397 398Too many links 399 400**Possible Causes** 401 402The number of links to the file has reached the limit. 403 404**Solution** 405 406Delete the links that are no longer required. 407 408### 13900029 Resource Deadlock 409 410**Error Message** 411 412Resource deadlock would occur 413 414**Possible Causes** 415 416Resource deadlock occurs. 417 418**Solution** 419 420Terminate the deadlock process. 421 422### 13900030 Long File Name 423 424**Error Message** 425 426Filename too Long 427 428**Possible Causes** 429 430The length of the path or file name exceeds the limit. 431 432**Solution** 433 434Modify the path or file name. 435 436### 13900031 Function Not Implemented 437 438**Error Message** 439 440Function not implemented 441 442**Possible Causes** 443 444The function is not supported by the system. 445 446**Solution** 447 448Check the system version and update the system if required. 449 450### 13900032 Directory Not Empty 451 452**Error Message** 453 454Directory not empty 455 456**Possible Causes** 457 458The specified directory is not empty. 459 460**Solution** 461 4621. Check the directory. 4632. Ensure that the directory is empty. 464 465### 13900033 Too Many Symbol Links 466 467**Error Message** 468 469Too many symbolic links 470 471**Possible Causes** 472 473There are too many symbolic links. 474 475**Solution** 476 477Delete unnecessary symbol links. 478 479### 13900034 Operation Blocked 480 481**Error Message** 482 483Operation would block 484 485**Possible Causes** 486 487The operation is blocked. 488 489**Solution** 490 491Perform the operation again. 492 493### 13900035 Invalid File Descriptor 494 495**Error Message** 496 497Invalid request descriptor 498 499**Possible Causes** 500 501The requested file descriptor is invalid. 502 503**Solution** 504 505Check that the file descriptor is valid. 506 507### 13900036 Target Is Not a Character Stream Device 508 509**Error Message** 510 511Device not a stream 512 513**Possible Causes** 514 515The device pointed to by the file descriptor is not a character stream device. 516 517**Solution** 518 519Check whether the file descriptor points to a stream device. 520 521### 13900037 No Data Available 522 523**Error Message** 524 525No data available 526 527**Possible Causes** 528 529The required data is not available. 530 531**Solution** 532 533Request the data again. 534 535### 13900038 Value Mismatches the Data Type 536 537**Error Message** 538 539Value too large for defined data type 540 541**Possible Causes** 542 543The specified value is out of the range defined for the data type. 544 545**Solution** 546 547Modify the data type. 548 549### 13900039 File Descriptor Corrupted 550 551**Error Message** 552 553File descriptor in bad state 554 555**Possible Causes** 556 557The file descriptor is corrupted. 558 559**Solution** 560 561Check that the file descriptor is valid. 562 563### 13900040 System Call Interrupted 564 565**Error Message** 566 567Interrupted system call should be restarted 568 569**Possible Causes** 570 571The system call is interrupted. 572 573**Solution** 574 575Invoke the system call again. 576 577### 13900041 Disk Quota Exceeded 578 579**Error Message** 580 581Quota exceeded 582 583**Possible Causes** 584 585The disk space is insufficient. 586 587**Solution** 588 589Clear disk space. 590 591### 13900042 Unknown Error 592 593**Error Message** 594 595Unknown error 596 597**Possible Causes** 598 599The error is unidentified. 600 601**Solution** 6021. Call the API again. 6032. Restart the service. 604 605## User Data Management Error Codes 606 607### 14000001 Invalid File Name 608 609**Error Message** 610 611Invalid display name 612 613**Possible Causes** 614 615The file name contains invalid characters. 616 617**Solution** 618 619Modify the file name. 620 621### 14000002 Invalid URI 622 623**Error Message** 624 625Invalid uri 626 627**Possible Causes** 628 629The URI is invalid. 630 631**Solution** 632 633Use the obtained URI. 634 635### 14000003 Invalid File Name Extension 636 637**Error Message** 638 639Invalid file extension 640 641**Possible Causes** 642 643The file name extension is incorrect. 644 645**Solution** 646 647Modify the file name extension. 648 649### 14000004 File in Recycle Bin 650 651**Error Message** 652 653File has been put into trash bin 654 655**Possible Causes** 656 657The file is moved to the Recycle Bin. 658 659**Solution** 660 661Check whether the file is in the Recycle Bin. 662 663## Spatial Statistics Error Codes 664 665### 13600001 IPC Failed 666 667**Error Message** 668 669IPC error 670 671**Possible Causes** 672 673The called service does not exist. 674 675**Solution** 676 677Check whether the service is started. 678 679### 13600002 File System Not Supported 680 681**Error Message** 682 683Not supported file system 684 685**Possible Causes** 686 687The file system is not supported. 688 689**Solution** 690 691Use a supported file system. 692 693### 13600003 Mount Failed 694 695**Error Message** 696 697Failed to mount 698 699**Possible Causes** 700 701The **mount** command fails. 702 703**Solution** 704 705Remove the card and run the **mount** command again. 706 707### 13600004 Unmount Failed 708 709**Error Message** 710 711Failed to unmount 712 713**Possible Causes** 714 715The device does not respond. 716 717**Solution** 718 719Check whether the file is being used. If yes, kill the thread that uses the file. 720 721### 13600005 Incorrect Volume State 722 723**Error Message** 724 725Incorrect volume state 726 727**Possible Causes** 728 729The volume state is incorrect. 730 731**Solution** 732 733Check whether the current volume state is correct. 734 735### 13600006 Failed to Create a Directory or Node 736 737**Error Message** 738 739Prepare directory or node error 740 741**Possible Causes** 742 743The directory or node to be created already exists. 744 745**Solution** 746 747Check whether the directory or node to be created already exists. 748 749### 13600007 Failed to Delete a Directory or Node 750 751**Error Message** 752 753Delete directory or node error 754 755**Possible Causes** 756 757The specified directory or node has been deleted. 758 759**Solution** 760 761Check whether the specified directory or node exists. 762 763### 13600008 Object Not Exist 764 765**Error Message** 766 767No such object 768 769**Possible Causes** 7701. The specified volume ID is incorrect. 7712. The specified bundle name is incorrect. 772 773**Solution** 7741. Check whether the specified volume exists. 7752. Check whether the specified bundle name exists. 776 777### 13600009 Invalid User ID 778 779**Error Message** 780 781User id out of range 782 783**Possible Causes** 784 785The specified user ID is incorrect. 786 787**Solution** 788 789Check that the user ID is correct. 790 791## User File Access Error Codes 792 793### 14300001 IPC Failed 794 795**Error Message** 796 797IPC error 798 799**Possible Causes** 800 8011. The server service does not exist. 8022. The extension mechanism is abnormal. 803 804**Solution** 805 806Check that the server service exists. 807 808### 14300002 Incorrect URI Format 809 810**Error Message** 811 812Invalid uri 813 814**Possible Causes** 815 816The URI is invalid. 817 818**Solution** 819 820Check that the URI is in correct format. 821 822### 14300003 Failed to Obtain the Server Ability Information 823 824**Error Message** 825 826Fail to get fileextension info 827 828**Possible Causes** 829 830The BMS interface is abnormal. 831 832**Solution** 833 834Check for basic system capability errors. 835 836### 14300004 Incorrect Result Returned by js-server 837 838**Error Message** 839 840Get wrong result 841 842**Possible Causes** 843 844The data returned by the server is incorrect. 845 846**Solution** 847 848Check the data returned by the server. 849 850### 14300005 Failed to Register Notify 851 852**Error Message** 853 854Fail to register notification 855 856**Possible Causes** 8571. The server service does not exist. 8582. The extension mechanism is abnormal. 859 860**Solution** 861 862Check that the server service exists. 863 864### 14300006 Failed to Unregister Notify 865 866**Error Message** 867 868Fail to remove notification 869 870**Possible Causes** 8711. The server service does not exist. 8722. The extension mechanism is abnormal. 873 874**Solution** 875 876Check that the server service exists. 877 878### 14300007 Failed to Initialize the Notify Agent 879 880**Error Message** 881 882Fail to init notification agent 883 884**Possible Causes** 885 886The specified Notify agent has not been registered. 887 888**Solution** 889 890Check whether the specified Notify agent is registered. 891 892### 14300008 Failed to Notify the Agent 893 894**Error Message** 895 896Fail to notify agent 897 898**Possible Causes** 8991. The service does not exist. 9002. The extension mechanism is abnormal. 901 902**Solution** 903 904Check whether the client is normal. 905 906## Error Code Adaptation 907The APIs provided by the file management subsystem support exception handling. 908Sample code for exception handling in a synchronous API: 909```js 910import fs from '@ohos.file.fs' 911 912try { 913 let file = fs.openSync(path, fs.OpenMode.READ_ONLY); 914} catch (err) { 915 console.error("openSync errCode:" + err.code + ", errMessage:" + err.message); 916} 917``` 918Sample code for exception handling in an asynchronous API (promise): 919```js 920import fs from '@ohos.file.fs' 921 922try { 923 let file = await fs.open(path, fs.OpenMode.READ_ONLY); 924} catch (err) { 925 console.error("open promise errCode:" + err.code + ", errMessage:" + err.message); 926} 927``` 928 929Sample code for exception handling in an asynchronous API (callback): 930```js 931import fs from '@ohos.file.fs' 932 933try { 934 fs.open(path, fs.OpenMode.READ_ONLY, function(e, file){ // Asynchronous thread (such as the system call) errors are obtained via a callback. 935 if (e) { 936 console.error("open in async errCode:" + e.code + ", errMessage:" + e.message); 937 } 938 }); 939} catch (err) {// Main thread errors (such as invalid parameters) are obtained by try catch. 940 console.error("open callback errCode:" + err.code + ", errMessage:" + err.message); 941} 942``` 943