Copy link to clipboard
Copied
Good afternoon everyone! I'm having some major issues and can't seem to find a solution so possibly someone here can help me. You can see the issue below. The Current user is not authorized to invoke this method. It states something about an E drive but I don't even have an E drive on my linux box?? Help!!
The web site you are accessing has experienced an unexpected error.
Please contact the website administrator.
The following information is meant for the website developer for debugging purposes. | ||||||||||||||||||||||||
Error Occurred While Processing Request | ||||||||||||||||||||||||
|
Alright so I found out the issue lies within setting my driver type when creating a DSN. Right now I have it set at myObj.setMSSQL(driver="mysql5",... but apparently this does not work with the latest coldfusion. And I am not using the CF Administrator because this is tied to a form I use for creating multiple pieces to a home brew content system at once.
Copy link to clipboard
Copied
I think that file path is a bit of a "red herring" - it might refer to the path on the machine used by Adobe to compile the ColdFusion Administrator API code. The issue is more likely that you are trying to use some ColdFusion Administrator API method without first having passed valid credentials into the API. You have to create an object using the adminapi.administrator CFC, then call the login() method of the object passing a valid username and password that has been granted access to the API. Then you can create an adminapi.datasource object and use its methods.
You might need to do something like this:
<!--- Log into ColdFusion Admin API --->
<cfset adminObj = createObject("component"),"cfide.adminapi.administrator")>
<cfif not adminObj.login("**username**","**password**")>
<cfthrow message="invalid admin password">
</cfif>
<!--- Create a datasources object --->
<cfset dsObj = createObject("component","cfide.adminapi.datasource")>
<!--- Get datasources from datasource API --->
<cfset dsFull=dsObj.getDatasources()>
Hope that helps,
-Carl V.
Copy link to clipboard
Copied
I agree with Carl. E:/cf10_final/cfusion/wwwroot/ is just a remnant of the file system that the Coldfusion Team used when building Coldfusion 10. At least that is what I think it is. Such a path keeps popping up in error messages in Coldfusion versions as far back as I can remember. I wonder why they let it stay. It gives a shoddy impression.
In any case, we should focus on discovering the cause of your error. For a start, the error message tells us something is going wrong in the pages named update.cfm. Could we see the code?
One of the paths even has a double forward slash: /var/www/vhosts/website/httpdocs/m//update.cfm. What Is the intention here?
Carl mentions a username/password pair. One way to test its validity, without code, is to access the API through the browser, as follows (modify the URL to your needs):
This of course assumes that you have enabled RDS.
Copy link to clipboard
Copied
Thanks for the suggestion guys. This worked great until some changes in CF10 I believe. BkBk, I can post some code this evening but I think I figured it out. I changed my CF password and didnt update the area it pulls the password from.
Copy link to clipboard
Copied
My issue now is I am getting this error -
<cfscript>
// Login is always required. This example uses two lines of code.
adminObj = createObject("component","cfide.adminapi.administrator");
adminObj.login("#GetServer.CFrootPassword#");
// Instantiate the data source object.
myObj = createObject("component","cfide.adminapi.datasource");
// Create a DSN.
myObj.setMSSQL(driver="mysql",
name="#DatabaseName#",
host = "localhost",
port = "3563",
database = "#DatabaseName#",
username = "#DbUsername#",
password = "#DbPassword#",
login_timeout = "30",
timeout = "20",
interval = 7,
buffer = "64000",
blob_buffer = "64000",
setStringParameterAsUnicode = "false",
description = "#FORM.DefaultDSN#",
pooling = true,
maxpooledstatements = 999,
enableMaxConnections = "false",
maxConnections = "299",
enable_clob = false,
enable_blob = false,
disable = false,
storedProc = true,
alter = true,
grant = true,
select = true,
update = true,
create = true,
delete = true,
drop = true,
revoke = true );
</cfscript>
Copy link to clipboard
Copied
It would of course help to know what you were doing when you got the error.
Copy link to clipboard
Copied
Are you trying to create a datasource with Coldfusion code? If so, why not do it the simple way, in the Coldfusion Administrator?
Copy link to clipboard
Copied
Alright so I found out the issue lies within setting my driver type when creating a DSN. Right now I have it set at myObj.setMSSQL(driver="mysql5",... but apparently this does not work with the latest coldfusion. And I am not using the CF Administrator because this is tied to a form I use for creating multiple pieces to a home brew content system at once.
Copy link to clipboard
Copied
You apparently mix the drivers. Use either
setMSSQL ( driver="MSSQLServer", ...)
or
setMYSQL ( driver="MySQL", ...)
Copy link to clipboard
Copied
@Blackhat840
I don't understand. Could you please give us a clue why you mark the post as 'correct'?