Skip to main content
Participant
July 28, 2014
Answered

Issue with accessmanager.cfc

  • July 28, 2014
  • 3 replies
  • 1326 views

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
    This topic has been closed for replies.
    Correct answer blackhat840

    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.

    3 replies

    Participant
    July 29, 2014

    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>

    BKBK
    Community Expert
    Community Expert
    July 29, 2014

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

    BKBK
    Community Expert
    Community Expert
    July 29, 2014

    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&method=getcfcinhtml&na…

    http://127.0.0.1:8500/CFIDE/componentutils/cfcexplorer.cfc?path=/CFIDE/adminapi/datasource.cfc&method=getcfcinhtml&name=…

    This of course assumes that you have enabled RDS.

    Participant
    July 29, 2014

    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.

    Carl Von Stetten
    Legend
    July 28, 2014

    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.