Why does the server can't find my build.js file? - vue.js

I am trying to deploy Vue + Flask application to Heroku
On the server side the command npm run build is run and the dist folder appears containing index.html & build.js inside.
In the index.html I have <script src="/dist/build.js"></script>
But when I try to open my app all I get is blank empty page.
In the logs I see:
2020-06-29T17:04:23.211646+00:00 heroku[router]: at=info method=GET path="/dist/build.js" host=myapp.herokuapp.com request_id=some-request-id fwd="some-ip" dyno=web.1 connect=1ms service=10ms status=404 bytes=400 protocol=https
Why can't the server find the build.js inside the dist, even though I can see that it is there?

Related

Issue with deploying a VueJS app on heroku without backend

I've been trying to deploy a basic VueJS app to Heroku without any backend. I've introduced the additional code provided here:
https://github.com/marketplace/actions/heroku-review-app-deployment-status?fbclid=IwAR1c9UtTbDLC3sFyyd0CXWk4XvkN9mUVXEqbh7VjHpnXA2uW9XUa91W1uFY
To my YML file for automation, so it's like this :
name: CI
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
build:
runs-on: ubuntu-latest
- uses: actions/checkout#v3
- name: Heroku Review App Deployment Status
uses: teamniteo/reviewapps-deploy-status#v1.4.0
Is there anything I'm missing because, after linking my heroku created app to the app on my githib repo, I have the application error page
here's my logs:
2022-07-11T17:09:26.062281+00:00 app[web.1]: npm ERR!
2022-07-11T17:09:26.062296+00:00 app[web.1]: npm ERR! To see a list of scripts, run:
2022-07-11T17:09:26.062391+00:00 app[web.1]: npm ERR! npm run
2022-07-11T17:09:26.064160+00:00 app[web.1]:
2022-07-11T17:09:26.064320+00:00 app[web.1]: npm ERR! A complete log of this run can be
found in:
2022-07-11T17:09:26.064361+00:00 app[web.1]: npm ERR! /app/.npm/_logs/2022-07-
11T17_09_26_012Z-debug-0.log
2022-07-11T17:09:26.200951+00:00 heroku[web.1]: Process exited with status 1
2022-07-11T17:09:27.385385+00:00 heroku[web.1]: State changed from starting to crashed
2022-07-11T17:09:44.444515+00:00 heroku[router]: at=error code=H10 desc="App crashed"
method=GET path="/" host=my-portfolio-salim.herokuapp.com request_id=996e2ca5-4565-4340-
b2e3-81e1d46b35e4 fwd="154.243.68.33" dyno= connect= service= status=503 bytes=
protocol=https
2022-07-11T17:09:45.669090+00:00 heroku[router]: at=error code=H10 desc="App crashed"
method=GET path="/favicon.ico" host=my-portfolio-salim.herokuapp.com
request_id=7ab2a333-4346-4067-99cf-0f633aa76bdb fwd="154.243.68.33" dyno= connect=
service= status=503 bytes= protocol=https
It seems you are missing a start script in your package.json file, which is the script used by Heroku to launch your application.

Ruby on Rails app working on c9.io, crashing on Heroku

