A New Beginning, Part 12

Kalen Hammann
3 min readJul 29, 2017

WEEK SIX: WELL, ALMOST…

I spent part of Saturday prettying up a few things to make the app the best it could be before I submitted it to the folks at Firehose, and in the process came across a response to a question I’d asked: Shouldn’t we be able to fix the bug that caused the user’s profile page to break any time someone deleted a “place?” I’d tried to solve it but not been quite able to.

Ken answered that I had been on the right track; he said that they usually told people about this after they had submitted their apps, but encouraged me to follow up a hint he gave me about how to fix the bug using a method called ‘dependent_destroy.’

So I read up on dependent_destroy and put it to work and — Yes! the bug was fixed. I could delete a “place” and my user page kept right on working.

So I took a deep breath and pushed the last code up to Heroku so the app would appear live on the internet. I knew everything was fine, but just to be sure went to the internet site and deleted a “place.”

And everything fell apart.

I don’t mean just my user page stopped working. It was much worse than that…

“RUN THESE COMMANDS OR WE CAN’T HELP YOU!”

Not only did my user page not work, but even when I added back the page I had deleted, I couldn’t upload a picture to the page.

Checking to see if the picture uploader was still working, I found to my dismay that I couldn’t add a new picture to another page either.

Then I noticed to my horror that ALL the pictures were missing from ALL the pages! They were simply GONE. Had “dependent_destroy” somehow destroyed all the pictures in my database? This was far worse than anything I’d ever encountered — and I had no idea at all how to solve it.

I poured out my tale of woe on the Q & A forum and one of the coaches suggested some commands I could run to check out whether I had completed several earlier steps. I was sure I had because the whole app had been working fine on the internet — including showing all the pictures — before my most recent code addition, but I dutifully went ahead and ran the first command — and got an error message that “The Heroku API is temporarily unavailable.”

Back to the forum. I mentioned the error message I had gotten and added some speculations about what I thought might be happening.

The answer came back, “Run the commands.”

I tried. Again the error message: “The Heroku API is temporarily unavailable.”

Then I got a message from Ken: “If you don’t run the commands you were asked to run, we won’t be able to help you.”

Great: I tried again to verify that the Heroku API was still temporarily unavailable. It was. I couldn’t run the commands because Heroku wasn’t accepting commands, and if I couldn’t run the commands, I couldn’t get any help.

GREAT NEWS: MY LOCAL APP IS BROKEN TOO.

I checked the app on my local computer just to make sure IT was still working and discovered that the pictures had disappeared there as well.

You might think that would have been the last straw, but actually I thought it was very good news. It meant that the problems I’d been having on the Heroku site were probably not being caused by the code I had just uploaded there. Something else was affecting both my site on Heroku and my local site — and I thought I knew what it was.

(More to come… click here!)

--

--