Skip to content
This repository has been archived by the owner on Nov 14, 2024. It is now read-only.

who updates the update docs #267

Merged
merged 2 commits into from
Mar 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions getting-started/updating.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@ description: Get the skinny on how to easily update Lando, a local development a

# Updating

Updating is fairly simple.
Updating is fairly simple, you run:

1. Shutdown Lando eg `lando poweroff` and kill any running Lando processes.
2. Turn off Docker.
3. Follow the normal installation steps with the new version.
```sh
lando update
```

If you run into any issues after that we recommend you check out this [troubleshooting guide](./../help/updating.md).
If you run into any issues with running it we recommend you check out this [troubleshooting guide](./../help/updating.md).

You can also read more about this command over [here](https://docs.lando.dev/cli/update.html).
95 changes: 53 additions & 42 deletions help/updating.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,27 @@ description: Get some help if you have problems with Lando after updating.

# Updating

While we try to make updating as seamless as possible Lando has _a lot_ of moving parts so sometimes there are edge cases we miss. If you find yourself amongst the lucky edge cases we've prepared this guide to help you work through them on your own.
While we try to make updating as seamless as possible Lando has _a lot_ of moving parts so sometimes there are edge cases we miss.

These are ordered from the lightest touch to the heaviest hand so we recommend you try them out in the order presented.
If you find yourself amongst the lucky edge cases we've prepared this guide to help you work through them on your own.

## 1. Do a `lando rebuild`
## 1. Where is `lando update`?

The vast majority of errors you may run into after updating can be resolved by running a `lando rebuild` on the problematic app. This will ensure your container is clean, up to date and rebuilt against the updated `lando` and `docker` versions.
If you don't have a `lando update` command we recommend you first install/update via the [latest available package installer](https://github.com/lando/lando/releases).

Note that the latest package installer may be a few versions behind where we are today but that's ok because once you have it you can then `lando update`!

## 2. Why did my app stop working?

### `lando rebuild`

The vast majority of app specific errors you may run into after updating can be resolved by running a `lando rebuild` on the problematic app. This will ensure your container is clean, up to date and rebuilt against the updated `lando` and `docker` versions.

```bash
lando rebuild -y
```

## 2. Force remove the proxy
### Force remove the proxy

If you're having trouble with `*.lndo.site` or custom `proxy` urls, and you've already determined you do not have an issue with [DNS Rebinding protection](./dns-rebind.md) then manually force removing the `proxy` container and restarting your app could help.

Expand All @@ -30,59 +38,62 @@ lando restart

Note that if you have other apps running when you force remove the `proxy` you will likely need to `lando restart` them as well.

## 3. Ensure permissions are correct
## 3. Why isn't the CLI updating?

Due to the way permissions are mapped between containers and your host, particularly on Linux, you can sometimes end up with Lando config files being owned by `root`. If this happens you can remediate by recursively resetting `~/.lando` to be owned by you.
When `lando update` was in `beta` there were a few issues we had to resolve that now require some manual remediation. Here are a few of the big ones:

```bash
# Recursively reset ~/.lando to be owned by you
sudo chown -Rv USERNAME ~/.lando
### Manually updating first

# Or with a group if you know it
sudo chown -Rv USERNAME:GROUP ~/.lando
If you are on the `v3.21.0-beta` series then it's probably best to [manually update](#_1-where-is-lando-update) before running `lando update` again.

# Then try a lando restart
lando restart
### Permissions errors

If you are getting errors about files in either `~/.lando/config` or `~/.lando/scripts` we recommend the following:

# Then try a lando rebuild if the restart fails
lando rebuild
```sh
lando poweroff
rm -rf ~/.lando/config ~/.lando/scripts
lando update
```

Note that `sudo` is needed here because some files may be owned by `root`. If you are unsure about your user id or group you can make use of the `id` command.
### CLI reporting wrong version

```bash
# Get information about your user and group
id
If you installed Lando with the older package installer, particularly on Windows, you may have an older version of Lando sitting higher up in `PATH`.

# Or just your username
id -un
You can check to see which `lando` is being invoked with the below:

# Or just your primary group
id -gn
::: code-group
```sh [sh]
which lando
```

## 4. Progressively prune the Lando config directory
```bat [cmd.exe]
where lando
```

More desperate times call for more desperate measures and more desperate measures mean progressively pruning `~/.lando` and then trying to `lando restart` or `lando rebuild`.
```powershell [powershell]
Get-Command lando
```
:::

```bash
# Start by removing the cache
rm -rf ~/.lando/cache
# And then attempting a restart/rebuild
lando restart || lando rebuild

# Remove more and repeat
rm -rf ~/.lando/cache ~/.lando/compose ~/.lando/config ~/.lando/proxy ~/.lando/scripts
# And then attempting a restart/rebuild
lando restart || lando rebuild

# F it, burn it all down!
rm -rf ~/.lando
# And then attempting a restart/rebuild
lando restart || lando rebuild
If the response to the above command is not where you chose to install Lando, which is `~/.lando/bin/lando` by default then you should follow the below steps.

1. Remove the `lando` reported by `which|where|Get-Command` or remove the directory it lives in from `PATH`.
2. Rerun `which|where|Get-Command lando` and if it reports the wrong directory then repeat Step 1.

## 4. Why are some services not working?

You may have accidentally installed the _slim_ version of `lando` which does not include any Lando plugins by default.

You can usually fix this by simply running the hidden command:

```sh
lando setup
```

## 5. Post an issue on GitHub or Slack
You can read more about that command [here](https://docs.lando.dev/cli/setup.html)

## 5. What if I'm still stuck?

If you get this far and things are still not working the most likely scenario is you've found a legitimate bug which you should report. To do that either:

Expand Down
Loading