Skip to content
This repository has been archived by the owner on Jul 11, 2022. It is now read-only.

Installing certificate error on Fedora (34) #380

Closed
emilbratt opened this issue Jul 21, 2021 · 7 comments
Closed

Installing certificate error on Fedora (34) #380

emilbratt opened this issue Jul 21, 2021 · 7 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@emilbratt
Copy link

Description

In the "trust part" of the nitro init command nitro is unable to install its root certificate in Fedora. After running the command "nitro init" everything works as intended all the way up until the part where it is about to install the root site certificate.

Here is my output from the terminal:

..
...
Checking network…
  ✓ network ready
Checking proxy…
  ✓ proxy ready
Checking databases…
  … checking mysql-8.0-3306.database.nitro   … downloading mysql:8.0 ✓
Checking services…
  … checking dynamodb service ✓
  … checking mailhog service ✓
  … checking redis service ✓
Checking proxy…
  … updating proxy ✓
Updating hosts file (you might be prompted for your password)
[sudo] passord for bob: 
  … getting Nitro’s root site certificate ✓
Installing certificate (you might be prompted for your password)
Error: unable to find the distribution from the description: Description:	Fedora release 34 (Thirty Four)

Steps to reproduce

Run either of the below commands on Fedora 34
$ nitro init
$ nitro trust

Additional info

@emilbratt emilbratt added the bug Something isn't working label Jul 21, 2021
@jasonmccallister
Copy link
Contributor

@emilbratt that logic is stored here. We default the finding lsb_release which is most likely not available on Fedora (I hopped back to PopOS so I cannot check).

Does your installation have a cat /etc/issue or /etc/fedora-release? If only there was a standard way to check on each distro :)

Either way, we need to improve support for detecting a distribution.

@jasonmccallister jasonmccallister self-assigned this Jul 21, 2021
@emilbratt
Copy link
Author

emilbratt commented Jul 21, 2021

@jasonmccallister

We default the finding lsb_release which is most likely not available on Fedora (I hopped back to PopOS so I cannot check).

That is correct. Fedora does not have /etc/lsb_release. Might be able to use this file instead /etc/os-release
https://www.freedesktop.org/software/systemd/man/os-release.html

[bob@fedora]$ cat /etc/os-release 
NAME=Fedora
VERSION="34 (Workstation Edition)"
ID=fedora
VERSION_ID=34
VERSION_CODENAME=""
PLATFORM_ID="platform:f34"
PRETTY_NAME="Fedora 34 (Workstation Edition)"
...
...

Does your installation have a cat /etc/issue or /etc/fedora-release?

Yes, I have both files. This is the output:

[bob@fedora]$ cat /etc/issue
\S
Kernel \r on an \m (\l)

[bob@fedora]$ cat /etc/fedora-release
Fedora release 34 (Thirty Four)

If only there was a standard way to check on each distro :)

Unfortunately I do not have any experience in the Go language.
However, I tend to do it this way when writing BASH scripts:
..cat out all file-names that contains the word "release" in /etc
cat /etc/*-release
..pipe it into a grep to search for "NAME"
grep -w "NAME"
..pipe into a cut where we strip the "NAME" part of the match
cut -c 6-

The complete command:

[bob@fedora]$ cat /etc/*-release | grep -w "NAME" | cut -c 6-
Fedora

Or in BASH script

distro=$(cat /etc/*-release | grep -w "NAME" | cut -c 6-)

@jasonmccallister jasonmccallister added this to the 3.0 milestone Aug 15, 2021
@jasonmccallister
Copy link
Contributor

I'm also going to add Zorin OS to the list of supported distro's (which is just Ubuntu underneath).

@emilbratt
Copy link
Author

I'm also going to add Zorin OS to the list of supported distro's (which is just Ubuntu underneath).

That is great to hear!
May I also recommend adding Pop!_OS if possible? I have noticed some growing popularity of the distro. It s also Ubuntu underneath. :)

@jasonmccallister jasonmccallister modified the milestones: 3.0, 2.0.9 Feb 15, 2022
@jasonmccallister
Copy link
Contributor

@emilbratt we just released 2.0.9 with improved support for Fedora, can you give it a try when you are free?

@emilbratt
Copy link
Author

emilbratt commented Apr 5, 2022

@jasonmccallister
Sorry for the late feedback as I missed your notification
I tested this on Fedora just now.

Testing New Version 2.0.9 on Fedora 35

After downloading tarball for x86_64 and verifying with sha256sum, i ran:

$ nitro init

..
...
Checking network…
  ✓ network ready
Checking proxy…
  ✓ proxy ready
Checking databases…
  … checking mysql-8.0-3306.database.nitro   … downloading mysql:8.0 ✓
  … checking postgres-13-5432.database.nitro   … downloading postgres:13 ✓
Checking services…
  … checking dynamodb ✓
  … checking mailhog ✓
  … checking redis ✓
Checking proxy…
  … updating proxy ✓
Updating hosts file (you might be prompted for your password)
[sudo] passord for bob: 
Error: exit status 1

..this time the updating hosts part failed with exit 1

I also tried modifying the hosts with the dedicated command

sudo nitro hosts --hostnames myhostname

Adding sites to hosts file…
  … modifying hosts file ✓

..which worked as intended

I downloaded v. 2.0.8 because host-edit during init worked with previous version
To make sure verything was "clean" I removed v. 2.0.9 and all containers

nitro destroy

Then running the 2.0.8 executable:

nitro init

To my surprise the host-edit during nitro init did not work on 2.0.8 either.
The exact same output as above with the latest v. 2.0.9
May be related to Fedora 35 since this did not happen on Fedora 34

The trust-part

Since the trust part comes after the host-edit part, I manually tested
this as well because the trust part was the original issue

nitro trust

[bob@fedora35 ~]$ nitro trust
  … getting Nitro’s root site certificate ✓
Installing certificate (you might be prompted for your password)
Nitro certificates are now trusted 🔒

..and this seemed to be resolved

Summary

@jasonmccallister
Copy link
Contributor

Hi, we are closing this issue as we have decided to retire Nitro, so no additional work will occur on this project. You can read the official blog post here https://craftcms.com/blog/retiring-craft-nitro. We appreciate everyones feedback and involvement and we look forward to refocusing our efforts on Cloud!

If you're looking for a new local development environment, we recommend DDEV and have a knowledge base article to help you with the transition: https://craftcms.com/knowledge-base/migrating-from-craft-nitro-to-ddev.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants