Closed mpeterson2 closed 10 years ago
Correct it doesn't work.
On Fri, Nov 22, 2013 at 2:07 PM, Michael Peterson notifications@github.comwrote:
It looks like the stuff that starts mpd is commented out in server.go(line 30 to 51). Although, when I tried uncommenting it, I got a bunch of errors and it just exits. Here's the output:
command-line-arguments
./server.go:42: non-declaration statement outside function body ./server.go:46: non-declaration statement outside function body ./server.go:48: non-declaration statement outside function body ./server.go:51: non-declaration statement outside function body ./server.go:52: non-declaration statement outside function body ./server.go:55: non-declaration statement outside function body ./server.go:56: non-declaration statement outside function body ./server.go:60: non-declaration statement outside function body ./server.go:69: non-declaration statement outside function body ./server.go:71: non-declaration statement outside function body ./server.go:71: too many errors
— Reply to this email directly or view it on GitHubhttps://github.com/dkuntz2/turbo-wookie/issues/9 .
That is a truth fact...
At present, only Adam has been able to get it to work. I spent 40 minutes on it last night and didn't really get anywhere.
Best I can tell, we probably need to say mpd --no-daemon path/to/mpd.conf
, but I had problems with that too.
A second problem I had was that because we thread the MPD startup, and I wanted it to grab stuff from the yaml file, the command to actually start MPD doesn't occur until until well after the server's MPD check.
I pulled and tried it as well and it didn't work. I'm out of business tonight, but I'll commit something that should actually work tomorow On Nov 22, 2013 5:27 PM, "Don Kuntz" notifications@github.com wrote:
That is a truth fact...
At present, only Adam has been able to get it to work. I spent 40 minutes on it last night and didn't really get anywhere.
Best I can tell, we probably need to say mpd --no-daemon path/to/mpd.conf, but I had problems with that too.
A second problem I had was that because we thread the MPD startup, and I wanted it to grab stuff from the yaml file, the command to actually start MPD doesn't occur until until well after the server's MPD check.
— Reply to this email directly or view it on GitHubhttps://github.com/dkuntz2/turbo-wookie/issues/9#issuecomment-29117655 .
Something that would be nice, but would either require us writing our own YAML parser right now, would be to turn a yaml file into a map[string]string
. The problem with that is that a value might not be a string, but a list...
Which is pretty much what go-gypsy (our yaml parse) does right now, so far as I can tell. Actually, I'm not entirely sure they store it in memory (which just seems like a poor decision to me)...
I'd be happier if they had an interface more like Go's built in maps...
I still can't get this to work correctly. I'm getting an output that looks like this:
2013/12/03 17:03:40 Starting MPD
2013/12/03 17:03:40 /home/michael/Code/turbo-wookie//backend/mpd/mpd.conf
panic: invalid argument to Intn
goroutine 1 [running]:
math/rand.(*Rand).Intn(0xc2000911f0, 0x0, 0x529e634c)
/usr/lib/go/src/pkg/math/rand/rand.go:83 +0x63
math/rand.Intn(0x0, 0x31c33471)
/usr/lib/go/src/pkg/math/rand/rand.go:143 +0x32
_/home/michael/Code/turbo-wookie/backend/turbo-wookie.random(0x0, 0x0, 0x0)
/home/michael/Code/turbo-wookie/backend/turbo-wookie/turbo-wookie.go:27 +0x55
_/home/michael/Code/turbo-wookie/backend/turbo-wookie.TWMPDClient.Startup(0xc200091930, 0x9, 0xc200000210, 0x4, 0xc2000ac940, ...)
/home/michael/Code/turbo-wookie/backend/turbo-wookie/TWMPDClient.go:85 +0x39c
_/home/michael/Code/turbo-wookie/backend/turbo-wookie.NewTWHandler(0x6ae850, 0xb, 0x5dca00, 0x431bee, 0x5dca00, ...)
/home/michael/Code/turbo-wookie/backend/turbo-wookie/TWHandler.go:33 +0x12c
main.main()
/home/michael/Code/turbo-wookie/backend/server.go:9 +0x32
goroutine 2 [syscall]:
goroutine 4 [syscall]:
syscall.Syscall6()
/usr/lib/go/src/pkg/syscall/asm_linux_amd64.s:41 +0x5
syscall.wait4(0x2ca1, 0xc200000358, 0x0, 0xc2000c4120, 0x100000001, ...)
/usr/lib/go/src/pkg/syscall/zerrors_linux_amd64.go:1640 +0x7b
syscall.Wait4(0x2ca1, 0x7fd26171ecfc, 0x0, 0xc2000c4120, 0x2, ...)
/usr/lib/go/src/pkg/syscall/syscall_linux.go:222 +0x6c
os.(*Process).wait(0xc2000c1f80, 0x7fd26171ed80, 0x0, 0x0)
/usr/lib/go/src/pkg/os/exec_unix.go:22 +0xea
os.(*Process).Wait(0xc2000c1f80, 0x2, 0x491288, 0x6feea8)
/usr/lib/go/src/pkg/os/doc.go:43 +0x25
os/exec.(*Cmd).Wait(0xc2000c9000, 0x0, 0x0)
/usr/lib/go/src/pkg/os/exec/exec.go:310 +0x197
os/exec.(*Cmd).Run(0xc2000c9000, 0x3, 0x7fd26171ef58)
/usr/lib/go/src/pkg/os/exec/exec.go:232 +0x52
_/home/michael/Code/turbo-wookie/backend/turbo-wookie.startMPD(0xc200091930, 0x9, 0xc200000210, 0x4, 0xc2000ac940, ...)
/home/michael/Code/turbo-wookie/backend/turbo-wookie/TWMPDClient.go:46 +0x340
created by _/home/michael/Code/turbo-wookie/backend/turbo-wookie.NewTWMPDClient
/home/michael/Code/turbo-wookie/backend/turbo-wookie/TWMPDClient.go:30 +0x259
exit status 2
Am I missing something or does this still not work?
If it doesn't work, can we start a branch for this instead of pushing it to main so that we can continue to edit stuff?
It looks like that error has to do with the mpd_arguments
part possibly. What are we supposed to put there exactly?
This might be working now?
I shut mpd down than ran the server, it failed giving me this message:
2013/12/03 17:20:29 Starting MPD
2013/12/03 17:20:29 /home/michael/Code/turbo-wookie//backend/mpd/mpd.conf
2013/12/03 17:20:29 Error running the TWMPDClient startup...
MPD isn't running.
Couldn't connect to localhost:6600
dial tcp 127.0.0.1:6600: connection refused
exit status 1
I ran the server right afterwords and it worked fine, but it "failed" to start mpd because it was already open from the previous run:
2013/12/03 17:20:33 Starting MPD
2013/12/03 17:20:33 /home/michael/Code/turbo-wookie//backend/mpd/mpd.conf
2013/12/03 17:20:33 Staring MPDWatcher for localhost:6600
2013/12/03 17:20:33 Starting server on :9000
2013/12/03 17:20:33 Error running MPD command
It should be working 'mo better now. I don't know about our Windows friends, but I got it working for me (I needed to add the --no-daemon
argument, but we could potentially use our mpd_arguments
config field for that (minus the --
part.. But we can figure something out). Hopefully it still works with the --no-daemon
part on Windows).
If you care about the technical stuff, I put in some comments.
Also, make sure to run killall mpd
before running the server to make sure you don't have any spare MPD instances running around. That will cause problems for us.
How do you do this --no-daemon
part? Is it part of go or part of the config file? Or not a thing yet?
It's not yet part of the config, it's just some magic string in the command execution right now (TWMPDClient.go:57
).
Can you run it, does it work?
I put it on line 42: mpdCommand := c.config["mpd_command --no-daemon"]
and on line 43: mpdArgs := c.config["turbo_wookie_directory"] + "/" + c.config["mpd_subdirectory"] + "/" + "mpd.conf" + " --no-daemon"
And no it didn't work, it just gave me the connection refused error that I had posted above.
That's just going to give you errors... Because there isn't a config key called "mpd_command --no-daemon"
...
It was already where it needed to be. Why are you messing with it?
Because I had already said that it didn't work, then you told me that you needed to no daemon thing, so I figured that it wasn't in the code already.
That also didn't give me errors, it just did the same thing as before..
mpdCommand would have been set to nil
, meaning all you'd have been told was that MPD didn't start...
also, does it work now?
No. Before I pulled it still did what it did before. It started, but it wouldn't connect.
Now it doesn't run at all...
Here's the output:
# _/home/michael/Code/turbo-wookie/backend/turbo-wookie
turbo-wookie/TWHandler.go:240: undefined: h
turbo-wookie/TWMPDClient.go:4: imported and not used: "github.com/ascherkus/go-id3/src/id3"
turbo-wookie/TWMPDClient.go:7: imported and not used: "io"
It should work now. I made a tweak and didn't check to see if it still worked...
Yessir you fixed it.
mpd does indeed start itself now too. This can be closed.
Does it kill itself too?
Yes it does.
HUZZAH! Now to get one of our windows friends to see if it works for them.
You type a comment and hit "Reopen & Comment" instead of just "Comment".
HEY: Windows Friends (aka @Neoender, @vanadasd) can you confirm that MPD auto starts with the server now?
Sorry was on a round. And yes it works. If it hadn't I would have said so when the issue closed.
On Wed, Dec 4, 2013 at 12:09 AM, Michael Peterson notifications@github.comwrote:
Uh huh. Too much work.
— Reply to this email directly or view it on GitHubhttps://github.com/dkuntz2/turbo-wookie/issues/9#issuecomment-29782034 .
What happened to all of our comments?
Also closed again.
Tested and confirmed working in Windows! =)
On Wed, Dec 4, 2013 at 12:16 AM, Michael Peterson notifications@github.comwrote:
What happened to all of our comments?
Also closed again.
— Reply to this email directly or view it on GitHubhttps://github.com/dkuntz2/turbo-wookie/issues/9#issuecomment-29782284 .
:smile_cat:
The comments were cluttering everything and distracting from the main message.
Also, YAY!
It looks like the stuff that starts mpd is commented out in
server.go
(line 30 to 51). Although, when I tried uncommenting it, I got a bunch of errors and it just exits. Here's the output: