Project

General

Profile

Actions

Bug #48788

closed

cephadm bootstrap: monmaptool --create: error writing to '/tmp/monmap': (21) Is a directory

Added by Michael Tucker over 3 years ago. Updated about 3 years ago.

Status:
Duplicate
Priority:
Normal
Assignee:
-
Category:
-
Target version:
-
% Done:

0%

Source:
Tags:
Backport:
Regression:
No
Severity:
2 - major
Reviewed:
Affected Versions:
ceph-qa-suite:
Pull request ID:
Crash signature (v1):
Crash signature (v2):

Description

I am on a fresh Ubuntu 20.04 LTS install and unable to use cephadm bootstrap to install ceph.

This is related to [[https://tracker.ceph.com/issues/45279]] which is now resolved.

root@docker02:/home/spider# MYIP=`ip route get 1.1.1.1 | grep -oP 'src \K\S+'`
root@docker02:/home/spider# ./cephadm bootstrap --mon-ip $MYIP
Verifying podman|docker is present...
Verifying lvm2 is present...
Verifying time synchronization is in place...
Unit systemd-timesyncd.service is enabled and running
Repeating the final host check...
podman|docker (/snap/bin/docker) is present
systemctl is present
lvcreate is present
Unit systemd-timesyncd.service is enabled and running
Host looks OK
Cluster fsid: 189d2110-510d-11eb-9137-7147df6a1932
Verifying IP 10.0.0.12 port 3300 ...
Verifying IP 10.0.0.12 port 6789 ...
Mon IP 10.0.0.12 is in CIDR network 10.0.0.0/24
Pulling container image docker.io/ceph/ceph:v15...
Extracting ceph user uid/gid from container image...
Creating initial keys...
Creating initial monmap...
Non-zero exit code 1 from /snap/bin/docker run --rm --ipc=host --net=host --entrypoint /usr/bin/monmaptool -e CONTAINER_IMAGE=docker.io/ceph/ceph:v15 -e NODE_NAME=docker02 -v /tmp/ceph-tmp4izlix6a:/tmp/monmap:z docker.io/ceph/ceph:v15 --create --clobber --fsid 189d2110-510d-11eb-9137-7147df6a1932 --addv docker02 [v2:10.0.0.12:3300,v1:10.0.0.12:6789] /tmp/monmap
/usr/bin/monmaptool:stdout /usr/bin/monmaptool: monmap file /tmp/monmap
/usr/bin/monmaptool:stdout /usr/bin/monmaptool: set fsid to 189d2110-510d-11eb-9137-7147df6a1932
/usr/bin/monmaptool:stdout /usr/bin/monmaptool: writing epoch 0 to /tmp/monmap (1 monitors)
/usr/bin/monmaptool:stderr bufferlist::write_file(/tmp/monmap): failed to open file: (21) Is a directory
/usr/bin/monmaptool:stderr monmaptool: error writing to '/tmp/monmap': (21) Is a directory
Traceback (most recent call last):
  File "./cephadm", line 6111, in <module>
    r = args.func()
  File "./cephadm", line 1399, in _default_image
    return func()
  File "./cephadm", line 2935, in command_bootstrap
    out = CephContainer(
  File "./cephadm", line 2654, in run
    out, _, _ = call_throws(
  File "./cephadm", line 1060, in call_throws
    raise RuntimeError('Failed command: %s' % ' '.join(command))
RuntimeError: Failed command: /snap/bin/docker run --rm --ipc=host --net=host --entrypoint /usr/bin/monmaptool -e CONTAINER_IMAGE=docker.io/ceph/ceph:v15 -e NODE_NAME=docker02 -v /tmp/ceph-tmp4izlix6a:/tmp/monmap:z docker.io/ceph/ceph:v15 --create --clobber --fsid 189d2110-510d-11eb-9137-7147df6a1932 --addv docker02 [v2:10.0.0.12:3300,v1:10.0.0.12:6789] /tmp/monmap
root@docker02:/home/spider# /snap/bin/docker run --rm --ipc=host --net=host --entrypoint /usr/bin/monmaptool -e CONTAINER_IMAGE=docker.io/ceph/ceph:v15 -e NODE_NAME=docker02 -v /tmp/ceph-tmp4izlix6a:/tmp/monmap:z docker.io/ceph/ceph:v15 --create --clobber --fsid 189d2110-510d-11eb-9137-7147df6a1932 --addv docker02 [v2:10.0.0.12:3300,v1:10.0.0.12:6789] /tmp/monmap
bufferlist::write_file(/tmp/monmap): failed to open file: (21) Is a directory
monmaptool: error writing to '/tmp/monmap': (21) Is a directory
/usr/bin/monmaptool: monmap file /tmp/monmap
/usr/bin/monmaptool: set fsid to 189d2110-510d-11eb-9137-7147df6a1932
/usr/bin/monmaptool: writing epoch 0 to /tmp/monmap (1 monitors)

Related issues 1 (0 open1 closed)

Related to Orchestrator - Bug #45279: cephadm bootstrap: monmaptool --create: error writing to '/tmp/monmap': (21) Is a directoryCan't reproduce

Actions
Actions #1

Updated by Michael Tucker over 3 years ago

spider@docker02:~$ sudo ./cephadm version
Using recent ceph image ceph/ceph:v15
ceph version 15.2.8 (bdf3eebcd22d7d0b3dd4d5501bee5bac354d5b55) octopus (stable)
spider@docker02:~$ sudo docker images
REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
ceph/ceph           v15                 5553b0cb212c        3 weeks ago         943MB
Actions #2

Updated by Michael Tucker over 3 years ago

I modified cephadm so I can poke around and see during this run that the following file is created:

root@docker02:/home/spider# ls -al /tmp/ceph-tmpj1ljfgr1
-rw------- 1 root root 0 Jan  7 18:12 /tmp/ceph-tmpj1ljfgr1
root@docker02:/home/spider# cat /tmp/ceph-tmpj1ljfgr1

When I try to run the the docker command manually I still receive the same error:

root@docker02:/home/spider# /snap/bin/docker run --rm --ipc=host --net=host --entrypoint /usr/bin/monmaptool -e CONTAINER_IMAGE=docker.io/ceph/ceph:v15 -e NODE_NAME=docker02 -v /tmp/ceph-tmpj1ljfgr1:/tmp/monmap:z docker.io/ceph/ceph:v15 --create --clobber --fsid 5bb7a9ec-5113-11eb-9137-7147df6a1932 --addv docker02 [v2:10.0.0.12:3300,v1:10.0.0.12:6789] /tmp/monmap
/usr/bin/monmaptool: monmap file /tmp/monmap
/usr/bin/monmaptool: set fsid to 5bb7a9ec-5113-11eb-9137-7147df6a1932
/usr/bin/monmaptool: writing epoch 0 to /tmp/monmap (1 monitors)
bufferlist::write_file(/tmp/monmap): failed to open file: (21) Is a directory
monmaptool: error writing to '/tmp/monmap': (21) Is a directory

Lets run the container again and take a peek inside:

root@docker02:/home/spider# /snap/bin/docker run -it --rm --ipc=host --net=host  -e CONTAINER_IMAGE=docker.io/ceph/ceph:v15 -e NODE_NAME=docker02 -v /tmp/ceph-tmpj1ljfgr1:/tmp/monmap:z docker.io/ceph/ceph:v15 bash
[root@docker02 /]#
[root@docker02 /]# ls -al /tmp/monmap
total 8
drwxr-xr-x 2 root root 4096 Jan  7 18:15 .
drwxrwxrwt 1 root root 4096 Jan  7 18:16 ..
[root@docker02 /]#

Interesting. The file is being mounted as a directory.

Actions #3

Updated by Michael Tucker over 3 years ago

For kicks I tried this on a different VM which is not using snap and it works:

root@docker01:~# touch /tmp/ceph-tmpj1ljfgr1
root@docker01:~# docker run -it --rm --ipc=host --net=host  -e CONTAINER_IMAGE=docker.io/ceph/ceph:v15 -e NODE_NAME=docker02 -v /tmp/ceph-tmpj1ljfgr1:/tmp/monmap:z docker.io/ceph/ceph:v15 bash
Unable to find image 'ceph/ceph:v15' locally
v15: Pulling from ceph/ceph
7a0437f04f83: Pull complete
ed95fc83a07f: Pull complete
Digest: sha256:37939a3739e4e037dcf1b1f5828058d721d8c6de958212609f9e7d920b9c62bf
Status: Downloaded newer image for ceph/ceph:v15
[root@docker01 /]#
[root@docker01 /]#
[root@docker01 /]# ls /tmp/monmap
/tmp/monmap
[root@docker01 /]# ls -al /tmp/monmap
-rw-r--r-- 1 root root 0 Jan  7 18:21 /tmp/monmap

Back to docker02 where I uninstalled the snap docker page and installed from Docker's repo:

spider@docker02:~$ touch /tmp/ceph-tmpj1ljfgr1
spider@docker02:~$ docker run -it --rm --ipc=host --net=host  -e CONTAINER_IMAGE=docker.io/ceph/ceph:v15 -e NODE_NAME=docker02 -v /tmp/ceph-tmpj1ljfgr1:/tmp/monmap docker.io/ceph/ceph:v15 bash
Unable to find image 'ceph/ceph:v15' locally
v15: Pulling from ceph/ceph
7a0437f04f83: Pull complete
ed95fc83a07f: Pull complete
Digest: sha256:37939a3739e4e037dcf1b1f5828058d721d8c6de958212609f9e7d920b9c62bf
Status: Downloaded newer image for ceph/ceph:v15
[root@docker02 /]# ls -al /tmp/monmap
-rw-rw-r-- 1 1000 1000 0 Jan  7 18:29 /tmp/monmap
[root@docker02 /]#

And the file is correctly mounted as a file and not a directory!

Actions #4

Updated by Michael Tucker over 3 years ago

Tried cephadm bootstrap again after switching to normal docker package:

Creating initial keys...
Creating initial monmap...
Creating mon...
Waiting for mon to start...
Waiting for mon...
mon is available
Assimilating anything we can from ceph.conf...
Generating new minimal ceph.conf...
Restarting the monitor...
Setting mon public_network...
Creating mgr...
Verifying port 9283 ...
Wrote keyring to /etc/ceph/ceph.client.admin.keyring
Wrote config to /etc/ceph/ceph.conf
Waiting for mgr to start...
Waiting for mgr...

It looks good. I will do more research into why snap docker mounts this incorrectly. Perhaps we can work around this within cephadm.

Some additional color: I would normally install docker from docker's repos but on this VM I chose to use the Ubuntu installer option for docker which used snap.

Actions #5

Updated by Sebastian Wagner about 3 years ago

  • Project changed from Ceph to Orchestrator
Actions #6

Updated by Sebastian Wagner about 3 years ago

  • Related to Bug #45279: cephadm bootstrap: monmaptool --create: error writing to '/tmp/monmap': (21) Is a directory added
Actions #7

Updated by Sebastian Wagner about 3 years ago

  • Status changed from New to Duplicate
Actions

Also available in: Atom PDF