Solved

Reasons for Err#13 EACCES when permissions are ok (in AIX)

Posted on 2014-02-22
13
1,473 Views
Last Modified: 2014-03-02
Hi,

This is for a post-analysis of a problem I'v encountered. No access to the system for the moment.

I had a process that cannot access to write to a file. Error looking like permission denied.
But I checked the permissions and were fine. Even with a chmod 777 on the whole path.

What is strange is that if I try with the same user as the process owner, I'm able to write to the file. And if I change the owner of the directory to the same user as the process it works (and finally this was the workaround).

But i still don't undertand why i had the error.
Here is the truss from the process when encountering the error:
statx("/home/u1/sz/out/test.txt", 0x0FFFFFFFFFFE8250, 176, 010) Err#13 EACCES
statfs("/home/u1/sz/out/test.txt", 0x0FFFFFFFFFFE7E30) Err#13 EACCES
statx("/home/u1/sz/out/test.txt", 0x0FFFFFFFFFFE8108, 176, 011) Err#13 EACCES
kopen("/home/u1/sz/out/test.txt", O_WRONLY|O_CREAT|O_TRUNC|O_LARGEFILE, S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH) Err#13 EACCES

Open in new window


If anybody has an idea why this error is raised even for a directory that is rwxrwxrwx - and probably related to the environment (because the same user can do it from shell)

Thanks a lot,
Franck.
0
Comment
Question by:Franck Pachot
  • 6
  • 5
  • 2
13 Comments
 
LVL 76

Expert Comment

by:slightwv (䄆 Netminder)
ID: 39879929
This was cross-posted in an Oracle Zone.  I'm not seeing the Oracle connection.  Can you clarify?
0
 
LVL 15

Author Comment

by:Franck Pachot
ID: 39879949
Hi. I don't know why it is in the Oracle Zone. I didn't select it. Maybe there is a default zone. Well there is no connection with Oracle except that the error occured when using utl_file. The procedure works when connected local but not when connected through the listener. But I don't know think the issue is related with Oracle. i don't see how to change the zone...
0
 
LVL 76

Expert Comment

by:slightwv (䄆 Netminder)
ID: 39879973
I can change the zone if necessary but now I don't think it is.

What is your version of Oracle (all 4 numbers please, ex./ 11.2.0.4)?

Can you explain a little more about the process?  What are the moving pieces and how are the interacting?
0
 
LVL 20

Expert Comment

by:carlmd
ID: 39882151
Did the directory that the file was in have write permission for group or other? Since the user was not the owner, one these would have to be true unless using the sticky bit.
0
 
LVL 15

Author Comment

by:Franck Pachot
ID: 39883377
Yes, all the directory path was chmod 777 and result was the same
0
 
LVL 20

Expert Comment

by:carlmd
ID: 39883511
This is most likely an Oracle issue. Take a look at the following:

http://docs.oracle.com/cd/E19253-01/816-4557/privtask-6/
0
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
LVL 15

Author Comment

by:Franck Pachot
ID: 39883740
Thanks for that which I didn't know. But that is for Solaris. I was on AIX and it seems that I didn't have the extended /proc for more information :(
0
 
LVL 76

Expert Comment

by:slightwv (䄆 Netminder)
ID: 39883752
Any reason you are ignoring my request for additional information in http:#a39879973 ?
0
 
LVL 15

Author Comment

by:Franck Pachot
ID: 39885259
Ok I've figured out what happened. The process owner did not have the right permissions when the process started. Once restarted it is fine.
0
 
LVL 76

Expert Comment

by:slightwv (䄆 Netminder)
ID: 39885528
If you can explain what the 'right permissions' were if not 777 on the file system, feel free to accept that explanation as the answer to this question.
0
 
LVL 15

Accepted Solution

by:
Franck Pachot earned 0 total points
ID: 39886378
Hi. Restarting the process solved the issue but there is no solution here as it's just observation, not explanation.
0
 
LVL 76

Expert Comment

by:slightwv (䄆 Netminder)
ID: 39886405
OH, I misunderstood.  Feel free to accept that post.

FYI: 777 permissions are bad.  Now that you uunderstand the issue, you might want to restrict access to the folder to the minimum necessary.
0
 
LVL 15

Author Closing Comment

by:Franck Pachot
ID: 39898370
Restarting the process solved the issue but there is no solution here as it's just observation, not explanation.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Truncate is a DDL Command where as Delete is a DML Command. Both will delete data from table, but what is the difference between these below statements truncate table <table_name> ?? delete from <table_name> ?? The first command cannot be …
Background In several of the companies I have worked for, I noticed that corporate reporting is off loaded from the production database and done mainly on a clone database which needs to be kept up to date daily by various means, be it a logical…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now