Salesforce

Error 354 or 2257 occurs at startup, with errno=13 explained

« Go Back

Information

 
TitleError 354 or 2257 occurs at startup, with errno=13 explained
URL NameP7743
Article Number000148908
EnvironmentProduct: Progress
Version: 9.x
Product: OpenEdge
Version: 10.x, 11.x, 12.x
OS: All supported platforms
Question/Problem Description
Error 354 or 2257 occurs at startup, with errno=13
One of the following errors occurs when starting a process where the <filename> refers to a client temporary file: lbi, srt, pgm, dbi, rca
Unable to open or create <filename>, error 13 (354)
Unable to open or create <filename>, error errno=13. (2257)
Steps to Reproduce
Clarifying Information
Error MessageUnable to open or create <filename>, error 13 (354)
Unable to open or create <filename>, error errno=13. (2257)

Disconnect from server; database is being shutdown. (2659)
Defect Number
Enhancement Number
Cause
Resolution
When a process starts in a directory where the user has no write permissions, the required temp files cannot be created and opened on disk to store the required information related to their application code execution. 

1. Permissions on Database (server-side) or client temp files can be fixed by restarting the database or client process from a directory with the required permissions or with a distinct -T directory
Making permission changes on the current directory will allow new processes to create client-temp files, but existing processes will not have their permissions elevated. They need to be restarted.

2. To protect the OE environment, add distinct -T directory for databases (and clients). This will assure temp files are always created in a distinct directory with the required permissions and sufficient disk space available, in particular on UNIX systems where the temp files are not visible without the -t parameter.

3. When this issue arises after IT Admin actions and usually a server reboot, the OS changes are the only true source and answer to assuring this does not happen again when the OpenEdge environment is started. It has nothing to do with OE, that's just working within the bounds of permissions granted, which have since changed. The permissions of the current process can for example be found by running strace/truss. 

Example: A client connecting client-server succeeds. As soon as the client session runs a FOR EACH with "OR" query which requires a results-list srt temp-file on the server-side it fails:
Unable to access the temp-file is fatal, the remote server disconnects users it's serving after clearing their process context then terminates itself:
(354) Unable to open or create srtauWl4L, error 13
(2252) Begin transaction backout
(2253) Transaction backout completed
(739)   Logout usernum <usrnum>, userid <userid>
(2520) Stopped
The client session terminates as the remote server that was serving their request has terminated (not the database)
Disconnect from server; database is being shutdown. (2659)
          
Often verifying current permissions does not show why the permissions problem is occurring. Creating a test database or by restarting the production database and running the same query succeeds, while those currently running continue to fail because permissions have since been changed after the process was initially started

a. It could have been the database was started from another directory they usually don't start from, where the user had no file create/open/write permissions
b. It could be that directory permissions rx to descend & final directory rw ( + umask & potentially ACL ) have since been changed
c. Specific OS features like UAC or SELinux are yet another datum-point that could have changed since dbs were started and when you checked

Ensure the user has write permissions to the working directory to assure temporary files can be created.
  1. These temp files are always opened for client sessions, they are only created on the server-side (database) when required.
  2. When  -T (Temporary Directory) is not specified to force a specific working directory with the required write permissions, these files are not necessarily created in $WRKDIR, they're created in the directory the process is started from:
Example: Where are Temp-files created?
 
// query.p
FOR EACH customer WHERE salesrep = "HXM"
    OR salesrep = "DKP"
    OR salesrep = "BBB":
    DISP customer.NAME salesrep.
END.

echo $WRKDIR # /db
cd ./data/db1
/db/data/db1> prodb test sports2000

/db/data/db1> cd /temp
temp> mkdir /temp/c1
temp> mkdir /temp/c2
temp> mkdir /temp/db

temp> proserve test -S 9898 -t # no srt* created (server)

temp> cd c1
temp/c1> mpro test -S 9898 -t # /temp/c1/srt* (the directory the client process started), no temp/srt* created (server)
run query.p # /temp/srt* (created for the server process in the directory the server process was started )

temp/c1> cd ..
temp> proserve test -m3 -S 8989 -t -T /temp/db # no srt* created in -T directory (server)
temp> mpro test -S 8989 -t -T /temp/c2 # /temp/c2/srt* (created in -T directory of client)
run query.p # /temp/db/srt* (created for the server process in the -T directory the process was started )

          
Workaround
Notes
Keyword Phrase
Last Modified Date1/11/2021 11:34 AM

Powered by