Copy link to clipboard
Copied
I have a REST web service that I have been using on CF 2016 and CF 2021 servers without issue for a long time now. I have just recently upgraded to CF 2021, and I am getting a weird behavior that I can not identify what is happening.
From the sderver, if I open a URL to the REST site, it works just as expected, but if I try from any other machine, I get an error 500. I tried with calling the CFC directly, and same behavior.
Here is the start of the component:
Matthew, first and foremost, let's see what the 500 error is. If indeed cf is generating it, see the coldfusion application.log (and exception.log) to see what it is, and tell us.
If you may find there IS no error, then I'd propose a sanity check. If you go to the command line on the server and your local machine and do a ping of the domain name in your url. Is the reported ip address for them the same? If not identical, do you feel both point to the server in question? You may find the local
...Sorry, this was my fault.
I just could not understand the different behavior between calling the URL locally and from another machine. I was not getting any output in application log or any toher ColdFusion log.
After commenting out every line fo code in the template and slowing walking back until I reached the error I found that it was some weird behavior in another template that was unexpected but I was able to resolve.
Sorry to have wasted your time, thank you for helping regardless.
...Copy link to clipboard
Copied
The first line was supposed to be:
I have a REST web service that I have been using on CF 2016 and CF 2018 servers without issue for a long time now....
I have the code running on 2016 and 2018 servers and are just now trying to get it running on a 2021 server.
Copy link to clipboard
Copied
Matthew, first and foremost, let's see what the 500 error is. If indeed cf is generating it, see the coldfusion application.log (and exception.log) to see what it is, and tell us.
If you may find there IS no error, then I'd propose a sanity check. If you go to the command line on the server and your local machine and do a ping of the domain name in your url. Is the reported ip address for them the same? If not identical, do you feel both point to the server in question? You may find the local machine has a hosts file that points the domain to your own local machine.
If the above proves not to be the case, confirm also that you see the 500 error registered in the iis request log.
Also, would you affirm that the cf2016 and 2018 that "work" are on another machine? I only point this out as it could be that if they ran in this machine, you might experience the problem with them.
And to be clear, no, nothing about the secure profile or developer profiles should affect how the rest feature works, as far as I know.
One other thing, the case of things is above is varying, While IIS should not care, some aspects of CF may. Have you considered making everything lowercase, as another sanity check? Do beware that if you make some changes about the rest configuration, you may need to restart cf for them to take effect.
I realize these thoughts are not necessarily the answer to or confirmation of what you may fear to really be the problem, but it's key to at least make sure we are chasing the right ghost first. 🙂 And I hope my first suggestion may be the key to that.
Copy link to clipboard
Copied
Sorry, this was my fault.
I just could not understand the different behavior between calling the URL locally and from another machine. I was not getting any output in application log or any toher ColdFusion log.
After commenting out every line fo code in the template and slowing walking back until I reached the error I found that it was some weird behavior in another template that was unexpected but I was able to resolve.
Sorry to have wasted your time, thank you for helping regardless.
Matt
Copy link to clipboard
Copied
Thanks, but please do be sure to take note of that first suggestion I'd made. If you'd have looked to the applicaiton.log, you should have been able to very readily see the error (which you ultimately solved via your manual code tweaking).
It is indeed important to remember this for REST request errors, as generally most have no error handling catching and returning errors as json, so they just see a 500 error like you did. As such, the logs are the easiest way to find what's a miss, like you ultimately discovered.