dwyl / email

✉️ email dashboard to track deliverability and engagement stats in our App 📈
https://dwylmail.herokuapp.com/
GNU General Public License v2.0
41 stars 2 forks source link

Chore: Migrate Email Dashboard from Heroku to Fly.io #61

Open nelsonic opened 2 years ago

nelsonic commented 2 years ago

Migrate email dashboard from Heroku to Fly.io? https://dwylmail.herokuapp.com/ image

related to: https://github.com/dwyl/learn-heroku/issues/52

Todo

nelsonic commented 1 year ago

$16/month is the lowest we would pay to run this ultra-low volume/overhead App on Heroku: https://www.heroku.com/pricing

image

For that I would prefer to pay Keila who have a much more advanced Email Drafting, Sending & Tracking App https://github.com/dwyl/email/issues/60

nelsonic commented 1 year ago

https://dashboard.heroku.com/apps/dwylmail

dwylmail-heroku-fail

As you can see, Heroku kindly already deleted all our data:

image

So even if we wanted to pay Salesforce $16/month to host this for us ... we'd be starting from scratch. 🤦‍♂️

Going to try and re-boot this ...

image

https://dashboard.heroku.com/apps/dwylmail/resources/new?addonService=heroku-postgresql

image

https://dwylmail.herokuapp.com/

image

Restart all dynos ... ⏳

image

Yah! 🎉

https://dashboard.heroku.com/apps/dwylmail/logs

image

Useless.

nelsonic commented 1 year ago

Just tried to run this on localhost with Elixir 1.14.3 and got hundreds of warnings! 😖

Tried running: mix ecto.reset got:

warning: use Mix.Config is deprecated. Use the Config module instead
  config/config.exs:8

warning: use Mix.Config is deprecated. Use the Config module instead
  config/dev.exs:1

The database for App.Repo has been dropped
The database for App.Repo has been created

10:18:52.527 [info] == Running 20191113100513 App.Repo.Migrations.CreateTags.change/0 forward

10:18:52.529 [info] create table tags

10:18:52.533 [info] == Migrated 20191113100513 in 0.0s

10:18:52.549 [info] == Running 20191113100912 App.Repo.Migrations.CreateStatus.change/0 forward

10:18:52.549 [info] create table status

10:18:52.551 [info] == Migrated 20191113100912 in 0.0s

10:18:52.552 [info] == Running 20191113100920 App.Repo.Migrations.CreatePeople.change/0 forward

10:18:52.552 [info] create table people

10:18:52.556 [info] create index people_status_index

10:18:52.557 [info] create index people_tag_index

10:18:52.558 [info] == Migrated 20191113100920 in 0.0s

10:18:52.560 [info] == Running 20191113114340 App.Repo.Migrations.AddPersonIdToTag.change/0 forward

10:18:52.560 [info] alter table tags

10:18:52.560 [info] == Migrated 20191113114340 in 0.0s

10:18:52.561 [info] == Running 20191113141229 App.Repo.Migrations.AddPersonIdToStatus.change/0 forward

10:18:52.561 [info] alter table status

10:18:52.566 [info] == Migrated 20191113141229 in 0.0s

10:18:52.567 [info] == Running 20191130210036 App.Repo.Migrations.AddPictureLocaleToPeople.change/0 forward

10:18:52.567 [info] alter table people

10:18:52.568 [info] == Migrated 20191130210036 in 0.0s

10:18:52.570 [info] == Running 20200224224024 App.Repo.Migrations.CreateSent.change/0 forward

10:18:52.570 [info] create table sent

10:18:52.574 [info] create index sent_person_id_index

10:18:52.575 [info] create index sent_status_id_index

10:18:52.576 [info] == Migrated 20200224224024 in 0.0s
MacOSX 10.7 or later required for --file-events
[notice] Application app exited: App.Application.start(:normal, []) returned an error: shutdown: failed to start child: AppWeb.Endpoint
    ** (EXIT) shutdown: failed to start child: Phoenix.PubSub.PG2
        ** (EXIT) shutdown: failed to start child: Phoenix.PubSub.PG2Server
            ** (EXIT) an exception was raised:
                ** (UndefinedFunctionError) function :pg2.create/1 is undefined or private
                    (kernel 8.5.3) :pg2.create({:phx, App.PubSub})
                    (phoenix_pubsub 1.1.2) lib/phoenix/pubsub/pg2_server.ex:43: Phoenix.PubSub.PG2Server.init/1
                    (stdlib 4.2) gen_server.erl:851: :gen_server.init_it/2
                    (stdlib 4.2) gen_server.erl:814: :gen_server.init_it/6
                    (stdlib 4.2) proc_lib.erl:240: :proc_lib.init_p_do_apply/3
