Informix Error -4041: Including "file" again will cause an infinite loop.
Cause and resolution
Including "file" again will cause an infinite loop.
This INCLUDEAGAIN statement specifies a file that includes itself. If you force it to be included, a loop will follow. Make sure that this is the file you intended to include. Review the contents of the file.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-4041 fires when an INCLUDEAGAIN statement names a file that includes itself — per the
official guidance, forcing that file to be included would create an infinite loop.
- An
INCLUDEAGAINstatement naming a file that (directly or indirectly) includes itself, per the official guidance — the direct, only cause.
Solutions / Resolution
- Confirm this is the file genuinely intended for inclusion, per the official guidance.
- Review the contents of the file to break the self-inclusion chain if it wasn't intended, per the official guidance.
Examples
A self-including file
-- in orderdefs.4gl:
INCLUDEAGAIN "orderdefs.4gl"
-- -4041: orderdefs.4gl includes itself
Diagnostic Checks
- Check the named file's own
INCLUDE/INCLUDEAGAINstatements for a chain that leads back to itself.
Related Errors / Related Topics
- -4010 — "Include file "pathname" is not found." A related
INCLUDE-mechanism error, about a missing file rather than a self-referential inclusion loop.
An INCLUDEAGAIN'd file includes itself, which would loop forever — confirm the file and
review its own includes.