System.UnauthorizedAccessException: Access to the path 'E:\approot\ - azure

I have an xml file in my project at the root directory that is supposed to be used for read/write operations. And this code works fine when i run it on my local machine, however it throws
System.UnauthorizedAccessException: Access to the path 'E:\approot\...
when the application is deployed on Cloud. I have also tried adding following setting for elevated permissions in csdef file
<Runtime executionContext="elevated"></Runtime>
still no luck. Is Read/Write permission at root directory is not given in Azure? Here I am trying to write from the same application to its root folder. I am using following code to get the file path
string baseDirectoryParent = Directory.GetParent(baseDirectory).Parent.FullName;

No, you should use localstorage:
http://msdn.microsoft.com/en-us/library/windowsazure/ee758708.aspx

Related

NiFi 1.10.0 - PutFile does not see the destination directory

We are facing a peculiar problem on one of our 2 environments. A PutFile processor throws the following error
PutFile[id=xxx] Penalizing StandardFlowFileRecord[uuid=xxx,claim=StandardContentClaim [resourceClaim=StandardResourceClaim[id=xxx, container=default, section=1012], offset=94495, length=9778],offset=0,name=xxxxxxxxxxxxxxxx_PROD_20200513020001.json.gz,size=9778] and routing to 'failure' because the output directory /data/home/datadelivery/OUT/Test does not exist and Processor is configured not to create missing directories
After enabling the creation of missing directories, the error changes to:
Could not set create directory with permissions 664 because /data/home/datadelivery/OUT/Test: java.nio.file.AccessDeniedException: /data/home/datadelivery/OUT/TestPutFile[id=xxx...
Based on the error message one would think that it is an issue with file and folder permissions, however, the path /data/home/datadelivery/OUT/Test exists, and the nifi user can access and create files and folders in there as well (verified from the command line). The same folder permissions and ownership rights are configured on our DEV environment, where the PutFile processor works as expected. We could change the configuration to use a different location, but I'd rather find the root cause instead.
Where should I start debugging?
Thank you for your help in advance!
Kind regards, Julius
Strange issue, I would try to set full permission on the folder/file you want to write (ie chmod 777 + chown nifi:nifi + recursively), and see if the error is still there. If not it's kind of a start ...
Restarting the NiFi service solved the problem. The issue was that the Unix user (nifi) was modified months after starting the NiFi service. Most probably this was the reason the PutFile processor wasn't able to access a folder which the nifi unix user could.

iisnode not able to access file present in network file path

I am node app through iisnode. I can access file present in network path but when the application tries to access the file, it complains ' File doesn't exist'.
I tried adding IIS_IUSRS user group to have access to iisnode www directory in my local machine. I changed the username(from application pool) of the application to which I have permission(R/W) on the network path. Restarted my machine. But still problem persist.
Can someone help me if there is issue between iisnode and network file path.
const csv=require('csvtojson');
function fetchFile(){
sUsagefile ="\\\\abc\\xyz\\com.csv" .
csv().fromFile(sUsagefile));
console.log(sUsagefile);
}
Error: File does not exist. Check to make sure the file path to your csv is correct.
at C:\iisnode\www\node_modules\csvtojson\v2\Converter.js:81:37
at FSReqWrap.cb [as oncomplete] (fs.js:312:19)
I tried to access UNC path with iisnode and it was working perfectly.
Have you tried to grant IUSR and IIS Apppool\ read/writepermission for network path \abc\xyz\com.csv directly?
Besides, have you checked whether \abc\xyz\com.csv can be accessed from file explorer when IIS stop working.
It is suggested to use process monitor tool to monitor what path is read by node.exe. Please download process monitor from here:https://learn.microsoft.com/zh-cn/sysinternals/downloads/procmon then add a filter like “Path contains com.csv". Finally we would know what path the application is trying to read.

Access Local Files from IIS "silverligh"

In a silver-light application I'm using to the following code in my Visual Studio development environment
it works fine
FileStream file = new FileStream(#"D:\OP20TS.jpg", FileMode.Open);
but when publish website on iis it give me
File Operation to not permitted Access to path D:\OP20TS.jpg is denied
I have tried to give IIS full permission to the path but not work how to handle this point
Thanks in advance

Error: ENOENT, no such file or directory './assets'

After setting up koa-static-folder, my image loads great when I test over localhost with http://localhost:3000/assets/myimage.jpg
But after deploying our node code to an Ubuntu server, we get:
Error: ENOENT, no such file or directory './assets'
What's Ubuntu's issue here? Not sure how to resolve this.
The code that is working locally is:
var koa = require('koa')(),
serve = require('koa-static-folder');
koa.use(serve('./assets'));
Sounds like a permission issue (but I could be wrong!) such that the user that node.js is running under does not have access rights to the assets folder. If this is the problem you have to change access permissions to the folder (see chmod) or run node.js as a user that has the access rights.
If the server isn't publicly accessible you could run the application as sudo to verify if it is a permissions problem or not. Note that using sudo is not a long term solution since it is highly irresponsible/unsecure to run the application as the root user.

Users can't upload files, even with permissions set to them using vsftpd

I have a cloud hosting linux solution. I had vsftpd working on it, but after having issues and tinkering with a lot of settings, I now have an issue where users can login using FTP and connect to the correct home directory, navigate within it, download files but they cannot upload files to the server. They get a time out error, which appears to be a permissions error, but I can't narrow it down any more than that. /var/logs/syslog gives nothing away.
The folders belong to the users. The parent www folder is set to 555. Can anyone help with this issue at all?
Cheers,
T
Try to set the permissions to 755, 555 doesn't allow writing for anyone. Are your user and group different?
You also may need to enable logging for FTP server. The time out error may include some other errors, not only permission denied.
To have extended logging change the variables in your ftp config file:
dual_log_enable=YES
log_ftp_protocol=YES
xferlog_enable=YES
syslog_enable=NO
and check the log file name there.
you must create a folder into user folder (Example : /var/www/user1/upload).
and set permission 777 (Example : chmod 777 /var/www/user1/upload).
then upload file into this folder.

Resources