I added -v to the chown command but I'm not getting any output...perhaps because the script is run over ssh and there's !requiretty in the sudoer? I guess I could try piping the output into a file?
UPDATE: Added 2>&1 | tee /tmp/test.txt to the end of the chown command. Didn't create a file. Is there any other way to debug this?