I had this problem on a fresh install of Ubuntu 22.04 today. I'm using LVM.
```
+ sudo ecryptfs-setup-swap
WARNING:
An encrypted swap is required to help ensure that encrypted files are not leaked to disk in an unencrypted format.
HOWEVER, THE SWAP ENCRYPTION CONFIGURATION PRODUCED BY THIS PROGRAM WILL BREAK HIBERNATE/RESUME ON THIS SYSTEM!
NOTE: Your suspend/resume capabilities will not be affected.
Do you want to proceed with encrypting your swap? [y/N]: y
INFO: Setting up swap: [/dev/dm-1]
WARNING: Commented out your unencrypted swap from /etc/fstab
swapon: cannot open /dev/mapper/cryptswap1: No such file or directory
```
I had this problem on a fresh install of Ubuntu 22.04 today. I'm using LVM.
```
+ sudo ecryptfs-setup-swap
WARNING:
An encrypted swap is required to help ensure that encrypted files are not leaked to disk in an unencrypted format.
HOWEVER, THE SWAP ENCRYPTION CONFIGURATION PRODUCED BY THIS PROGRAM WILL BREAK HIBERNATE/RESUME ON THIS SYSTEM!
NOTE: Your suspend/resume capabilities will not be affected.
Do you want to proceed with encrypting your swap? [y/N]: y
INFO: Setting up swap: [/dev/dm-1] cryptswap1: No such file or directory
WARNING: Commented out your unencrypted swap from /etc/fstab
swapon: cannot open /dev/mapper/
```
fstab after:
``` vgubuntu- root / ext4 errors=remount-ro 0 1 vgubuntu- swap_1 none swap sw 0 0 cryptswap1 none swap sw 0 0
/dev/mapper/
# /boot/efi was on /dev/nvme0n1p1 during installation
UUID=DD8B-183F /boot/efi vfat umask=0077 0 1
#/dev/mapper/
/dev/mapper/
```