[GH-ISSUE #189] Can't create image file #129

Closed
opened 2026-02-27 15:57:26 +03:00 by kerem · 7 comments
Owner

Originally created by @ssbaksa on GitHub (Sep 26, 2018).
Original GitHub issue: https://github.com/retspen/webvirtcloud/issues/189

I have all 3 latest versions of webvirtcloud (retspen, catborise and bandic007) and on all of them I have the same error when I try to create image file on local or shared file system. Error screen is shown although image file was created.

That file can't be erased using web interface and user and group assignment of that file is wrong.

Error: cannot unlink file '/mnt/storage/images/1a1a.img': Permission denied
-rw-r--r-- 1 messagebus crontab 10739318784 Sep 26 13:20 1a1a.img

file should be created as root:root.
Older versions did all that without problem.

Request Method: POST
http://172.17.252.168:80/compute/2/storage/hulk/
1.11.14
TypeError
success() takes at least 2 arguments (1 given)
/srv/webvirtcloud/storages/views.py in storage, line 158
/srv/webvirtcloud/venv/bin/python2
2.7.12
['/srv/webvirtcloud', '/srv/webvirtcloud/venv/bin', '/srv/webvirtcloud/venv/lib/python2.7', '/srv/webvirtcloud/venv/lib/python2.7/plat-x86_64-linux-gnu', '/srv/webvirtcloud/venv/lib/python2.7/lib-tk', '/srv/webvirtcloud/venv/lib/python2.7/lib-old', '/srv/webvirtcloud/venv/lib/python2.7/lib-dynload', '/usr/lib/python2.7', '/usr/lib/python2.7/plat-x86_64-linux-gnu', '/usr/lib/python2.7/lib-tk', '/srv/webvirtcloud/venv/local/lib/python2.7/site-packages']
Wed, 26 Sep 2018 11:20:17 +0000

Environment:

Request Method: POST
Request URL: http://172.17.252.168:80/compute/2/storage/hulk/

Django Version: 1.11.14
Python Version: 2.7.12
Installed Applications:
('django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'computes',
'console',
'networks',
'storages',
'interfaces',
'instances',
'secrets',
'logs',
'accounts',
'create',
'datasource')
Installed Middleware:
('django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.auth.middleware.RemoteUserMiddleware',
'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware')

Traceback:

File "/srv/webvirtcloud/venv/local/lib/python2.7/site-packages/django/core/handlers/exception.py" in inner
41. response = get_response(request)

File "/srv/webvirtcloud/venv/local/lib/python2.7/site-packages/django/core/handlers/base.py" in _legacy_get_response
249. response = self._get_response(request)

File "/srv/webvirtcloud/venv/local/lib/python2.7/site-packages/django/core/handlers/base.py" in _get_response
187. response = self.process_exception_by_middleware(e, request)

File "/srv/webvirtcloud/venv/local/lib/python2.7/site-packages/django/core/handlers/base.py" in _get_response
185. response = wrapped_callback(request, *callback_args, **callback_kwargs)

File "/srv/webvirtcloud/venv/local/lib/python2.7/site-packages/django/contrib/auth/decorators.py" in _wrapped_view
23. return view_func(request, *args, **kwargs)

File "/srv/webvirtcloud/storages/views.py" in storage
158. messages.success("Image file {} is created successfully".format(data['name']+".img"))

Exception Type: TypeError at /compute/2/storage/hulk/
Exception Value: success() takes at least 2 arguments (1 given)

Originally created by @ssbaksa on GitHub (Sep 26, 2018). Original GitHub issue: https://github.com/retspen/webvirtcloud/issues/189 I have all 3 latest versions of webvirtcloud (retspen, catborise and bandic007) and on all of them I have the same error when I try to create image file on local or shared file system. Error screen is shown although image file was created. That file can't be erased using web interface and user and group assignment of that file is wrong. Error: cannot unlink file '/mnt/storage/images/1a1a.img': Permission denied -rw-r--r-- 1 messagebus crontab 10739318784 Sep 26 13:20 1a1a.img file should be created as root:root. Older versions did all that without problem. Request Method: | POST -- | -- http://172.17.252.168:80/compute/2/storage/hulk/ 1.11.14 TypeError success() takes at least 2 arguments (1 given) /srv/webvirtcloud/storages/views.py in storage, line 158 /srv/webvirtcloud/venv/bin/python2 2.7.12 ['/srv/webvirtcloud', '/srv/webvirtcloud/venv/bin', '/srv/webvirtcloud/venv/lib/python2.7', '/srv/webvirtcloud/venv/lib/python2.7/plat-x86_64-linux-gnu', '/srv/webvirtcloud/venv/lib/python2.7/lib-tk', '/srv/webvirtcloud/venv/lib/python2.7/lib-old', '/srv/webvirtcloud/venv/lib/python2.7/lib-dynload', '/usr/lib/python2.7', '/usr/lib/python2.7/plat-x86_64-linux-gnu', '/usr/lib/python2.7/lib-tk', '/srv/webvirtcloud/venv/local/lib/python2.7/site-packages'] Wed, 26 Sep 2018 11:20:17 +0000 Environment: Request Method: POST Request URL: http://172.17.252.168:80/compute/2/storage/hulk/ Django Version: 1.11.14 Python Version: 2.7.12 Installed Applications: ('django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', 'computes', 'console', 'networks', 'storages', 'interfaces', 'instances', 'secrets', 'logs', 'accounts', 'create', 'datasource') Installed Middleware: ('django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.common.CommonMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.auth.middleware.RemoteUserMiddleware', 'django.contrib.auth.middleware.SessionAuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware') Traceback: File "/srv/webvirtcloud/venv/local/lib/python2.7/site-packages/django/core/handlers/exception.py" in inner 41. response = get_response(request) File "/srv/webvirtcloud/venv/local/lib/python2.7/site-packages/django/core/handlers/base.py" in _legacy_get_response 249. response = self._get_response(request) File "/srv/webvirtcloud/venv/local/lib/python2.7/site-packages/django/core/handlers/base.py" in _get_response 187. response = self.process_exception_by_middleware(e, request) File "/srv/webvirtcloud/venv/local/lib/python2.7/site-packages/django/core/handlers/base.py" in _get_response 185. response = wrapped_callback(request, *callback_args, **callback_kwargs) File "/srv/webvirtcloud/venv/local/lib/python2.7/site-packages/django/contrib/auth/decorators.py" in _wrapped_view 23. return view_func(request, *args, **kwargs) File "/srv/webvirtcloud/storages/views.py" in storage 158. messages.success("Image file {} is created successfully".format(data['name']+".img")) Exception Type: TypeError at /compute/2/storage/hulk/ Exception Value: success() takes at least 2 arguments (1 given)
kerem closed this issue 2026-02-27 15:57:26 +03:00
Author
Owner

@catborise commented on GitHub (Sep 26, 2018):

hi,
one parameter was missing i added to /srv/webvirtcloud/storages/views.py
messages.success("Image file {} is created successfully".format(data['name']+".img"))
to
messages.success(request, _("Image file {} is created successfully".format(data['name']+".img")))
i send to my repo this fix. but it will be merge later to main repo.(also you can change it manually)

The other issue is related with users.
Normally libvirt uses qemu user whose id is 107
we will create it with that user. I think your user with id=107 is different.
later, i will it choosable but for now you can change it with manually on code.
edit /srv/webvirtcloud/storage.py and find 107 then change it with 0

<!-- gh-comment-id:424714087 --> @catborise commented on GitHub (Sep 26, 2018): hi, one parameter was missing i added to /srv/webvirtcloud/storages/views.py messages.success("Image file {} is created successfully".format(data['name']+".img")) to messages.success(request, _("Image file {} is created successfully".format(data['name']+".img"))) i send to my repo this fix. but it will be merge later to main repo.(also you can change it manually) The other issue is related with users. Normally libvirt uses qemu user whose id is 107 we will create it with that user. I think your user with id=107 is different. later, i will it choosable but for now you can change it with manually on code. edit /srv/webvirtcloud/storage.py and find 107 then change it with 0
Author
Owner

@ssbaksa commented on GitHub (Sep 26, 2018):

Hi,

Great! I will try it tomorow.

As for users and groups. This is normal installation of Ubuntu 16.04 server.

It looks to me that crontab hijacked group Id and user Id was hijacked by
messagebus.
This is the fact on all 8 servers installed with Ubuntu 16.04.
I am not enforcing user and group Id using qemu.conf so I relay on what is
done by WebVirtCloud.

The user for QEMU processes run by the system instance. It can be

specified as a user name or as a user id. The qemu driver will try to

parse this value first as a name and then, if the name doesn't exist,

as a user id.

Since a sequence of digits is a valid user name, a leading plus sign

can be used to ensure that a user id will not be interpreted as a user

name.

Some examples of valid values are:

user = "qemu" # A user named "qemu"

user = "+0" # Super user (uid=0)

user = "100" # A user named "100" or a user with uid=100

#user = "root"

The group for QEMU processes run by the system instance. It can be

specified in a similar way to user.

#group = "root"

Whether libvirt should dynamically change file ownership

to match the configured user/group above. Defaults to 1.

Set to 0 to disable file ownership changes.

#dynamic_ownership = 1

messagebus107:112::/var/run/dbus:/bin/false

crontab107:
syslog108:
netdev109:
lxd110:testlab
kvm111:
messagebus112:
uuidd113:
mlocate114:
ssh115:
libvirtd116:testlab

On 26 September 2018 at 15:26, catborise notifications@github.com wrote:

hi,
one parameter was missing i added to /srv/webvirtcloud/storages/views.py
messages.success("Image file {} is created successfully".format(data['
name']+".img"))
to
messages.success(request, _("Image file {} is created
successfully".format(data['name']+".img")))
i send to my repo this fix. but it will be merge later to main repo.(also
you can change it manually)

The other issue is related with users.
Normally libvirt uses qemu user whose id is 107
we will create it with that user. I think your user with id=107 is
different.
later, i will it choosable but for now you can change it with manually on
code.
edit /srv/webvirtcloud/storage.py and find 107 then change it with 0


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/retspen/webvirtcloud/issues/189#issuecomment-424714087,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ATCLsHsONWTKJY32E7QLuMEn7k_x1N7Lks5ue4CFgaJpZM4W6crs
.

<!-- gh-comment-id:424810201 --> @ssbaksa commented on GitHub (Sep 26, 2018): Hi, Great! I will try it tomorow. As for users and groups. This is normal installation of Ubuntu 16.04 server. It looks to me that crontab hijacked group Id and user Id was hijacked by messagebus. This is the fact on all 8 servers installed with Ubuntu 16.04. I am not enforcing user and group Id using qemu.conf so I relay on what is done by WebVirtCloud. # The user for QEMU processes run by the system instance. It can be # specified as a user name or as a user id. The qemu driver will try to # parse this value first as a name and then, if the name doesn't exist, # as a user id. # # Since a sequence of digits is a valid user name, a leading plus sign # can be used to ensure that a user id will not be interpreted as a user # name. # # Some examples of valid values are: # # user = "qemu" # A user named "qemu" # user = "+0" # Super user (uid=0) # user = "100" # A user named "100" or a user with uid=100 # #user = "root" # The group for QEMU processes run by the system instance. It can be # specified in a similar way to user. #group = "root" # Whether libvirt should dynamically change file ownership # to match the configured user/group above. Defaults to 1. # Set to 0 to disable file ownership changes. #dynamic_ownership = 1 messagebus:x:107:112::/var/run/dbus:/bin/false crontab:x:107: syslog:x:108: netdev:x:109: lxd:x:110:testlab kvm:x:111: messagebus:x:112: uuidd:x:113: mlocate:x:114: ssh:x:115: libvirtd:x:116:testlab On 26 September 2018 at 15:26, catborise <notifications@github.com> wrote: > hi, > one parameter was missing i added to /srv/webvirtcloud/storages/views.py > messages.success("Image file {} is created successfully".format(data[' > name']+".img")) > to > messages.success(request, _("Image file {} is created > successfully".format(data['name']+".img"))) > i send to my repo this fix. but it will be merge later to main repo.(also > you can change it manually) > > The other issue is related with users. > Normally libvirt uses qemu user whose id is 107 > we will create it with that user. I think your user with id=107 is > different. > later, i will it choosable but for now you can change it with manually on > code. > edit /srv/webvirtcloud/storage.py and find 107 then change it with 0 > > — > You are receiving this because you authored the thread. > Reply to this email directly, view it on GitHub > <https://github.com/retspen/webvirtcloud/issues/189#issuecomment-424714087>, > or mute the thread > <https://github.com/notifications/unsubscribe-auth/ATCLsHsONWTKJY32E7QLuMEn7k_x1N7Lks5ue4CFgaJpZM4W6crs> > . >
Author
Owner

@catborise commented on GitHub (Sep 27, 2018):

i check ubuntu 16.04, yes, it is different. there is not any qemu user but libvirt-qemu and it's id is different(not reserved as on centos/rhel)

i add a parameter to settings.py, you can change it whatever you want. 0=root, or libvirt-bin=64055(it is up to os)
latest changes in my repo.

i will make a pull request to retspen... 1 week later may they merge to main repo...
after you check, please give feedback

thanks

<!-- gh-comment-id:424978179 --> @catborise commented on GitHub (Sep 27, 2018): i check ubuntu 16.04, yes, it is different. there is not any qemu user but libvirt-qemu and it's id is different(not reserved as on centos/rhel) i add a parameter to settings.py, you can change it whatever you want. 0=root, or libvirt-bin=64055(it is up to os) latest changes in my repo. i will make a pull request to retspen... 1 week later may they merge to main repo... after you check, please give feedback thanks
Author
Owner

@ssbaksa commented on GitHub (Sep 27, 2018):

Hi,

Thank you for quick response. I have puled last changes this morning and it
works as expected now.

I will test ownership changes today and report my findings.

If you need to test something, just ping me. I have around 15 servers
running different versions of WebVirtCloud (some of them old WebVirt
Manager) and more than 60 servers under Openstack but I prefer pure libvirt
with WVC (or Virsh) over OpenStack.

Br

Sasa

On 27 September 2018 at 08:50, catborise notifications@github.com wrote:

i check ubuntu 16.04, yes, it is different. there is not any qemu user but
libvirt-qemu and it's id is different(not reserved as on centos/rhel)

i add a parameter to settings.py, you can change it whatever you want.
0=root, or libvirt-bin=64055(it is up to os)
latest changes in my repo.

i will make a pull request to retspen... 1 week later may they merge to
main repo...
after you check, please give feedback

thanks


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/retspen/webvirtcloud/issues/189#issuecomment-424978179,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ATCLsOfHjMWO5Za74w-8ictf640fwq0-ks5ufHUvgaJpZM4W6crs
.

<!-- gh-comment-id:424988110 --> @ssbaksa commented on GitHub (Sep 27, 2018): Hi, Thank you for quick response. I have puled last changes this morning and it works as expected now. I will test ownership changes today and report my findings. If you need to test something, just ping me. I have around 15 servers running different versions of WebVirtCloud (some of them old WebVirt Manager) and more than 60 servers under Openstack but I prefer pure libvirt with WVC (or Virsh) over OpenStack. Br Sasa On 27 September 2018 at 08:50, catborise <notifications@github.com> wrote: > i check ubuntu 16.04, yes, it is different. there is not any qemu user but > libvirt-qemu and it's id is different(not reserved as on centos/rhel) > > i add a parameter to settings.py, you can change it whatever you want. > 0=root, or libvirt-bin=64055(it is up to os) > latest changes in my repo. > > i will make a pull request to retspen... 1 week later may they merge to > main repo... > after you check, please give feedback > > thanks > > — > You are receiving this because you authored the thread. > Reply to this email directly, view it on GitHub > <https://github.com/retspen/webvirtcloud/issues/189#issuecomment-424978179>, > or mute the thread > <https://github.com/notifications/unsubscribe-auth/ATCLsOfHjMWO5Za74w-8ictf640fwq0-ks5ufHUvgaJpZM4W6crs> > . >
Author
Owner

@ssbaksa commented on GitHub (Sep 27, 2018):

Hi,

I have tested it on newly installed server and it works but, I have one
suggestion. It will be good to have separated config for UID and GID
becasue user (libvirt-qemu) uses UID 64055 as default and default group for
that user is kvm with GID 111.

Br

Sasa

On 27 September 2018 at 09:31, Saša-Stjepan Bakša ssbaksa@gmail.com wrote:

Hi,

Thank you for quick response. I have puled last changes this morning and
it works as expected now.

I will test ownership changes today and report my findings.

If you need to test something, just ping me. I have around 15 servers
running different versions of WebVirtCloud (some of them old WebVirt
Manager) and more than 60 servers under Openstack but I prefer pure libvirt
with WVC (or Virsh) over OpenStack.

Br

Sasa

On 27 September 2018 at 08:50, catborise notifications@github.com wrote:

i check ubuntu 16.04, yes, it is different. there is not any qemu user
but libvirt-qemu and it's id is different(not reserved as on centos/rhel)

i add a parameter to settings.py, you can change it whatever you want.
0=root, or libvirt-bin=64055(it is up to os)
latest changes in my repo.

i will make a pull request to retspen... 1 week later may they merge to
main repo...
after you check, please give feedback

thanks


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/retspen/webvirtcloud/issues/189#issuecomment-424978179,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ATCLsOfHjMWO5Za74w-8ictf640fwq0-ks5ufHUvgaJpZM4W6crs
.

<!-- gh-comment-id:425018037 --> @ssbaksa commented on GitHub (Sep 27, 2018): Hi, I have tested it on newly installed server and it works but, I have one suggestion. It will be good to have separated config for UID and GID becasue user (libvirt-qemu) uses UID 64055 as default and default group for that user is kvm with GID 111. Br Sasa On 27 September 2018 at 09:31, Saša-Stjepan Bakša <ssbaksa@gmail.com> wrote: > Hi, > > Thank you for quick response. I have puled last changes this morning and > it works as expected now. > > I will test ownership changes today and report my findings. > > If you need to test something, just ping me. I have around 15 servers > running different versions of WebVirtCloud (some of them old WebVirt > Manager) and more than 60 servers under Openstack but I prefer pure libvirt > with WVC (or Virsh) over OpenStack. > > Br > > Sasa > > On 27 September 2018 at 08:50, catborise <notifications@github.com> wrote: > >> i check ubuntu 16.04, yes, it is different. there is not any qemu user >> but libvirt-qemu and it's id is different(not reserved as on centos/rhel) >> >> i add a parameter to settings.py, you can change it whatever you want. >> 0=root, or libvirt-bin=64055(it is up to os) >> latest changes in my repo. >> >> i will make a pull request to retspen... 1 week later may they merge to >> main repo... >> after you check, please give feedback >> >> thanks >> >> — >> You are receiving this because you authored the thread. >> Reply to this email directly, view it on GitHub >> <https://github.com/retspen/webvirtcloud/issues/189#issuecomment-424978179>, >> or mute the thread >> <https://github.com/notifications/unsubscribe-auth/ATCLsOfHjMWO5Za74w-8ictf640fwq0-ks5ufHUvgaJpZM4W6crs> >> . >> > >
Author
Owner

@catborise commented on GitHub (Sep 27, 2018):

okey @ssbaksa , i will do it. you can close the issue
for now i am workin on instances tab for host. in a few days it will be done
thanks.
have a nice day

<!-- gh-comment-id:425106582 --> @catborise commented on GitHub (Sep 27, 2018): okey @ssbaksa , i will do it. you can close the issue for now i am workin on instances tab for host. in a few days it will be done thanks. have a nice day
Author
Owner

@ssbaksa commented on GitHub (Sep 27, 2018):

Thank you for great support.
Br
Sasa

On Thu, 27 Sep 2018, 16:09 catborise, notifications@github.com wrote:

okey @ssbaksa https://github.com/ssbaksa , i will do it. you can close
the issue
for now i am workin on instances tab for host. in a few days it will be
done
thanks.
have a nice day


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/retspen/webvirtcloud/issues/189#issuecomment-425106582,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ATCLsHQ_jkBIDiYnO2JPh0XlFGvnCuyYks5ufNv9gaJpZM4W6crs
.

<!-- gh-comment-id:425150344 --> @ssbaksa commented on GitHub (Sep 27, 2018): Thank you for great support. Br Sasa On Thu, 27 Sep 2018, 16:09 catborise, <notifications@github.com> wrote: > okey @ssbaksa <https://github.com/ssbaksa> , i will do it. you can close > the issue > for now i am workin on instances tab for host. in a few days it will be > done > thanks. > have a nice day > > — > You are receiving this because you were mentioned. > Reply to this email directly, view it on GitHub > <https://github.com/retspen/webvirtcloud/issues/189#issuecomment-425106582>, > or mute the thread > <https://github.com/notifications/unsubscribe-auth/ATCLsHQ_jkBIDiYnO2JPh0XlFGvnCuyYks5ufNv9gaJpZM4W6crs> > . >
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/webvirtcloud#129
No description provided.