Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

500 internal server #61

Open
shibumi opened this issue Nov 23, 2018 · 5 comments
Open

500 internal server #61

shibumi opened this issue Nov 23, 2018 · 5 comments

Comments

@shibumi
Copy link

shibumi commented Nov 23, 2018

Hello,
I have this code:

for node in proxmox.nodes.get():                     
    for vm in proxmox.nodes(node['node']).qemu.get():
        print(vm)

Why do I get a 500 internal server error for some servers?

2018-11-23 15:51:06,709 INFO:proxmoxer.core: GET /nodes/cloud-19/qemu                                            
2018-11-23 15:51:06,710 DEBUG:paramiko.transport: [chan 10] Max packet in: 32768 bytes                           
2018-11-23 15:51:06,712 DEBUG:paramiko.transport: [chan 9] EOF sent (9)                                          
2018-11-23 15:51:06,714 DEBUG:paramiko.transport: [chan 10] Max packet out: 32768 bytes                          
2018-11-23 15:51:06,714 DEBUG:paramiko.transport: Secsh channel 10 opened.                                       
2018-11-23 15:51:06,762 DEBUG:paramiko.transport: [chan 10] Sesch channel 10 request ok                          
2018-11-23 15:51:08,537 DEBUG:paramiko.transport: [chan 10] EOF received (10)                                    
2018-11-23 15:51:08,538 DEBUG:proxmoxer.core: Status code: 500, output:                                          
Traceback (most recent call last):                                                                               
  File "proxmox-dokuwiki-exporter.py", line 24, in <module>                                                      
    for vm in proxmox.nodes(node['node']).qemu.get():                                                            
2018-11-23 15:51:08,541 DEBUG:paramiko.transport: [chan 10] EOF sent (10)                                        
  File "/home/chris/.virtualenvs/proxmox-dokuwiki-exporter/lib/python3.7/site-packages/proxmoxer/core.py", line 8
4, in get                                                                                                        
    return self(args)._request("GET", params=params)                                                             
  File "/home/chris/.virtualenvs/proxmox-dokuwiki-exporter/lib/python3.7/site-packages/proxmoxer/core.py", line 7
9, in _request                                                                                                   
    resp.content))                                                                                               
proxmoxer.core.ResourceException: 500 Internal Server Error:                                                     
@shibumi
Copy link
Author

shibumi commented Nov 23, 2018

Here is some traceback:

---------------------------------------------------------------------------
ResourceException                         Traceback (most recent call last)
<ipython-input-35-7a21cf167f34> in <module>
      1 for node in proxmox.nodes.get():
----> 2     for vm in proxmox.nodes(node['node']).qemu.get():
      3         print(vm)
      4
      5

~/.virtualenvs/proxmox-dokuwiki-exporter/lib/python3.7/site-packages/proxmoxer/core.py in get(self, *args, **params)                                                                                                              
     82
     83     def get(self, *args, **params):
---> 84         return self(args)._request("GET", params=params)
     85
     86     def post(self, *args, **data):

~/.virtualenvs/proxmox-dokuwiki-exporter/lib/python3.7/site-packages/proxmoxer/core.py in _request(self, method, data, params)                                                                                                    
     77         if resp.status_code >= 400:
     78             raise ResourceException("{0} {1}: {2}".format(resp.status_code, httplib.responses[resp.status_code],                                                                                                          
---> 79                                                           resp.content))
     80         elif 200 <= resp.status_code <= 299:
     81             return self._store["serializer"].loads(resp)

ResourceException: 500 Internal Server Error:

@hbokh
Copy link

hbokh commented Nov 29, 2018

I get the same kind of error using POST (HTTP):

192.168.1.2 - root@pam [29/11/2018:20:49:32 +0100] "POST /api2/json/nodes/pve/qemu HTTP/1.1" 500 13

And in Ansible the last error looks like this:

"msg": "creation of qemu VM prov-test3 with vmid 101 failed with exception=500 Internal Server Error: b'{\"data\":null}'"

$ pveversion
pve-manager/5.2-12/ba196e4b (running kernel: 4.15.18-9-pve)

@hbokh
Copy link

hbokh commented Nov 30, 2018

Using the fix mentioned in #57 ([FIX] Add reasons to error codes) helped me one step further:

"msg": "creation of qemu VM prov-test3 with vmid 101 failed with exception=500 Internal Server Error: storage 'local-zfs' does not exists, Content:b'{\"data\":null}'"

@shibumi
Copy link
Author

shibumi commented Dec 3, 2018

@hbokh does the storage really just exist? so your error message is valid and your fix is fixing the issue?

@hbokh
Copy link

hbokh commented Dec 3, 2018

The storage did not exist indeed (no ZFS). The additional error-message pointed me to where I had to fix things. So yes, the mentioned fix in #57 fixed my issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants