"Failed to create swap, sorry!"


#1

image

i keep getting this error


(Rafael dos Santos Silva) #2

Are you running the script as root?


#3

yes i am running as root


#4

i am a root user (root username)


(Rafael dos Santos Silva) #5

Is this Ubuntu Server 16.04 LTS ? What is your hosting provider?


(maiki) #6

I am fine with @Falco play 20 questions, but if @pain (pfft!) wants to skip to the end, e can provide as much information about the server, setup, specific command used, and documentation referenced, and we can go from there. :slight_smile:


#7

yes Ubuntu 16.04, and provider my friend bought it from was https://www.time4vps.eu, he had bought it for me to install Discourse for him


(Jay Pfaffman) #8

Not a root user, but the root user. Your username is “root” right?

Or perhaps swap exists already and is not enough. It’s swap configured?


(Eli the Bearded) #9

The giveaway in the screen shot is that dd was able to create a file named “/swapfile”, which being at the root of the filesystem, is an almost certain “root user” activity.

A manual run of swapon -v /swapfile will probably provide clues as to the problem. I’m guessing filesystem, but I don’t know for sure. The manpage for swapon notes that btrfs will block swap files.

@pain: please try these two things and let us know the results:

mount | grep ^/
swapon -v /swapfile

#10

yes username is root, well after a reinstall and server upgrade it worked, but im now facing new errors,


#11

thanks for your help, i had it resolved by doing reinstall. but now im facing new problems


(Eli the Bearded) #12

The docker0 thing is either Docker not installed or Docker not running. The first one is fixed by following the Docker install instructions that are part of the Discourse install. The second is usually fixed with a reboot or some obscure commands you are going to forget as soon as you type them. :smile:


(Matt Palmer) #13

You’re not on a fully-virtualised system. Use a real VM and you’ll be fine.


"The restore failed. Please check the logs."
#14

youre right, its not starting


#15

friend already bought it from time4vps, idk what to do about that


(Matt Palmer) #16

Go back to your friend, tell 'em they screwed up and bought the wrong thing.


#17

i’d love some help with the same issue. Here’s a screenshot:

i’m logged in as root. My server is running CentOS Linux 7.4.1708 with 2GB of RAM.

Here’s what i get when i punch in swapon -v /swapfile:

swapon: /swapfile: found swap signature: version 1, page-size 4, same byte order
swapon: /swapfile: pagesize=4096, swapsize=2147483648, devsize=2147483648
swapon: /swapfile: swapon failed: Operation not permitted

Is Discourse only available (advisable) on a cloud server? Mine is a web server. i want to integrate Discourse with a Wordpress install, so it made sense to me to install it alongside WP on my server. No?

Thanks for your help!


(Matt Palmer) #18

You’re running on a pseudo-virtual machine, which doesn’t permit you to create swap. You might be able to wedge Docker into that arrangement, but I wouldn’t count on it, and you may run into other problems that nobody is going to be able to help you with. I’d recommend finding a provider that will give you a real VPS.


#19

?


#20

(if a “real vps” is gonna cost me more than $55/mo, i don’t know if i can handle it)