DEV Community

Discussion on: Docker, Django, React: Building Assets and Deploying to Heroku

Collapse
 
hahnsangkim profile image
H. Kim

I narrowed down to the more specific issue. Do you happen to know what key is it expecting? Is it SECRET_KEY? I set it as an environment variable in the heroku setting.

When I push to the heroku git repository, heroku.yml is loaded first, isn't it? I wonder what key is included where...

Hope my question/issue is explanatory...

MacBook-Pro$ git push heroku master
Enumerating objects: 20, done.
Counting objects: 100% (20/20), done.
Delta compression using up to 4 threads
Compressing objects: 100% (11/11), done.
Writing objects: 100% (14/14), 2.27 KiB | 2.27 MiB/s, done.
Total 14 (delta 5), reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote: === Fetching app code
remote: 
remote: =!= Build failed due to an error:
remote: 
remote: =!= validate step: error converting YAML to JSON: yaml: line 3: did not find expected key
remote: 
remote: If this persists, please contact us at https://help.heroku.com/.
remote: Verifying deploy...
remote: 
remote: !   Push rejected to vast-escarpment-xxxx.
remote: 
To https://git.heroku.com/vast-escarpment-xxxx.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/vast-escarpment-xxxx.git'
Collapse
 
englishcraig profile image
Craig Franklin • Edited

Based on the message:
validate step: error converting YAML to JSON: yaml: line 3: did not find expected key
I'm guessing that your heroku.yml file is invalid, and the parser isn't able to work out the necessary key/value pairs. Check the first few lines of heroku.yml to make sure everything has the correct syntax. If you're using the exact same heroku.yml from my repo, then my code might be out of date.

Thread Thread
 
hahnsangkim profile image
H. Kim

Thank you so much for your reply, Graig!
It was about an indent error. Now, I have another issue.
Is it about a space issue on the Dyno? or an installation error? It seems relevant to a kind of generic troubleshoot... but if you could look at it and give me your first thought, it will be helpful. Even if not, it will be OK.

Thank you and I look forward to your feedback.
Best,

remote: After this operation, 30.4 MB of additional disk space will be used.
remote: Do you want to continue? [Y/n] Abort.
remote: The command '/bin/sh -c apt-get -y install curl   && curl -sL https://deb.nodesource.com/setup_8.x | bash   && apt-get install nodejs   && curl -o- -L https://yarnpkg.com/install.sh | bash' returned a non-zero code: 1
remote: 
remote: Verifying deploy...
remote: 
remote: !   Push rejected to vast-escarpment-xxxx.
remote: 
To https://git.heroku.com/vast-escarpment-xxxx.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/vast-escarpment-xxxx.git'
Thread Thread
 
hahnsangkim profile image
H. Kim • Edited

I figured it out. V8 of nodejs has been deprecated. I changed the version in Dockerfile

RUN apt-get -y install curl \
  && curl -sL https://deb.nodesource.com/setup_8.x | bash \
  && apt-get install nodejs \
  && curl -o- -L https://yarnpkg.com/install.sh | bash 

into

RUN apt-get -y install curl \
  && curl -sL https://deb.nodesource.com/setup_12.x | bash \
  && apt-get install nodejs \
  && curl -o- -L https://yarnpkg.com/install.sh | bash

I hope this will help others who may give it a try.

Most of all, thank you for your posting and feedback to my questions, Craig!