Fork me on GitHub
#biff
<
2023-05-10
>
Epidiah Ravachol00:05:42

I'm finally getting around to trying to deploy over on Digital Ocean and I can't quite get that certbot to pass. How vital is that?

Jacob O'Bryant01:05:28

it's pretty important--I'm happy to help debug. As a first step, if you run dig in the terminal (replacing with your domain), does the IP address it gives match the IP address for your droplet?

Epidiah Ravachol01:05:05

Thanks! They do match.

Epidiah Ravachol01:05:28

This is the error message I'm getting when I run certbot:

Certbot failed to authenticate some domains (authenticator: nginx). The Certificate Authority reported these problems:
  Domain: 
  Type:   dns
  Detail: DNS problem: SERVFAIL looking up CAA for  - the domain's nameservers may be malfunctioning

Epidiah Ravachol01:05:34

If that helps at all.

Jacob O'Bryant04:05:39

hmm, well that's something I haven't seen before

Jacob O'Bryant04:05:43

According to https://status.digitalocean.com/, DO was having some issues with DNS resolution today. Maybe just try re-running the certbot command and see if it works now? (`certbot --nginx`, the last command in server-setup.sh)

Jacob O'Bryant04:05:09

That issue was resolved around 24 hours ago, but maybe there was/is some lingering problems...

Epidiah Ravachol11:05:21

Tried it again this morning and same issue. Then I did a little experimenting. Checking the DNS records on the DO site, my site has a Type A and three Type NS, but no Type CAA. I'm way out of my depth here, but I tried creating a CAA with an issuewild tag for my site without the "www" at the beginning and that seems to have pulled it off!

Epidiah Ravachol11:05:36

Ha, okay, onto the next step. I set up the remote on git and run bb deploy. The rebuilding appears to have worked, but the website isn't up yet and bb logs look like this:

May 10 11:43:00 dig-a-thousand-holes systemd[1]: Started app.
May 10 11:43:01 dig-a-thousand-holes sh[709]: ----- Error --------------------------------------------------------------------
May 10 11:43:01 dig-a-thousand-holes sh[709]: Type:     java.lang.Exception
May 10 11:43:01 dig-a-thousand-holes sh[709]: Message:  File does not exist: run-cmd
May 10 11:43:01 dig-a-thousand-holes systemd[1]: app.service: Main process exited, code=exited, status=1/FAILURE
May 10 11:43:01 dig-a-thousand-holes systemd[1]: app.service: Failed with result 'exit-code'.
May 10 11:43:07 dig-a-thousand-holes systemd[1]: app.service: Scheduled restart job, restart counter is at 1.
May 10 11:43:07 dig-a-thousand-holes systemd[1]: Stopped app.
May 10 11:43:07 dig-a-thousand-holes systemd[1]: Started app.
May 10 11:43:07 dig-a-thousand-holes sh[902]: ----- Error --------------------------------------------------------------------
May 10 11:43:07 dig-a-thousand-holes sh[902]: Type:     java.lang.Exception
May 10 11:43:07 dig-a-thousand-holes sh[902]: Message:  File does not exist: run-cmd
May 10 11:43:07 dig-a-thousand-holes systemd[1]: app.service: Main process exited, code=exited, status=1/FAILURE
May 10 11:43:07 dig-a-thousand-holes systemd[1]: app.service: Failed with result 'exit-code'.
May 10 11:43:12 dig-a-thousand-holes systemd[1]: app.service: Scheduled restart job, restart counter is at 2.
May 10 11:43:12 dig-a-thousand-holes systemd[1]: Stopped app.
May 10 11:43:12 dig-a-thousand-holes systemd[1]: Started app.
May 10 11:43:12 dig-a-thousand-holes sh[908]: ----- Error --------------------------------------------------------------------
May 10 11:43:12 dig-a-thousand-holes sh[908]: Type:     java.lang.Exception
May 10 11:43:12 dig-a-thousand-holes sh[908]: Message:  File does not exist: run-cmd
May 10 11:43:12 dig-a-thousand-holes systemd[1]: app.service: Main process exited, code=exited, status=1/FAILURE
May 10 11:43:12 dig-a-thousand-holes systemd[1]: app.service: Failed with result 'exit-code'.
May 10 11:43:17 dig-a-thousand-holes systemd[1]: app.service: Scheduled restart job, restart counter is at 3.
May 10 11:43:17 dig-a-thousand-holes systemd[1]: Stopped app.
May 10 11:43:17 dig-a-thousand-holes systemd[1]: Started app.
May 10 11:43:17 dig-a-thousand-holes sh[914]: ----- Error --------------------------------------------------------------------
May 10 11:43:17 dig-a-thousand-holes sh[914]: Type:     java.lang.Exception
May 10 11:43:17 dig-a-thousand-holes sh[914]: Message:  File does not exist: run-cmd
May 10 11:43:17 dig-a-thousand-holes systemd[1]: app.service: Main process exited, code=exited, status=1/FAILURE
May 10 11:43:17 dig-a-thousand-holes systemd[1]: app.service: Failed with result 'exit-code'.
May 10 11:43:22 dig-a-thousand-holes systemd[1]: app.service: Scheduled restart job, restart counter is at 4.
May 10 11:43:22 dig-a-thousand-holes systemd[1]: Stopped app.
May 10 11:43:22 dig-a-thousand-holes systemd[1]: Started app.
May 10 11:43:22 dig-a-thousand-holes sh[920]: ----- Error --------------------------------------------------------------------
May 10 11:43:22 dig-a-thousand-holes sh[920]: Type:     java.lang.Exception
May 10 11:43:22 dig-a-thousand-holes sh[920]: Message:  File does not exist: run-cmd
May 10 11:43:22 dig-a-thousand-holes systemd[1]: app.service: Main process exited, code=exited, status=1/FAILURE
May 10 11:43:22 dig-a-thousand-holes systemd[1]: app.service: Failed with result 'exit-code'.
May 10 11:43:28 dig-a-thousand-holes systemd[1]: app.service: Scheduled restart job, restart counter is at 5.
May 10 11:43:28 dig-a-thousand-holes systemd[1]: Stopped app.
May 10 11:43:28 dig-a-thousand-holes systemd[1]: Started app.
May 10 11:43:28 dig-a-thousand-holes sh[1019]: ----- Error --------------------------------------------------------------------
May 10 11:43:28 dig-a-thousand-holes sh[1019]: Type:     java.lang.Exception
May 10 11:43:28 dig-a-thousand-holes sh[1019]: Message:  File does not exist: run-cmd
May 10 11:43:28 dig-a-thousand-holes systemd[1]: app.service: Main process exited, code=exited, status=1/FAILURE
May 10 11:43:28 dig-a-thousand-holes systemd[1]: app.service: Failed with result 'exit-code'.
May 10 11:43:33 dig-a-thousand-holes systemd[1]: app.service: Scheduled restart job, restart counter is at 6.
May 10 11:43:33 dig-a-thousand-holes systemd[1]: Stopped app.
May 10 11:43:33 dig-a-thousand-holes systemd[1]: app.service: Start request repeated too quickly.
May 10 11:43:33 dig-a-thousand-holes systemd[1]: app.service: Failed with result 'exit-code'.
May 10 11:43:33 dig-a-thousand-holes systemd[1]: Failed to start app.

