David Williamson
asked on
CFFILE access denied on copy
I have read several threads about this, followed the suggestions, and have not been able to solve this problem.
An exception occurred when performing a file operation copy on files \\main\clients\Clients.xls and \\server2\Clients. When running:
<cffile action="copy" source="\\main\clients\Cli ents.xls" destination="\\server2\Cli ents" nameconflict="overwrite">
I get an error:
The cause of this exception was: java.io.FileNotFoundExcept ion: \\server2\Clients (Access is denied).
I have checked permissions and they seem to be fine. How can I verify which user Cold Fusion server is running under?
An exception occurred when performing a file operation copy on files \\main\clients\Clients.xls
<cffile action="copy" source="\\main\clients\Cli
I get an error:
The cause of this exception was: java.io.FileNotFoundExcept
I have checked permissions and they seem to be fine. How can I verify which user Cold Fusion server is running under?
the destination should be
\\server2\clients\
you are missing a "\"
\\server2\clients\
you are missing a "\"
ASKER
adding a slash on the destination gave me an 'invalid destination' error. Adding the name of the file in the destination gave the same access denied error.
What about verifying the user that cold fusion is logged in as?
The reason I am trying this is because my original solution (that worked before I installed Server 2003) was to operate directly on the file where it was, on server2. I was unable to add it as a datasource in CF admin. So, since I haven't been able to figure that out, I'm trying to connect to the spreadsheet locally, then copy it to its original location. Its a crappy fix, but I can't get it to connect properly as a datasource.
What about verifying the user that cold fusion is logged in as?
The reason I am trying this is because my original solution (that worked before I installed Server 2003) was to operate directly on the file where it was, on server2. I was unable to add it as a datasource in CF admin. So, since I haven't been able to figure that out, I'm trying to connect to the spreadsheet locally, then copy it to its original location. Its a crappy fix, but I can't get it to connect properly as a datasource.
ASKER
here is the error with the slash:
Attribute validation error for tag CFFILE.
The value of the attribute destination, which is currently "\\server2\clients\", is invalid.
The error occurred in D:\CFusionMX\wwwroot\Wrigh t_2.0\Clie nts-m2s.cf m: line 1
1 : <cffile action="copy" source="\\main\clients\Cli ents.xls" destination="\\server2\cli ents\" nameconflict="overwrite">
-------------------------- ---------- ---------- ---------- ---------- ---------- ----
Attribute validation error for tag CFFILE.
The value of the attribute destination, which is currently "\\server2\clients\", is invalid.
The error occurred in D:\CFusionMX\wwwroot\Wrigh
1 : <cffile action="copy" source="\\main\clients\Cli
--------------------------
can you get to the folder clients on the destination server(server2) by typing the UNC path? say like\\server2\clients\
the fix i was talking about was from here
http://www.macromedia.com/support/coldfusion/ts/documents/tn17171.htm
the fix i was talking about was from here
http://www.macromedia.com/support/coldfusion/ts/documents/tn17171.htm
ASKER
Yes, I can, from both my local machine, and the machine that is running the CF server.
If it is Win2K3 then you should check the permissions of the user as you suspected. See if the user has permissions to write to the clients directory on the win2k3 server.
I think that since you are having trouble creating a datasource - this problem is related. It sounds like a permissions issue...
I think that since you are having trouble creating a datasource - this problem is related. It sounds like a permissions issue...
ASKER
that post your link refers to was last updated in 1998...
ASKER
where can I check which user the CF server is using?
on the folder "clients" on server2, does everyone has full access ? right click on the folder and go to properties and check for permission.. click on the special permissions button on the bottom and check if there is something that is stopping it..
cfserver.exe uses local system account..
ASKER
What if the server is not logged on by anyone?
Server2, btw, is running W2K, while Main is running 2K3.
Ok, new development. I went into Services, and changed the account that all Cold Fusion services log in as to Administrator. That allowed the code to run. However, I was logged in as Administrator previously as well. That also did not allow me to connect directly to the spreadsheet as an ODBC datasource, as I could before W2K3.
Server2, btw, is running W2K, while Main is running 2K3.
Ok, new development. I went into Services, and changed the account that all Cold Fusion services log in as to Administrator. That allowed the code to run. However, I was logged in as Administrator previously as well. That also did not allow me to connect directly to the spreadsheet as an ODBC datasource, as I could before W2K3.
u cant connect to excel spreadsheet as ODBC even as an administrator???
ASKER
Once I create a System DSN on MAIN, and then go the CF admin page and try to add a datasource using the System DSN, I get:
Connection verification failed for data source: xlsclients
[]java.sql.SQLException: [Macromedia][SequeLink JDBC Driver][ODBC Socket][Microsoft][ODBC Excel Driver] '(unknown)' is not a valid path. Make sure that the path name is spelled correctly and that you are connected to the server on which the file resides.
The root cause was that: java.sql.SQLException: [Macromedia][SequeLink JDBC Driver][ODBC Socket][Microsoft][ODBC Excel Driver] '(unknown)' is not a valid path. Make sure that the path name is spelled correctly and that you are connected to the server on which the file resides.
All these services, as I mentioned, were assigned to log on as the domain administrator account. They have all been restarted as well.
Connection verification failed for data source: xlsclients
[]java.sql.SQLException: [Macromedia][SequeLink JDBC Driver][ODBC Socket][Microsoft][ODBC Excel Driver] '(unknown)' is not a valid path. Make sure that the path name is spelled correctly and that you are connected to the server on which the file resides.
The root cause was that: java.sql.SQLException: [Macromedia][SequeLink JDBC Driver][ODBC Socket][Microsoft][ODBC Excel Driver] '(unknown)' is not a valid path. Make sure that the path name is spelled correctly and that you are connected to the server on which the file resides.
All these services, as I mentioned, were assigned to log on as the domain administrator account. They have all been restarted as well.
ASKER
It all worked in W2K before I formatted and reinstalled everything on W2K3.
Okay this definately points to a permissions problem.
It should not matter if anyone is logged into the server - that is why it uses a local system account. You need to make sure that the local system account that is used has the appropriate priviladges for those services.
Also for the datasource issue it again is related to the differences in permissions. If you are using IIS as your webserver then you need to know that there are differneces in the permissions that IIS 5 has (win 2000) and IIS 6 has (win 2003).
You need to make sure that the website user has the appropriate permissions. The website user is usually called something like IUSR_
But you want to be careful about what permissions you grant to this user account.
It should not matter if anyone is logged into the server - that is why it uses a local system account. You need to make sure that the local system account that is used has the appropriate priviladges for those services.
Also for the datasource issue it again is related to the differences in permissions. If you are using IIS as your webserver then you need to know that there are differneces in the permissions that IIS 5 has (win 2000) and IIS 6 has (win 2003).
You need to make sure that the website user has the appropriate permissions. The website user is usually called something like IUSR_
But you want to be careful about what permissions you grant to this user account.
try to do this on w2k3 server..
instead of using CF admin, go to Control Panel --> Admin tools --> Data Sources(ODBC).. click ont he System DSN tab on the top and then add the DSN.. then open up the CF admin and see if it appears there.. then click on the Verify button to see if it is ok..
instead of using CF admin, go to Control Panel --> Admin tools --> Data Sources(ODBC).. click ont he System DSN tab on the top and then add the DSN.. then open up the CF admin and see if it appears there.. then click on the Verify button to see if it is ok..
let me know what happens..
ASKER
Ok, so guide me through this, lets go step by step, if possible. Where and what should I check first?
ASKER
btw, I am using AD, and the account I set the CF services log on is the domain administrator account. This is also the account I am logged in with while trying to add System DSN for this spreadsheet.
ASKER
I believe I have done exactly what you have described several times. I have added a System DSN using Data Source(ODBC). I have then opened up CF admin, attempted to add a new datasource of type: ODBC socket. Upon trying to submit the changes, I get the above mentioned error.
Is there another way to verify the existance of an ODBC datasource besides adding a new one and submitting it?
Is there another way to verify the existance of an ODBC datasource besides adding a new one and submitting it?
once u add the system DSN using the "DataSources" under Admin tools, the DSN should automatically listed in the CF admin console.. u dont have to do anything.. is the DSN listed in the CF admin after you add it thru windows?
ASKER
I have not seen what you are talking about. All I am aware of is the Data Sources section on the CF admin web page.
Unlike adonis1976 said, if this is cfmx ( wich it is ) there is no cfserver.exe, cfmx creates a jrun instance, wich if you look in the process list, it displays jrun.exe, wich usually runs on the SYSTEM account.
BTW theamzngq, could you post here the full java stack ?
regards,
idss
BTW theamzngq, could you post here the full java stack ?
regards,
idss
ASKER
Yes, this is CFMX 6.1, sorry if I didn't mention that before. It is running on W2K3.
As far as the error on the file copy, I overcame it by changing the CF services to log on as the domain administrator account. I still cannot connect successfully to the spreadsheet on Server2.
Which java stack were you referring to, fmedia?
As far as the error on the file copy, I overcame it by changing the CF services to log on as the domain administrator account. I still cannot connect successfully to the spreadsheet on Server2.
Which java stack were you referring to, fmedia?
Hi ...
SOURCE : The full path name of the file to copy. [\\main\clients\Clients.xl s]
DESTINATION : The full path name of the directory where the copy of the file will be saved. If you do not specify a file name, you must include the trailing slash. [\\server2\Clients\]
Few check points [assuming u have all the permissions on W2K3] :
1. Check if the CFAdmin allows u to use CFFILE
2. if u can access the \\server2\Clients\Clients. xls from ur local machine - try mapping this folder on the Server1 & then try again.
let me know ...
K'Rgds
Anand
SOURCE : The full path name of the file to copy. [\\main\clients\Clients.xl
DESTINATION : The full path name of the directory where the copy of the file will be saved. If you do not specify a file name, you must include the trailing slash. [\\server2\Clients\]
Few check points [assuming u have all the permissions on W2K3] :
1. Check if the CFAdmin allows u to use CFFILE
2. if u can access the \\server2\Clients\Clients.
let me know ...
K'Rgds
Anand
ASKER
As my post above says:
"adding a slash on the destination gave me an 'invalid destination' error. here is the error with the slash:
Attribute validation error for tag CFFILE.
The value of the attribute destination, which is currently "\\server2\clients\", is invalid.
The error occurred in D:\CFusionMX\wwwroot\Wrigh t_2.0\Clie nts-m2s.cf m: line 1
1 : <cffile action="copy" source="\\main\clients\Cli ents.xls" destination="\\server2\cli ents\" nameconflict="overwrite">"
And again, as another of my posts above says again:
"As far as the error on the file copy, I overcame it by changing the CF services to log on as the domain administrator account."
It works now with the following code:
<cffile action="copy" source="\\main\clients\Cli ents.xls" destination="\\server2\cli ents" nameconflict="overwrite">
"adding a slash on the destination gave me an 'invalid destination' error. here is the error with the slash:
Attribute validation error for tag CFFILE.
The value of the attribute destination, which is currently "\\server2\clients\", is invalid.
The error occurred in D:\CFusionMX\wwwroot\Wrigh
1 : <cffile action="copy" source="\\main\clients\Cli
And again, as another of my posts above says again:
"As far as the error on the file copy, I overcame it by changing the CF services to log on as the domain administrator account."
It works now with the following code:
<cffile action="copy" source="\\main\clients\Cli
ASKER
no one seems to know what is up with this, please refund
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
<cffile action="copy" source="\\main\clients\Cli
Or specifying the filename at the destination since you have nameconflict to overwrite :
<cffile action="copy" source="\\main\clients\Cli