Copy link to clipboard
Copied
Getting this error, not sure where to begin troubleshooting. I'm trying to fix a website for a friend but I am a bit lost on where to start. Hoping one of you could shed some light on what exactly this error means.
Copy link to clipboard
Copied
GetSetup is being defined somewhere. Find where it's being defined, and that should get you started on where the issue lies.
HTH,
^ _ ^
Copy link to clipboard
Copied
Thanks for the response! So I was able to lookup the GETSETUP file and it looks like the error has to do with the "dbuser" variable required to access the SQL database.
I checked the application scope and the username and password matches what I have set to access the SQL database. Any thoughts?
Copy link to clipboard
Copied
Well, the first thing I have to say is apparently from the code you've posted, you're using CF 6. (Line 9 of the last screencap in your post.) If this is the case, I cannot urge strongly enough that you should be running, at minimum, CF10, just for security reasons alone. Using a pathname of "ezcart", I can assume that this is for some kind of online purchasing. If this is the case, YOU WANT THAT SECURITY.
That said.. if the application.cfm (later versions of CF it is preferred to use application.CFC) is setting the dbuser and dbpass in the request scope, but the page you are loading/calling says they don't exist in the request scope, the first question I would ask is: is the page producing the error located within the webroot (ie, in the same folder or a sub-folder where the application.cfm is located)? Or is it located higher up in the directory hierarchy, outside of webroot?
V/r,
^ _ ^
UPDATE: Okay, I should have read the code a bit better.. according to that, you could be running any version of MX. If you are not running at minimum CF10, you want to.. NEED to.. upgrade to at least 10 or 11.
Copy link to clipboard
Copied
dwhit217, this could be a tough one to resolve via the forums alone. What you're getting is not some typical CF error. Rather, it's a logic error, ad as WolfShade was getting at, it's just telling you that the getsetup variable (a complex variable, like a struct, query, or CFC) doesn't have within it the "server" variable that your code wants to use.
You shared with us what you called "the getsetup file". That may or may not have something to do with this error. Despite its name, it creates variables of different names than you have mentioned (at least in the chunk of code you showed).
You also showed your application.cfm file, and that may be more useful to investigate. As you may know, before any page runs, that one runs. (And no, you can't run that directly, which is why you saw the error telling you that when you tried to run it alone.) Perhaps again there is more to that code than you show, and somewhere in THERE it creates the getsetup variable.
Another challenge is that you can't look at just that or the file in question to see if they refer to getsetup, because either of them may point to code in yet another file, whether via a cfinclude, a custom tag call (cfmodule or calling another file via cf_filename), or as a CFC. And any of those may then call code from yet another file.
There could also be error handling code that we don't see, which may have an influence on what runs, when, and what variables are or are not created (if an error happens).
This is why I say this could be challenging to resolve in the forums. But we're not out of ideas/options for you to consider.
For one thing: have you simply tried restarting CF to see if the problem went away? It could. Sometimes what happens is that the code that creates such variables only runs from its first execution, and if there are errors then (even just temporary), it may fail in a way that (if not well-written) could leave you no choice but to restart CF to "try again" to get past that error (if indeed it is a temporary one).
Then again, we can see in that the getsetup.cfm that someone DID seemingly account for such a situation, because there is code testing whether something called resetstoresetup exists. We can't tell for sure from that code alone, but it looks like its intended to be passed in as a querystring, such that you could call any page in the site and append that, and the app would "reset". So for instance, if the site were bob.com, you could call bob.com?getsetup.cfm?resetstoresetup. (Do beware that with something like that, it also means that potentially ANYONE could call that URL, if they knew of it, and could therefore reset you app on a whim. Some folks extend such code to also require some additional value, perhaps which varies, but that's beyond the scope of this thread.)
So take these ideas and chew on them. Hope they may help.
If this is a business where money is being lost for the failure, and if you don't want to wait for back and forth on ideas here (which could take days, especially over the holidays), you may do better to hire someone to help. While it's possible any developer could solve this (and may be less expensive), there are also consultants (myself included) who do such server troubleshooting for a living. And indeed, this problem may well have some server troubleshooting component (such as if somehow the DB IS in fact having trouble, in which case no amount of app or CF restarting will help.)
I list such troubleshooting CF consultants in a category of my CF411.com list of tools and resources of interest to CFers, specifically cf411.com/cftrouble. (I will say that I suspect this would not take more than an hour, and we could do this remotely--without you needing to give me remote access to the server, but instead via shared desktop like gotomeeting/webex, where I watch as YOU remote into the server--and I offer a satisfaction guarantee, so you won't pay for time you don't find valuable.)
Whether you want to tough it out in back and forths with us here, or go through such remote consulting, I hope you get to a solution soon.
/charlie