Jacob O'Bryant16:05:14

heh glad it worked! I'll keep that in mind in case I ever run into this... what does ls /home/app on the server print?

👍 1
Epidiah Ravachol17:05:38

Looks like that's config.edn repo.git secrets.env target

Jacob O'Bryant17:05:01

👍 looks like the bb deploy command ran partially, since config.edn and secrets.env are there (i.e. the non-git-tracked files got copied to the server), but none of the git-tracked files are there, which is why bb run-cmd (from https://github.com/jacobobryant/biff/blob/master/example/server-setup.sh#L61) fails. What's the console output if you make another commit locally and then run bb deploy again?

Epidiah Ravachol17:05:43

Oh, it says I'm on a branch "yet to be born" which sounds prophetic!

Browserslist: caniuse-lite is outdated. Please run:
  npx update-browserslist-db@latest
  Why you should do it regularly: 

Rebuilding...

Done in 2082ms.
Enumerating objects: 17, done.
Counting objects: 100% (17/17), done.
Delta compression using up to 8 threads
Compressing objects: 100% (9/9), done.
Writing objects: 100% (9/9), 1.45 KiB | 1.45 MiB/s, done.
Total 9 (delta 5), reused 0 (delta 0), pack-reused 0
remote: fatal: You are on a branch yet to be born
remote: ----- Error --------------------------------------------------------------------
remote: Type:     java.lang.Exception
remote: Message:  File does not exist: post-receive
remote: 
To 
   5f63539..92bb78b  main -> main
"Elapsed time: 868.047426 msecs"

Jacob O'Bryant17:05:34

ha, very interesting! This must be the culprit: 5f63539..92bb78b main -> main .The primary branch on the server is still set to master by default, but it looks like your local primary branch is main -- so you need to instruct git to push from main to master. You can do that by editing config.edn and changing the :biff.tasks/deploy-cmd option's value to ["git" "push" "prod" "main:master"]

Jacob O'Bryant17:05:01

Someone else ran into this recently as well. It really should be automated--just made an issue: https://github.com/jacobobryant/biff/issues/155

Jacob O'Bryant17:05:20

(anyway, once you set that option, bb deploy should work)

Epidiah Ravachol17:05:34

I was looking into the whole main vs. master thing. That did the trick! On to the next puzzle! (Postmark doesn't like my gmail address: https://postmarkapp.com/blog/why-cant-i-use-gmail-address So I'm going to see if I can't sort another one out.)

Epidiah Ravachol17:05:57

But the site is up! And I'm psyched about that!

🎉 1
Jacob O'Bryant17:05:37

oh wow I had no idea they didn't allow gmail addresses! If you don't feel like setting up a custom domain for your personal email (it's pretty easy with fastmail, don't know about gmail), you could sign up for https://www.mailgun.com/ instead and then replace the send-postmark fn in email.clj with a send-mailgun fn (see https://github.com/jacobobryant/platypub/blob/master/src/com/platypub/mailgun.clj#L65 and https://github.com/jacobobryant/platypub/blob/master/src/com/platypub/items.clj#L235 and https://github.com/jacobobryant/platypub/blob/master/src/com/platypub/items.clj#L30 for inspiration). Maybe Mailgun should be the default...

Jacob O'Bryant17:05:49

(on the upside, postmark is a high-quality service. Very fast delivery which is especially nice for signin emails, and their UI etc. is a bit nicer to use than Mailgun's)

Epidiah Ravachol18:05:38

I'm setting up an email through GoDaddy (where my domain name has been for roughly 10,000 years) and Microsoft365. We'll see how that process goes. If it works, I'll give Postmark a shot, otherwise I'll try Mailgun.

Epidiah Ravachol19:05:05

Got it up and running and I immediately see all the things I still need to fix, but that's what bb prod-dev is for. This is exhilarating!

🎅 1
Epidiah Ravachol21:05:13

Thank you for both Biff and your tireless help! I'm looking forward to having something fun to share.

🙌 1