Informix Error -4821: The file file_name cannot be created or opened. Accompanying OS message : OS_Message.
Cause and resolution
The file file_name cannot be created or opened. Accompanying OS message : OS_Message.
Check that your username, has permission to create files in the specified directory. Look for the accompanying error messages from the operating system. Possibly the disk is full, or you have reached a limit on the number of open files.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-4821 fires when a file I/O Open (or similar) operation fails to create/open a named
file — per the official guidance.
- Insufficient permission to create files in the target directory, per the official guidance — the first named cause.
- A full disk, per the official guidance — the second named cause.
- A limit reached on the number of open files, per the official guidance — the third named cause.
Solutions / Resolution
- Check that the account has permission to create files in the target directory, per the official guidance.
- Look for the accompanying operating-system error message, per the official guidance, for the specific cause.
- Free disk space, or close unused open files, as the diagnosis indicates.
Examples
Checking permission and free space
$ ls -ld /path/to/target/dir
$ df -h /path/to/target/dir
Diagnostic Checks
- Check the accompanying OS message, permissions on the target directory, available disk space, and the process's open-file count.
Related Errors / Related Topics
- -4822 — "The file file_name cannot be closed." A related file I/O failure, about closing rather than creating/opening.
- -4823 — "The file associated with the file descriptor may not be opened." A related file I/O failure, about an invalid/stale descriptor rather than the open itself failing.
- -4824 — "The file "%s" cannot be read." A related file I/O failure, about reading rather than opening.
- -4826 — "The file file_name cannot be written." A related file I/O failure, about writing rather than opening.
A file couldn't be created or opened — check permissions, disk space, and the open-file limit, using the accompanying OS message for the specific cause.