Giter Club home page Giter Club logo

learn-heroku's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

learn-heroku's Issues

Heroku App Crashed 503 status=503

Error:

2017-10-03T08:04:59.568303+00:00 heroku[router]: at=error code=H10 
desc="App crashed" method=GET path="/favicon.ico" 
host=github-oauth-demo.herokuapp.com 
request_id=6deb46cc-e65d-4450-8582-dc9f4ce6142d fwd="46.28.161.222" 
dyno= connect= service= status=503 bytes= protocol=https

image

This is happening for: https://github.com/nelsonic/github-oauth-demo
should be an easy fix.

app.json (how to deploy apps that require specific resources/tasks e.g: elm-make before starting server)

see: https://devcenter.heroku.com/articles/app-json-schema
used in: https://github.com/healthlocker/healthlocker/blob/master/app.json
and: https://github.com/dwyl/hapi-socketio-redis-chat-example/blob/master/app.json

We need to write a brief intro to why an app.json file is useful for apps deployed to Heroku.

This work could be tied into helping people deploy the dwyl "chat/time" app to heroku. 🤔

10:12:14.889 [error] Could not find static manifest at "/code/phoenix-chat-example/_build/prod/lib/chat/priv/static/cache_manifest.json". Run "mix phx.digest" after building your static files or remove the configuration from "config/prod.exs".

Trying to debug the deployment fail on localhost getting the following error:

10:12:14.889 [error] Could not find static manifest at "/code/phoenix-chat-example/_build/prod/lib/chat/priv/static/cache_manifest.json". Run "mix phx.digest" after building your static files or remove the configuration from "config/prod.exs".

TLS Error

Hey @nelsonic I've been making my way through the tutorial for setting up an SSL certificate but I keep running into an error with TLS:
screen shot 2017-08-23 at 20 27 57

I've been googling around but can't seem to find anything that's helpful for my use-case.

Did you experience this error at all?

Markdown formatting error

There's one section in the readme where an intended H4 renders with 4 #s in front of it, rather than as a header.

screenshot from 2017-11-22 10-20-21

How to View PostgreSQL Data from Heroku App?

I googled for this question https://www.google.com/search?q=heroku+view+postgres+data
and the first 3 results were:

The StackOverflow thread links to Heroku Data Explorer > renamed "Adminium"

image

image

But sadly, Adminium requires access to ALL environment variables on ALL Apps.

"Read and write access to all of your apps and resources, excluding account information. Includes configuration variables, which may include runtime secrets."

adminium-wants-access-to-everything

If it was limited to just the App I want to view data for, I would be fine with it.
But we have apps that have AWS credentials in Environment Variables, and there's no way I would grant access to those to anyone.

To be clear: I've been using Heroku for 8 years and querying the data using the CLI e.g: heroku pg:psql but that is definitely not "beginner friendly" or accessible to non-technical people (e.g: Product Owner)

I'm going to do a writeup of using PGAdmin to view/query Heroku PostgreSQL Data.

binwrap-install: not found

While trying to deploy a new version of a Elixir/Phoenix and Elm app to heroku, I kept getting this error and failing to deploy:

remote:        > [email protected] install /tmp/build_aed45373ab53117201137c6bfc2c1e04/assets/node_modules/elm
remote:        > binwrap-install
remote:
remote:        sh: 1: binwrap-install: not found
remote:        npm ERR! file sh
remote:        npm ERR! code ELIFECYCLE
remote:        npm ERR! errno ENOENT
remote:        npm ERR! syscall spawn
remote:        npm ERR! [email protected] install: `binwrap-install`
remote:        npm ERR! spawn ENOENT
remote:        npm ERR!
remote:        npm ERR! Failed at the [email protected] install script.
remote:        npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

I don't think it could have been caused by anything I did, as I had recently deployed the same day, and the only changes I had made were adding some csv files to the root directory. I also tried deploying other branches with only minimal changes, and got the same error.

I eventually managed to get around this error, but not in the most optimal way. Deploying the exact same branch that was failing to a brand new heroku instance worked fine, but any subsequent deployments would fail with the same error. This led me to think that the issue must be somewhere on the heroku or npm side.

