Hybernate fails

When trying to hybernate, my Dell Xperia XPS always resumes at once. The following journalctl entry’s may give some hints, but I don’t know how to handle it.

Apr 23 22:50:58 localhost.localdomain kernel: PM: hibernation: PM: secret key is invalid
Apr 23 22:50:58 localhost.localdomain kernel: ACPI: EC: interrupt blocked
Apr 23 22:50:58 localhost.localdomain kernel: ACPI: PM: Preparing to enter system sleep state S4
Apr 23 22:50:58 localhost.localdomain kernel: ACPI: EC: event blocked
Apr 23 22:50:58 localhost.localdomain kernel: ACPI: EC: EC stopped
Apr 23 22:50:58 localhost.localdomain kernel: ACPI: PM: Saving platform NVS memory

Apr 23 22:50:58 localhost.localdomain kernel: ACPI: button: The lid device is not compliant to SW_LID.
Apr 23 22:50:58 localhost.localdomain kernel: ACPI: EC: interrupt unblocked
Apr 23 22:50:58 localhost.localdomain kernel: ACPI: EC: event unblocked

Apr 23 22:50:58 localhost.localdomain kernel: PM: Cannot get swap writer

Apr 23 22:50:58 localhost.localdomain systemd-sleep[6133]: Failed to put system to sleep. System resumed again: No space left on device
Apr 23 22:50:58 localhost.localdomain kernel: PM: hibernation: hibernation exit

The No space left on device message irritates me most. There is no partition which is full or nearly full in my system.

That means your swap is to small for hibernation.

How big is it supposed to be? As big as my memory (32G)?

Different sources say that you need for hibernation 1,5x RAM size for swap.

I created a new swapfile (20 GB) and activated it. Hibernate still doesn’t work, but at least I get a bit further. Now the journalctrl says:

Apr 27 11:09:05 localhost.localdomain systemd[1]: systemd-hibernate.service: Main process exited, code=exited, status=1/FAILURE
Apr 27 11:09:05 localhost.localdomain systemd[1]: systemd-hibernate.service: Failed with result 'exit-code'.
Apr 27 11:09:05 localhost.localdomain systemd[1]: Failed to start Hibernate.
Apr 27 11:09:05 localhost.localdomain systemd[1]: Dependency failed for System Hibernation.
Apr 27 11:09:05 localhost.localdomain systemd[1]: hibernate.target: Job hibernate.target/start failed with result 'dependency'.

what failed dependency could that be?

To the op, are you using nvidia graphic card?