My Ruby on Rails app works fine in development on cloud9. When I push to Heroku, the application crashes immediately. 'heroku logs' shows:
2015-03-15T17:11:11.909831+00:00 heroku[web.1]: State changed from crashed to starting
2015-03-15T17:11:16.291267+00:00 heroku[web.1]: Starting process with command `bin/rails server -p 42991 -e production`
2015-03-15T17:11:20.262015+00:00 app[web.1]: => Booting Puma
2015-03-15T17:11:20.262090+00:00 app[web.1]: => Rails 4.2.0 application starting in production on http://0.0.0.0:42991
2015-03-15T17:11:20.264853+00:00 app[web.1]: Abort testing: Your Rails environment is running in production mode!
2015-03-15T17:11:20.264972+00:00 app[web.1]: Exiting
2015-03-15T17:11:20.262130+00:00 app[web.1]: => Run `rails server -h` for more startup options
2015-03-15T17:11:20.262170+00:00 app[web.1]: => Ctrl-C to shutdown server
2015-03-15T17:11:21.206693+00:00 heroku[web.1]: State changed from starting to crashed
2015-03-15T17:11:21.193413+00:00 heroku[web.1]: Process exited with status 1
2015-03-15T17:11:22.003251+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=agile-plateau-9101.herokuapp.com request_id=2889a78c-9ccf-4583-ac2b-978683cab62e fwd="149.151.180.124" dyno= connect= service= status=503 bytes=
2015-03-15T17:11:22.536224+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=agile-plateau-9101.herokuapp.com request_id=355eeb91-1fb6-410c-a169-3407d7c2af67 fwd="149.151.180.124" dyno= connect= service= status=503 bytes=
I've tried using unicorn and puma, both with the .rb files Heroku provides, with no luck. I can't even get a console to run on Heroku. 'heroku run rails console' in the IDE shows 'Running rails console attached to terminal... up, run.9870' then brings me back to the IDE console, rather than Heroku's. The Heroku logs for the console command are:
2015-03-15T17:16:48.811613+00:00 heroku[api]: Starting process with command `rails console` by msandford#gmail.com
2015-03-15T17:16:54.386969+00:00 heroku[run.9870]: Awaiting client
2015-03-15T17:16:54.550213+00:00 heroku[run.9870]: Starting process with command `rails console`
2015-03-15T17:16:54.772282+00:00 heroku[run.9870]: State changed from starting to up
2015-03-15T17:17:01.220393+00:00 heroku[run.9870]: State changed from up to complete
2015-03-15T17:17:01.207230+00:00 heroku[run.9870]: Process exited with status 1
Any suggestions on where to begin troubleshooting this?
Edit: I've set up an Ubuntu server on EC2, and I'm getting exactly the same thing when running in development and in production. I'm using pg for both. rails s -e development runs fine, rails s -e production crashes immediately, and nothing is logged (that I can find)
I've resolved the issue: I had to comment out "require 'rails/test_help'" in environment.rd then everything ran along nicely.

FFMPEG compiling on heroku

I have a Rails app running in heroku.
I wanna watermark an original AUDIO-file with another AUDIO-file through a merging/mixing (amerge or amix) filter. Also fades and looping should work.
FFMPEG must be compiled for this feature to run on heroku.
My steps I got from this GIST which uses Vuclan
https://gist.github.com/liufengyun/5055354
Locally I use the following term to convert with Carrierwave which is an uploader:
"-i Original.aiff -i public/watermark/#{ENV['WATERMARK_FILENAME']}.aiff -loop 1 -filter_complex '[1]afade=t=in:ss=0:d=1[4];[4]afade=t=out:st=#{self.evaluate_length-2}:d=2[5];[5][0]amix=duration=shortest[out]' -map [out]"
This works with the ffmpeg built in on my mac.
My compiled version for heroku does contain amerge, amix and the libavformat library.
This is the log which I got from heroku when I go to my upload form and uplaod a file:
(all this works, but only locally).
Started POST "/sounds" for 84.113.97.32 at 2013-07-15 21:14:33 +0000
2013-07-15T21:14:33.175631+00:00 app[web.1]: Running transcoding...
2013-07-15T21:14:33.175631+00:00 app[web.1]: ffmpeg -y -i /tmp/sounds/1373922873-2-5714/watermark_loop-95.aiff -i public/watermark/1khz.aiff -loop 1 -filter_complex '[1]afade=t=in:ss=0:d=1[4];[4]afade=t=out:st=-2.0:d=2[5];[5][0]amix=duration=shortest[out]' -map [out] /tmp/sounds/1373922873-2-5714/watermark_loop-95.aiff
2013-07-15T21:14:33.175631+00:00 app[web.1]:
2013-07-15T21:14:33.241221+00:00 app[web.1]: Failed encoding...
2013-07-15T21:14:33.241221+00:00 app[web.1]: ffmpeg -y -i /tmp/sounds/1373922873-2-5714/watermark_loop-95.aiff -i public/watermark/1khz.aiff -loop 1 -filter_complex '[1]afade=t=in:ss=0:d=1[4];[4]afade=t=out:st=-2.0:d=2[5];[5][0]amix=duration=shortest[out]' -map [out] /tmp/sounds/1373922873-2-5714/watermark_loop-95.aiff
2013-07-15T21:14:33.241221+00:00 app[web.1]:
2013-07-15T21:14:33.241221+00:00 app[web.1]: ffmpeg: error while loading shared libraries: libavformat.so.54: cannot open shared object file: No such file or directory
2013-07-15T21:14:33.241221+00:00 app[web.1]:
2013-07-15T21:14:33.241221+00:00 app[web.1]: Errors: encoded file is invalid.
2013-07-15T21:14:33.241221+00:00 app[web.1]:
2013-07-15T21:14:33.277487+00:00 app[web.1]:
2013-07-15T21:14:33.277487+00:00 app[web.1]: FFMPEG::Error (Failed encoding.Errors: encoded file is invalid. Full output: ffmpeg: error while loading shared libraries: libavformat.so.54: cannot open shared object file: No such file or directory
2013-07-15T21:14:33.277487+00:00 app[web.1]: ):
2013-07-15T21:14:33.277487+00:00 app[web.1]: app/uploaders/sound_uploader.rb:39:in `watermarking'
2013-07-15T21:14:33.277487+00:00 app[web.1]:
It's my 6th attempt to compile, get ffmpeg running correctly and watermarking my sounds on heroku.
Please help me out of this neverending story.
I have forgotten to add all subpaths to the LD_LIBRARY_PATH
So I changed my heroku variable from
LD_LIBRARY_PATH: vendor/ffmpeg/lib:/usr/local/lib
to
LD_LIBRARY_PATH: vendor/x264/lib:vendor/mp3lame/lib:vendor/ffmpeg/lib:/usr/local/lib
via
heroku config:set LD_LIBRARY_PATH=vendor/x264/lib:vendor/mp3lame/lib:vendor/ffmpeg/lib:/usr/local/lib
I have made a gist with detailed compiling instructions for FFMPEG on HEROKU
https://gist.github.com/klangfeld/6009744

Heroku Error H10 (App crashed) - Install Redmine 2.1

Although read many articles about this problem, I still couldn't solve those error,
Here is a part of the heroku logs, if it's less-information, I would update others code of the red mine source code.
2012-11-05T14:02:54+00:00 app[web.1]: Plugins in vendor/plugins (/app/vendor/plugins) are no longer allowed. Please, put your Redmine plugins in the `plugins` directory at the root of your Redmine directory (/app/plugins)
2012-11-05T14:02:54+00:00 app[web.1]: => Booting WEBrick
2012-11-05T14:02:54+00:00 app[web.1]: => Rails 3.2.8 application starting in production on http://0.0.0.0:40115
2012-11-05T14:02:54+00:00 app[web.1]: => Call with -d to detach
2012-11-05T14:02:54+00:00 app[web.1]: => Ctrl-C to shutdown server
2012-11-05T14:02:54+00:00 app[web.1]: Exiting
2012-11-05T14:02:55+00:00 heroku[web.1]: Process exited with status 1
2012-11-05T14:02:55+00:00 heroku[web.1]: State changed from starting to crashed
2012-11-05T14:02:56+00:00 heroku[router]: Error H10 (App crashed) -> GET ceciits.herokuapp.com/ dyno= queue= wait= service= status=503 bytes=
2012-11-05T14:06:04+00:00 heroku[web.1]: State changed from crashed to down
2012-11-05T14:06:04+00:00 heroku[web.1]: Unidling
2012-11-05T14:06:04+00:00 heroku[web.1]: State changed from down to starting
2012-11-05T14:06:07+00:00 heroku[web.1]: Starting process with command `bundle exec rails server -p 3103`
2012-11-05T14:06:12+00:00 app[web.1]: Plugins in vendor/plugins (/app/vendor/plugins) are no longer allowed. Please, put your Redmine plugins in the `plugins` directory at the root of your Redmine directory (/app/plugins)
2012-11-05T14:06:12+00:00 app[web.1]: => Booting WEBrick
2012-11-05T14:06:12+00:00 app[web.1]: => Rails 3.2.8 application starting in production on http://0.0.0.0:3103
2012-11-05T14:06:12+00:00 app[web.1]: => Call with -d to detach
2012-11-05T14:06:12+00:00 app[web.1]: => Ctrl -C to shutdown server
2012-11-05T14:06:12+00:00 app[web.1]: Exiting
2012-11-05T14:06:13+00:00 heroku[web.1]: Process exited with status 1
2012-11-05T14:06:13+00:00 heroku[web.1]: State changed from starting to crashed
I can't figure where is the reason that leads app crashed actually,
Thanks for answering...
Just out of curiosity, did you happen to generate your secret key?
Try running:
heroku run rake generate_secret_token
Not sure if it will help, but I know I've had an issue with this before.

Cannot deploy rails 3.0/datamapper on heroku cedar

I'm trying to deploy an new rails 3.0/datamapper application on heroku cedar.
Despite I can run the console and do successful "app.get ''", every request gives the following error in the logs with no backtrace:
2011-06-12T11:31:04+00:00 heroku[router]: Error H10 (App crashed) -> GET empty-samurai-701.herokuapp.com/ dyno= queue= wait= service= bytes=
A weird thing I noticed that can be related or not to my problem is that I needed to run
heroku run script/rails console
instead of
heroku run console
It was simply because I didn't add the rails gem into my Gemfile.