• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Issue with accessmanager.cfc

Community Beginner ,
Jul 28, 2014 Jul 28, 2014

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

The current user is not authorized to invoke this method.

The error occurred inE:/cf10_final/cfusion/wwwroot/CFIDE/adminapi/accessmanager.cfc: line 48
Called from E:/cf10_final/cfusion/wwwroot/CFIDE/adminapi/datasource.cfc: line 518
Called from /var/www/vhosts/website/httpdocs/m//update.cfm: line 271
Called from /var/www/vhosts/website/httpdocs/m/c/update.cfm: line 233
Called from /var/www/vhosts/website/httpdocs/m/cs/update.cfm: line 134
Called from /var/www/vhosts/website/httpdocs/m/c/update.cfm: line 7
Called from /var/www/vhosts/website/httpdocs/m/c/update.cfm: line 2
Called from /var/www/vhosts/website/httpdocs/m/c/update.cfm: line 1
-1 : Unable to display error's location in a CFML template. 

Resources:
Browser  Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2062.44 Safari/537.36
Remote Address  24.196.195.142
Referrer  http://website/m/c/edit.cfm
Date/Time  28-Jul-14 02:51 PM
Stack Trace
at cfaccessmanager2ecfc974154242$funcCHECKADMINROLES.runFunction(E:/cf10_final/cfusion/wwwroot/CFIDE/adminapi/accessmanager.cfc:48) at cfdatasource2ecfc1679861966$funcSETMSSQL.runFunction(E:/cf10_final/cfusion/wwwroot/CFIDE/adminapi/datasource.cfc:518) at

Views

1.1K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Beginner , Jul 29, 2014 Jul 29, 2014

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.

Votes

Translate

Translate
Guide ,
Jul 28, 2014 Jul 28, 2014

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 29, 2014 Jul 29, 2014

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):

http://127.0.0.1:8500/CFIDE/componentutils/cfcexplorer.cfc?path=/CFIDE/adminapi/accessmanager.cfc&me...

http://127.0.0.1:8500/CFIDE/componentutils/cfcexplorer.cfc?path=/CFIDE/adminapi/datasource.cfc&metho...

This of course assumes that you have enabled RDS.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jul 29, 2014 Jul 29, 2014

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jul 29, 2014 Jul 29, 2014

Copy link to clipboard

Copied

My issue now is I am getting this error -

Element mysql is undefined in a Java object of type class coldfusion.server.ConfigMap.

<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>

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 29, 2014 Jul 29, 2014

Copy link to clipboard

Copied

It would of course help to know what you were doing when you got the error.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 29, 2014 Jul 29, 2014

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?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jul 29, 2014 Jul 29, 2014

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 29, 2014 Jul 29, 2014

Copy link to clipboard

Copied

You apparently mix the drivers. Use either

setMSSQL ( driver="MSSQLServer", ...)

or

setMYSQL ( driver="MySQL", ...)

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 29, 2014 Jul 29, 2014

Copy link to clipboard

Copied

LATEST

@Blackhat840

I don't understand. Could you please give us a clue why you mark the post as 'correct'?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation