"We changed the server name and the scheduled task stopped running"
-
From that, and the following clue, can you guess what happened?
The scheduled task runs a one-line batch file that calls a program, passing, among other things, the host and port where the database server resides.
-
Is it a task running on the database server or running on an app server that talks to the database server?
-
The tasks runs on server A. It connects to a database on server B. Server B's name changed. In OP I forgot to say the batch file passed the host and port for the database server on the command line.
IOW the batch file consists, more or less, of
c:\apps\whatever.exe -db blah -host host -port port
-
I was hoping for a bigger WTF like the task was running on the DB server and using something other than LOCALHOST for the host name.
-
Nah. Although "We changed the server[1] name and the task stopped working" was (the entirety of) the initial email.
In the end, it turns out that when you don't update the batch file to use the new server name, the program hangs, unable to pop a dialog (because it's running as a scheduled task, in batch mode) telling you that it can't connect to the database.
When she changed the batch file and it worked again, she replied, saying she'd done that to the other ones, too. Which was a good idea, since (I think) those were the backup commands.
[1] Notice she didn't specify whether it was the application or database server. The former should have had no bearing no the problem, had that been what was changed, I'll point out for completeness.
-
TRWTF is having to change it in multiple places.
-
TRWTF is having to change it in multiple places.
Three separate jobs.
I suppose you could write a config file or something but that seems a little like overkill.
-
Maybe you can ask the server what its name is instead of assuming?
God is death. Death is lies. Lies is female gamers. Female gamers is trolling.
-
Maybe you can ask the server what its name is instead of assuming?
I'm curious how you would go about programmatically attemping to find a database listening on an arbitrary port on an arbitrary server if you don't already know.
-
If there is no response from the host and port specified on the command line, the script should find the correct address by scanning the local subnet with nmap.
Isn't that standard defensive programming for all database connections?
-
scanning the local subnet with nmap.
And here I was hoping there'd be a less obvious answer.
-
something something zeroconf something bonjour something mdns guid something
-
Something something code review mumble mumble beaten with mumble mumble stupid stick something something ever see you mumble mumble network again something something with a power stapler?
-
Bur maybe I'm just over-reacting.
-
-
Lesson learned, don't change the server name?
Isn't that the point of DNS is you can keep the hostname the same, but change its IP to point to some other place.
Why change the server name?mumble mumbles, uses IP addresses anyway
-
Er, not quite.
Ideally you'd never call another server by name or IP, but you'd setup an A record in DNS. This means you can change servers all you like and you only have to update one thing.
-
Ideally you'd never call another server by name [...] but you'd setup an A record in DNS.
If the A (or AAAA) record in DNS isn't the mapping of the name to an IP address, what is it? (Presuming there's no distinction between 'name' and 'hostname' here...)
-
I'm glad you picked up on that deliberate mistake. In this context A is short for Alias
-
In this context A is short for Alias
You appear to have misspelled
CNAME
then- I can understand; the letters are right next to each other...
-
Why change the server name?
No idea. I'm sure it seemed like a good idea at the time, but she didn't share the reasoning with me.
-
I fail to see how this is any different than if Bob quit and James took his position but everyone still sent email to Bob's email address.
That's... well I don't think it's a WTF. If you change a server's name it's to be expected that you are going to break stuff. The server's name is how you are supposed to access it. It's not supposed to change. The real WTF is that they changed the server name.
[spoiler]Well, it was named after Bob, but then they had to rename it for his successor, James...[/spoiler]
-
The real WTF is that they changed the server name.
Yes, I know. That was, indeed, the WTF. Well, actually it was expecting the script not to need to know the new name.