# When a storage login stops working

An item of a [VFS](VFS.md) that points at another system works only as long as the login in it does. A partner changes a password, a key runs out, a token is revoked: from then on the folder is empty or gives errors, and usually the user notices before you do.

The alert **VFS Bad Credentials** tells you first.

## What happens without it

When a user logs in, the server connects to the storage of their items as they are needed. If the login to one fails,

- that folder cannot be listed or used, and the user's program shows an error or an empty folder;
- the user's other folders work as before;
- the server log has the error of the other system, with the address shown without its password.

## The alert

Make an alert of the type **VFS Bad Credentials** in [Alerts](Prefs-Alerts.md). It runs when the server cannot connect to the storage of a user's item with the login the item has.

The mail of the alert can use:

| Variable | Holds |
|---|---|
| `{url}` | the address of the storage, without the password |
| `{url_path}` | the folder on the storage |
| `{path}` | the folder as the user sees it |
| `{protocol}`, `{port}` | the protocol and port of the storage |
| `{error_message}` | what went wrong, in the words of the other system |
| `{username}` | the user who ran into it |

One alert is sent per item and session, not one per try: a user who clicks ten times into the dead folder causes one mail.

Nothing is sent while you press **Test** on an item: a failed test is shown to you directly.

## Putting it right

1. Read `{error_message}`. A wrong password, a locked account and an expired key look different.
2. Open the item in [the VFS editor](Users-Setup-VFS-Editor.md), or the [connection profile](Connection-Profiles.md) it uses, and correct the login.
3. Press **Test**.
4. The user logs in again.

## Fewer of them

- Keep each outside login in one [connection profile](Connection-Profiles.md). A changed password is then corrected once, for every user.
- Prefer keys and tokens that do not expire with a person's password: an SSH key for SFTP, an application's own sign-in for cloud storage.
- Take passwords from a key vault, where they are changed for all systems at once: see [Special types](VFS-Special-Types.md#keyvault).
- For logins that depend on the user's own password, with `{username}` and `{password}` in the address, expect an alert whenever the two systems' passwords drift apart.
