codeforamerica / cityvoice-survey-builder

Deploy an instance of CityVoice to Heroku without ever leaving the comfort of your web browser
https://cityvoice-setup.codeforamerica.org
6 stars 4 forks source link

Audio file saving broken #58

Closed daguar closed 9 years ago

daguar commented 9 years ago

Reported by @jmadans, for some reason the builder is having trouble reading (or possibly writing) audio files to disk prior to loading them into Redis.

Here's what's going on in the logs:

screen shot 2015-04-15 at 7 05 55 pm

The relevant code is here:

    wav_path = params["data"][:tempfile].path
    mp3_path = "/tmp/#{user_token}_audio_#{audio_name}.mp3"
    # Convert wav to mp3
    system("lame -V 2 #{wav_path} #{mp3_path}")
    # Read mp3 as binary and put in Redis
    raw_mp3_binary_data = IO.binread(mp3_path)

It's blowing up on the IO read saying there's no file there.

This is odd — my guess is it's something related to a platform upgrade (ie, how shelling out is working) because otherwise nothing has changed in the code.

@migurski — do you have any thoughts?

daguar commented 9 years ago

I'll investigate a bit further but first step is to see what the lame command's actually doin'. I bet that's the failure point.

daguar commented 9 years ago

So, weirdly this seems to be working now? (I pushed a branch logging out of the shell command, and then it worked — pushed master back up and it works also.)

I'm wondering if it's at all related to the security incident Heroku had today? https://status.heroku.com/incidents/750

@jmadans — let me know if you encounter this problem again.

daguar commented 9 years ago

@jmadans — I've also added you as a collaborator on Heroku, so you can look at logs moving forward.