Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

file400.error: File initialization failed. #1

Open
jkyeung opened this issue Mar 5, 2020 · 7 comments
Open

file400.error: File initialization failed. #1

jkyeung opened this issue Mar 5, 2020 · 7 comments

Comments

@jkyeung
Copy link

jkyeung commented Mar 5, 2020

I realize this isn't very much information to go on, but I am getting this error no matter what I try.

When I restored the SAVF, I did get some notice about QDFTOWN. I tried changing the *PUBLIC authority to *ALL for both the PYTHON3 library and the RECLEVACC service program, which didn't seem to make a difference.

I am happy to provide more details if you tell me what to look for.

@perg
Copy link
Owner

perg commented Mar 17, 2020

It may be an authority issue.You could try to change the owner of the srvpgm be a user with full authority to the database and set usrprf to *owner, chgsrvpgm python3/reclevacc usrprf(*owner)

@jkyeung
Copy link
Author

jkyeung commented Mar 17, 2020

It may be an authority issue.You could try to change the owner of the srvpgm be a user with full authority to the database and set usrprf to *owner, chgsrvpgm python3/reclevacc usrprf(*owner)

I just tried those things and am still getting the same error.

Could the system CCSID be an issue at all? We are one of those old-school shops that uses 65535.

@perg
Copy link
Owner

perg commented Mar 18, 2020

I'm not sure, we don't use 65535.
The lib/file name is converted from ascii to the job ccsid, using QtqIconvOpen. If the CCSID of the current job is 65535, the default CCSID from the DFTCCSID job attribute is used.

@jkyeung
Copy link
Author

jkyeung commented Mar 18, 2020

The lib/file name is converted from ascii to the job ccsid, using QtqIconvOpen. If the CCSID of the current job is 65535, the default CCSID from the DFTCCSID job attribute is used.

That makes sense. As far as I can tell, our jobs have DFTCCSID=37, so it doesn't seem like the problem is related to text encoding.

@kadler
Copy link

kadler commented May 19, 2021

Searching through the code in GitHub (which GH search can be hit or miss), there's only one point which returns that exact message:

file400/source/file400.c

Lines 2589 to 2593 in 02aed76

result = call_fileGetStruct(f->fileno, &f->fi);
if (result == -1) {
PyErr_SetString(file400Error, "File initialization failed.");
return -1;
}

This calls call_fileGetStruct which calls the ILE fileGetStruct function.

Of course that only happens if call_fileInit returns 0 and fileGetStruct doesn't seem like it returns anything other than 0, so it is likely in fileInit so it looks like the problem is from one of the calls to QDBRTVFD.

@jkyeung
Copy link
Author

jkyeung commented May 21, 2021

[...] so [the failure] is likely in fileInit so it looks like the problem is from one of the calls to QDBRTVFD.

Indeed. Through experimentation, it seemed that I didn't have (much) problem with files that only have a smallish number of fields. The file that was giving me problems has over 300 fields. I found this thread talking about a similar issue. If it's true that the FILD0200 format can return over 400 bytes per field, then maybe it's exceeding the allocated buffer (100000 bytes)?

@darrenspielman
Copy link

Getting this error.. any thoughts? allocated buffer should not be exceeding the max.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants