what goes is wrong with my heroku deploy? - laravel

I have a problem with my deploy. I build a app Localy with Laravel & vueJs this is a Pwa.
So now I have end that everything works fine. My db mysql got 5 migrate, and seeders.
So now I want to deploy to heroku, I do it exactly like that: https://devcenter.heroku.com/articles/getting-started-with-laravel
But I got the famous 500 internal errors so I try to join my db with config var. I do heroku run php migrate working fine the seeding is good no error.
I just can you drop that :
2020-04-23T08:01:00.908862+00:00 heroku[router]: at=info method=GET path="/" host=quiet-dusk-57631.herokuapp.com request_id=59ac99b0-1dbf-4b38-a2bf-641b8ef8ce33 fwd="92.137.142.110" dyno=web.1 connect=1ms service=16ms status=500 bytes=1782 protocol=https`
2020-04-23T08:01:00.902965+00:00 app[web.1]: 10.32.231.221 - - [23/Apr/2020:08:01:00 +0000] "GET / HTTP/1.1" 500 1558 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) snap Chromium/81.0.4044.92 Chrome/81.0.4044.92 Safari/537.36
But 500 internal errors is ir :( I try something like that :
Add "postinstall"
"npm run prod" in script (package.json)
run production
npm install ....
Everything I found maybe worked, but nothing work.
If someone can help me :( I don't drop log or code because I don't know what is not going good and except the 500 server error on my app I got no error all is solved before.
EDIT :
So now the title and logo load on page top. But I got this error:
Mixed Content: The page at 'https://guarded-caverns-46403.herokuapp.com/' was loaded over HTTPS, but requested an insecure script 'http://guarded-caverns-46403.herokuapp.com/js/app.js'. This request has been blocked; the content must be served over HTTPS.

In web.php i just add 'URL::forceScheme('https');' at the end.
And all works good

Related

sonarqube backstage integration is failing

I am currently exploring backstage integration with our own sonarqube instance.
Followed instructions from:
https://github.com/backstage/backstage/tree/master/plugins/sonarqube
and
https://github.com/backstage/backstage/tree/master/plugins/sonarqube-backend
my config file is updated with:
proxy:
'/sonarqube':
target: https://sonarqube.gcp.xyz.com/api
allowedMethods: ['GET']
auth: <<token from sonarqube>>
sonarQube:
baseUrl: https://sonarqube.gcp.xyz.com
apikey: <<token from sonarqube>>
i am testing app in local using yarn dev command and i see no errors for sonarqube.
[1] 2022-11-16T03:53:35.856Z proxy info [HPM] Proxy created: /sonarqube -> https://sonarqube.gcp.cna.com/api type=plugin
[1] 2022-11-16T03:53:35.857Z proxy info [HPM] Proxy rewrite rule created: "^/api/proxy/sonarqube/?" ~> "/" type=plugin
some where in the log i see following statement.
[1] 2022-11-16T03:54:14.347Z backstage info 127.0.0.1 - - [16/Nov/2022:03:54:14 +0000] "GET /api/sonarqube/instanceUrl?instanceKey= HTTP/1.1" 404 - "http://localhost:3000/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/106.0.0.0 Safari/537.36 Edg/106.0.1370.52" type=incomingRequest
Issue:
I don't see the sonar api working. I see following error. The key mentioned is present in the sonarqube baseUrl instance.
No information to display
There is no SonarQube project with key 'jupiter-camunda'.
please help be debug this issue. Logs are not helpful in finding what is wrong. is it poiting to the baseurl i provided or going to sonarqube.org ?
How to get this working.
Initially I tried with just sonarqube plugin, got same result. So tried adding sonarbackend and no success either.
I had a similar issue the documentation isn't great and you only really need to follow the steps in the backend, first, you need to fix your app-config.yaml file.
Remove the proxy definition it doesn't actually need it.
Correct the case on sonarqube to fully lowercase as per below (match the backend docs)
sonarqube:
baseUrl: https://sonarqube.gcp.xyz.com
apikey: <<token from sonarqube>>
Double check you have correctly installed the backend as per https://github.com/backstage/backstage/tree/master/plugins/sonarqube-backend

Heroku H15 errors with Elixir/Phoenix Channels

Once I started using Channels with Phoenix, I started getting a lot of these errors on Heroku:
heroku[router]: at=error code=H15 desc="Idle connection" method=GET
path="/socket/websocket?guardian_token=eyJhbGciOiJIUz[...]&vsn=1.0.0" host=[...]
dyno=web.1 connect=0ms service=87803ms status=503 bytes=
A reliable way to reproduce this is on a laptop:
Open a Phoenix page that connects to WebSockets
Close the lid of your laptop
Wait a minute or so (WiFi to disconnect/OS goes to sleep)
The H15 error will occur.
I've set a 45s timeout on my UserChannel already; I'm running Elixir 1.4.2, Phoenix 1.2.1 and my phoenix.js was just upgraded to the one used in Phoenix 1.3.0-rc0 (link to rev)
I can see the error logged on the front-end, but after that it reconnects happily to the backend:
2017-03-04 23:28:55.351 receive: ok user:2 phx_reply (3)
2017-03-04 23:29:24.269 channel: error user:2
2017-03-04 23:29:28.713 push: user:2 phx_join (4)
2017-03-04 23:29:28.745 receive: ok user:2 phx_reply (4)
Any help or ideas how to solve this is much appreciated.
Edit: I'm familiar with Heroku's H15 error code definition so I'm looking for a fix or a workaround for getting rid of the errors (other than migrating away from Heroku, of course).
Phoenix docs recommend setting the timeout for the websocket transport to < 55 seconds:
defmodule HelloWeb.UserSocket do
use Phoenix.Socket
...
## Transports
transport :websocket, Phoenix.Transports.WebSocket,
timeout: 45_000
...
end
Their explanation is:
This ensures that any idle connections are closed by Phoenix before they reach Heroku’s 55-second timeout window.

How to read log/production.log from heroku if I run on puma web server

I am running a puma web server on heroku and wants to get the .log file to check why a record is being rollbacked. I tried using heroku run bash and tried searching for config in puma.rb, but I still don't know how..
Any suggestions?
edit: I don't want heroku logs -t as it is just showing the logs from puma output. I need the output which when you tail -f log/development.log will show, more detail.
The reason I need it is because I am having a record that rollbacks and I don't know why. It only happens in production not in development, so I have to find out why.
2015-07-28T11:01:26.688980+00:00 app[web.1]: Processing by Users::RegistrationsController#create as HTML
2015-07-28T11:01:26.689027+00:00 app[web.1]: Parameters: {"utf8"=>"✓", "authenticity_token"=>"ocrYdS3Ysj8dM7A32k7ssBFndoRAJSpM+qlK5Sm2t3ROWm3pSEgAO1htfbSsc/j5FUUXZmRu0RuCp2g2tqfmPw==", "user"=>{"email"=>"ml#llmmllmm.com", "password"=>"[FILTERED]"}, "commit"=>"註冊"}
2015-07-28T11:01:26.812795+00:00 app[web.1]: Identity Load (1.9ms) SELECT "identities".* FROM "identities" WHERE "identities"."email" = $1 ORDER BY "identities"."id" ASC LIMIT 1 [["email", "ml#llmmllmm.com"]]
2015-07-28T11:01:26.825136+00:00 app[web.1]: User Exists (2.3ms) SELECT 1 AS one FROM "users" WHERE "users"."referral_code" IS NULL LIMIT 1
2015-07-28T11:01:27.443614+00:00 heroku[router]: at=info method=POST path="/signup" host=new.carshare.hk request_id=c19ac7d2-7805-4c0e-b972-532264656737 fwd="220.241.70.37" dyno=web.1 connect=1ms service=766ms status=200 bytes=15584
2015-07-28T11:01:27.391858+00:00 app[web.1]: FormUser Exists (13.0ms) SELECT 1 AS one FROM "users" WHERE "users"."email" = 'ml#llmmllmm.com' LIMIT 1
2015-07-28T11:01:27.423934+00:00 app[web.1]: Rendered svgs/_carshare_typeface_blue.html (0.6ms)
2015-07-28T11:01:27.426946+00:00 app[web.1]: Rendered shared/_flash.html.slim (0.1ms)
2015-07-28T11:01:27.398227+00:00 app[web.1]: (1.9ms) ROLLBACK
You can tail Heroku logs: heroku logs -t -a app-name
https://devcenter.heroku.com/articles/logging
Also you can try out some addons on Heroku which will provide you with a in-browser view of your logs and allow some filtering on top of it - https://addons.heroku.com/?q=log

Running War file with Jetty Runner in Heroku

If someone could give me some help on heroku I would appreciate.
If I run this command on my local console, it works on -> localhost:8080
java -jar tools/jetty-runner-7.6.3.jar --port 8080 target/scala-2.9.1/myapp.war
So then I create the Procfile with this:
web: java -jar tools/jetty-runner-7.6.3.jar --port 8080 target/scala-2.9.1/myapp.war
Then I test by running:
foreman start
and it also works in -> localhost:8080
But after I deployed the app and make heroku open, it does not work...
[success] Total time: 1 s, completed Jun 22, 2012 11:16:59 AM
-----> Discovering process types
Procfile declares types -> web
-----> Compiled slug size is 70.0MB
-----> Launching... done, v5
http://myapp.herokuapp.com deployed to Heroku
To git#heroku.com:myapp.git
XXXXX..XXXXX master -> master
$heroku logs
2012-06-22T11:14:54+00:00 heroku[slugc]: Slug compilation started
2012-06-22T11:17:57+00:00 heroku[api]: Release v5 created by my_email#my_email.com
2012-06-22T11:17:57+00:00 heroku[api]: Deploy dcdd123 by my_email#my_email.com
2012-06-22T11:18:00+00:00 heroku[slugc]: Slug compilation finished
2012-06-22T11:18:21+00:00 heroku[router]: Error H14 (No web processes running) -> GET myapp.herokuapp.com/ dyno= queue= wait= service= status=503 bytes=
2012-06-22T11:18:30+00:00 heroku[router]: Error H14 (No web processes running) -> GET myapp.herokuapp.com/ dyno= queue= wait= service= status=503 bytes=
Any ideas, suggestions? Thanks,
Regards,
Andre
Andre - We have a Heroku Labs feature that allows you to deploy WAR files directly to Heroku. Check out https://gist.github.com/a8c62301591a11b4c6e9 for exact details on how to go about doing it.
If you are using jetty runner to run your war you do not need to hard code the port number.
Heroku sets the port internally.
So your Procfile should be like:
java -jar tools/jetty-runner-7.6.3.jar --port $PORT target/scala-2.9.1/myapp.war

omniauth and google with sinatra on heroku

I'm trying to use OmniAuth in a sinatra app with google as the login provider. Using the twitter and facebook providers work fine:
require 'omniauth'
require 'openid'
require 'openid/store/filesystem'
use OmniAuth::Builder do
use OmniAuth::Strategies::OpenID, OpenID::Store::Filesystem.new('./tmp'), :name => 'google', :identifier => 'https://www.google.com/accounts/o8/id'
end
get '/sign_in'
redirect '/auth/google'
end
Thoughts? When the browser tries to get '/auth/google', it gets a 503 - Service Unavailable. There is nothing in the heroku logs
Thoughts or suggestions on what this might be?
I just started a bounty on this question - what I'm hoping for is a sample implementation that works on heroku.
I increased the log level on heroku. Here is what I'm getting now:
2011-07-07T16:15:09+00:00 heroku[nginx]: GET /sign_in/?p=google HTTP/1.1 | 207.224.213.179 | 269 | http | 302
2011-07-07T16:15:09+00:00 app[web.1]: I, [2011-07-07T09:15:09.863397 #1] INFO -- OpenID: Error attempting to use stored discovery information: OpenID::TypeURIMismatch
2011-07-07T16:15:09+00:00 app[web.1]: I, [2011-07-07T09:15:09.863480 #1] INFO -- OpenID: Attempting discovery to verify endpoint
2011-07-07T16:15:09+00:00 app[web.1]: I, [2011-07-07T09:15:09.863512 #1] INFO -- OpenID: Performing discovery on https://www.google.com/accounts/o8/id?id=AItOawlAKE9QAQb9mMRyYCCmAkEYIcqfmhrA080
2011-07-07T16:15:09+00:00 app[web.1]: I, [2011-07-07T09:15:09.865033 #1] INFO -- OpenID: WARNING: making https request to https://www.google.com/accounts/o8/id?id=AItOawlAKE9QAQb9mMRyYCCmAkEYIcqfmhrA080 without verifying server certificate; no CA path was specified.
2011-07-07T16:15:09+00:00 app[web.1]: 207.224.213.179 - - [07/Jul/2011 09:15:09] "POST /auth/google/callback HTTP/1.1" 302 - 0.0956
2011-07-07T16:15:09+00:00 heroku[router]: GET myurl.com/auth/google/callback dyno=web.1 queue=0 wait=0ms service=100ms status=302 bytes=0
The page at https://github.com/intridea/omniauth/wiki/OpenID-and-Google-Apps gives two possible solutions:
On Heroku you can change the path to "./tmp" or use Memcached.
It seems like you already tried the Memcached solution - do you have a Memcached instance running and properly setup on Heroku?
You could use google's openid to sign in.
use OmniAuth::Builder do
provider :openid, OpenID::Store::Filesystem.new('/tmp')
use OmniAuth::Strategies::OpenID, OpenID::Store::Filesystem.new('/tmp'), :name => 'google', :identifier => 'https://www.google.com/accounts/o8/id'
end

Resources