I changed the version of both npm and node, and turned off the caching. I did this using the config file for the phoenix buildpack we are using (https://github.com/gjaldon/heroku-buildpack-phoenix-static):

phoenix_static_buildpack.config:

assets_path=assets
phoenix_ex=phx
node_version=9.3.0
npm_version=5.2.0
clean_cache=true

I'm not sure currently whether it's the cache or the specific npm version that fixes the error, but after doing this, I have deployed multiple updates with no problems.

Let's Encrypt Certificate Renewal Step-by-Step Guide

We have a detailed ("step-by-step") guide to setting up SSL Certificate on Heroku:
https://github.com/dwyl/learn-heroku/blob/master/SSL-certificate-step-by-step-setup-instructions.md

However the Let's Encrypt Certs only last 3 months.
This is fine for a "Startup" or "Hackathon" project that you just want to get up-and-running ASAP,
but it's lame for a project that has longevity.

So, the time has come to extend our tutorial to include certificate renewal.

Relates to: healthlocker/healthlocker#712

Heroku in production with node.js?

I'm working on a project at the moment where we are deploying to heroku (free tier at the moment for development) and I'm confused by what will be needed in terms of dynos when it comes to deploying the app for production.

How many concurrent users are too many when using a hobby dyno? This app is likely to have a reasonably low amount of regular concurrent users and from a bit of reading I wouldn't need to look into the professional tiers unless I would be looking at more than 100 concurrent users?

How do you decide whether your app will be okay on hobby, or if it needs professional?

I think something around this kind of info would be great to have in this README, so if we manage to collate some answers here I'd be happy to make a PR with them.

Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launch

2017-10-03T09:06:19.988494+00:00 app[web.1]: > node example/github_server.js
2017-10-03T09:06:19.988495+00:00 app[web.1]: 
2017-10-03T09:06:20.131086+00:00 app[web.1]: �[1m�[43m�[30m WARNING: �[22m�[42m�[30m env2 was required to load an .env file: �[46m�[30m /app/.env �[1m�[43m�[30m NOT FOUND! �[22m�[42m�[30m Please see: http://git.io/vG3UZ�[49m�[39m�[22m
2017-10-03T09:06:21.176535+00:00 app[web.1]: Now Visit: http://localhost:20094
2017-10-03T09:07:17.051002+00:00 heroku[web.1]: Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launch
2017-10-03T09:07:17.051002+00:00 heroku[web.1]: Stopping process with SIGKILL
2017-10-03T09:07:17.209186+00:00 heroku[web.1]: Process exited with status 137
2017-10-03T09:07:17.217016+00:00 heroku[web.1]: State changed from starting to crashed

Chore: Migrate Off Heroku? 🙅

Heroku [Salesforce] has decided to be hostile to beginners/hobby devs
and will be deleting accounts + data by the end of November 2022!

heroku-delete-data

This is fairly predictable. Salesforce has record revenue. But the bean-counters need to cut back on costs.
https://investor.salesforce.com/press-releases/press-release-details/2022/Salesforce-Announces-Record-Fourth-Quarter-and-Full-Year-Fiscal-2022-Results/default.aspx
image

Todo

(postgrex) lib/postgrex/utils.ex:67: anonymous fn/1 in Postgrex.Utils.parse_version/1

While attempting to connect to Heroku PostgreSQL we got the following error:

11:27:37.439 [error] GenServer #PID<0.205.0> terminating
** (ArgumentError) argument error
    (postgrex) lib/postgrex/utils.ex:67: anonymous fn/1 in Postgrex.Utils.parse_version/1
    (elixir) lib/enum.ex:1294: Enum."-map/2-lists^map/1-0-"/2
    (elixir) lib/enum.ex:1294: Enum."-map/2-lists^map/1-0-"/2
    (postgrex) lib/postgrex/utils.ex:67: Postgrex.Utils.parse_version/1
    (postgrex) lib/postgrex/protocol.ex:641: Postgrex.Protocol.bootstrap_send/6
    (postgrex) lib/postgrex/protocol.ex:475: Postgrex.Protocol.handshake/2
    (db_connection) lib/db_connection/connection.ex:134: DBConnection.Connection.connect/2
    (connection) lib/connection.ex:622: Connection.enter_connect/5
Last message: nil
** (exit) exited in: :gen_server.call(#PID<0.205.0>, {:checkout, #Reference<0.963189577.137101314.27724>, true, :infinity}, 5000)
    ** (EXIT) an exception was raised:
        ** (ArgumentError) argument error
            (postgrex) lib/postgrex/utils.ex:67: anonymous fn/1 in Postgrex.Utils.parse_version/1
            (elixir) lib/enum.ex:1294: Enum."-map/2-lists^map/1-0-"/2
            (elixir) lib/enum.ex:1294: Enum."-map/2-lists^map/1-0-"/2
            (postgrex) lib/postgrex/utils.ex:67: Postgrex.Utils.parse_version/1
            (postgrex) lib/postgrex/protocol.ex:641: Postgrex.Protocol.bootstrap_send/6
            (postgrex) lib/postgrex/protocol.ex:475: Postgrex.Protocol.handshake/2
            (db_connection) lib/db_connection/connection.ex:134: DBConnection.Connection.connect/2
            (connection) lib/connection.ex:622: Connection.enter_connect/5
    (db_connection) lib/db_connection/poolboy.ex:112: DBConnection.Poolboy.checkout/3
    (db_connection) lib/db_connection.ex:920: DBConnection.checkout/2
    (db_connection) lib/db_connection.ex:742: DBConnection.run/3
    (db_connection) lib/db_connection.ex:1133: DBConnection.run_meter/3
    (db_connection) lib/db_connection.ex:584: DBConnection.prepare_execute/4
    (ecto) lib/ecto/adapters/postgres/connection.ex:86: Ecto.Adapters.Postgres.Connection.execute/4
    (ecto) lib/ecto/adapters/sql.ex:256: Ecto.Adapters.SQL.sql_call/6
    (ecto) lib/ecto/adapters/sql.ex:198: Ecto.Adapters.SQL.query!/5

Found: elixir-ecto/postgrex#370 (comment)

Advanced: Heroku Toolbelt (CLI)

The Heroku Web UI is miles better than most other "Cloud" services. 🎉
We are really grateful that the UI is easy enough for non-technical people to use.
But it has certain limitations (log history not visible unless you have a tab open), effectiveness (clicking around to see things) and no automation of actions.

Todo

Get List of Environment Variables from Heroku

Story

Getting an app running on localhost should be easy for new team members,
(ideally it should be a single command ...) but sadly, currently it's not! 😞
@dwyl we have apps deployed to a variety of infrastructure, see: dwyl/learn-devops
Most of the time we recommend that people start with Heroku because the convenience and much simpler interface far outweighs the cost (and switching away is relatively easy!)

One of the most tedious steps in getting an app running on localhost is getting the Environment Variables. We don't want to share environment variables through insecure means (some people share secrets through Chat message, Google Docs or even email, but none of these means of communication are truly secure ... all store your data somewhere that is not in your direct control so it's possible for keys to leak ...)

We need to a bulletproof way of storing application secrets for our own apps.
See: dwyl/learn-security#43
But for now, using Heroku as the "single source of truth" for Secrets (Environment Variables) is a good starting point for the apps we have deployed on Heroku.

The Manual Way

First visit the "Settings" tab for your Heroku App.
And click on the "Reveal Config Vars" button:
image

Then Run this script in your web browser's developer console:

var keys = document.getElementsByClassName('config-var-key');
var vals = document.getElementsByClassName('config-var-value');
var vars = '';
for (var i = 0; i < keys.length - 1; i++) {
  var index = (i == 0) ? 0 : i * 2; // cause there are two values for every key ... 🙄
  vars = vars + 'export ' + keys[i].value + '=' + vals[index].value + '\n';
}
console.log(vars);

You should see something like this:

export-heroku-config-vars-script-output

Copy the output from the browser console and paste it into your .env file.

export AWS_ACCESS_KEY_ID=AKIA****************
export AWS_S3_BUCKET=bucket-name
export AWS_S3_REGION=eu-west-1
export AWS_SECRET_ACCESS_KEY=****************
export DATABASE_URL=postgres://[email protected]:5432/password
export ENCRYPTION_KEYS='****************='
export GOOGLE_MAPS_API_KEY=****************
export HEROKU_POSTGRESQL=postgres://[email protected]:5432/password
export IMPORT_FILES_DIR=temp
export SECRET_KEY_BASE=****************
export [email protected]
export SES_PORT=25
export SES_SERVER=email-smtp.eu-west-1.amazonaws.com
export SITE_URL=https://www.example.com
export SMTP_PASSWORD=****************
export SMTP_USERNAME=AKIA****************
export URL=your-app.herokuapp.com

Todo: Automate This!

Update version of Elixir + Erlang/OTP in elixir_buildpack.config

At present, the instructions in our Elixir/Phoenix Deployment guide instruct people to use Elixir 1.6
elixir-phoenix-app-deployment.md#5-create-a-elixir_buildpackconfig-file

image

While this version is perfectly fine, it's a couple of years old and should not be used for NEW apps.

I recently used the latest Elixir + Erlang in dwyl/elixir-auth-google-demo > elixir_buildpack.config
Which is working on: https://elixir-auth-google-demo.herokuapp.com
So I am confident that updating the instructions will not cause any beginners to have headaches.

Todo

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.