[notice] Application phoenix_live_view exited: :stopped
[notice] Application hackney exited: :stopped
[notice] Application metrics exited: :stopped
[notice] Application ssl_verify_fun exited: :stopped
[notice] Application certifi exited: :stopped
[notice] Application mimerl exited: :stopped
[notice] Application idna exited: :stopped
[notice] Application unicode_util_compat exited: :stopped
[notice] Application poison exited: :stopped
[notice] Application ex_aws_lambda exited: :stopped
[notice] Application ex_aws exited: :stopped
[notice] Application joken exited: :stopped
[notice] Application jose exited: :stopped
[notice] Application fields exited: :stopped
[notice] Application html_sanitize_ex exited: :stopped
[notice] Application mochiweb exited: :stopped
[notice] Application syntax_tools exited: :stopped
[notice] Application xmerl exited: :stopped
[notice] Application argon2_elixir exited: :stopped
[notice] Application comeonin exited: :stopped
[notice] Application plug_cowboy exited: :stopped
[notice] Application cowboy exited: :stopped
[notice] Application ranch exited: :stopped
[notice] Application cowlib exited: :stopped
[notice] Application jason exited: :stopped
[notice] Application phoenix_live_reload exited: :stopped
[notice] Application file_system exited: :stopped
[notice] Application phoenix_html exited: :stopped
[notice] Application phoenix_ecto exited: :stopped
[notice] Application runtime_tools exited: :stopped
** (Mix) Could not start application app: App.Application.start(:normal, []) returned an error: shutdown: failed to start child: AppWeb.Endpoint
    ** (EXIT) shutdown: failed to start child: Phoenix.PubSub.PG2
        ** (EXIT) shutdown: failed to start child: Phoenix.PubSub.PG2Server
            ** (EXIT) an exception was raised:
                ** (UndefinedFunctionError) function :pg2.create/1 is undefined or private
                    (kernel 8.5.3) :pg2.create({:phx, App.PubSub})
                    (phoenix_pubsub 1.1.2) lib/phoenix/pubsub/pg2_server.ex:43: Phoenix.PubSub.PG2Server.init/1
                    (stdlib 4.2) gen_server.erl:851: :gen_server.init_it/2
                    (stdlib 4.2) gen_server.erl:814: :gen_server.init_it/6
                    (stdlib 4.2) proc_lib.erl:240: :proc_lib.init_p_do_apply/3
nelsonic commented 1 year ago

This is going to require way too much effort to update.

image

Deleted the postgres instance and shut down the dyno. RIP Heroku. 💀

nelsonic commented 1 year ago

I've poured enough time into attempting to revive this project ... ⏳

image

Just going to cut my losses and move on!

nelsonic commented 1 year ago

Even if we wanted to use Heroku ... we would be forced to upgrade the stack in a few months:

image
The Heroku-18 stack is deprecated
This app is using the Heroku-18 stack, which is deprecated. 
From April 30th, 2023, Heroku-18 will be end-of-life 
and no longer receive security updates. 
From May 1st, 2023, builds will be disabled. 
Please upgrade your app to a newer Heroku stack. 
[ Visit here to learn more](https://help.heroku.com/X5OE6BCA/heroku-18-end-of-life-faq)

That would mean updating the email app to use latest Elixir and then all the warnings noted above https://github.com/dwyl/email/issues/61#issuecomment-1426686495 ⬆️ would be a consistent source of pain.

So the only option would be to manually upgrade the App to Phoenix 1.6.X which is already out-of-date. ⏳

nelsonic commented 1 year ago

Just googled for "Send Email Phoenix" (incognito) and the second result is: https://github.com/dwyl/learn-phoenix-framework/blob/master/sending-emails.md

image

#SEOMasterPlan 🤯

Need to update it so we don't waste people's time. ⏳

nelsonic commented 10 months ago

Tried again on localhost just to make sure I wasn't going crazy ...

image

SSL error:

==> ssl_verify_fun
Compiling 7 files (.erl)
src/ssl_verify_fun_cert_helpers.erl:13:14: can't find include lib "public_key/include/public_key.hrl"
%   13| -include_lib("public_key/include/public_key.hrl").
%     |              ^

Similar to: https://github.com/dwyl/elixir-invoke-lambda-example/issues/30 i.e. OTP has made a breaking change that means our older Apps fail.

nelsonic commented 10 months ago

Reading: https://elixirforum.com/t/ubuntu-20-04-compile-ssl-verify-fun-fails/32802 The solution appears to be to install erlang-dev ... but that's on Ubuntu ... Googled: https://www.google.com/search?q=erlang-dev+mac Reading: https://dev.to/zacky1972/perfect-steps-of-installalling-erlang-and-elixir-to-apple-silicon-mac-2021-dec-edition-4iae 👀

nelsonic commented 10 months ago

That was a dead end (way too many steps and not well explained ...) Reading: https://devheroes.io/en/erlang-elixir-macos-m1/

nelsonic commented 10 months ago

There are a lot of steps ... this shouldn't be this complicated!! 😢

nelsonic commented 10 months ago

Following: https://github.com/elixir-lang/elixir/issues/12681#issuecomment-1598312912