Serial Number not working - 404?

Solved
dawydiuk
Comes here often

Serial Number not working - 404?

I'm using the meraki-cli project. My end goal is to monitor latency, but getting a 404 error. I can run meraki organizations getOrganizations, and I get valid return information. When I attempt to get device information though I'm getting a 404. Here is an example command meraki devices getDevice --serial 'mySerialNumber'. I have triple checked mySerialNumber matches the serial number listed matches my mx device serial number as listed in the Meraki dashboard Organization - Inventory. Any pointers?

 

Please note the serial number is in the format 1111-2222-3333. I've attempted removing the dashes but get the same errors(e.g. 111122223333)...

 

The errors I'm getting back are below.

 

2022-08-18 17:28:50,944 [INFO ] Target method is <bound method Devices.getDevice of <meraki.api.devices.Devices object at 0x7f5e00d1aa70>>
2022-08-18 17:28:50,944 [INFO ] No STDIN detected. No pipe behind this instance.
2022-08-18 17:28:50,945 [INFO ] Calling target method with:
2022-08-18 17:28:50,945 [INFO ] *Positionals: ['mySerialNumber']
2022-08-18 17:28:50,945 [INFO ] **Named/Kwargs: {}
2022-08-18 17:28:52,760 [ERROR] devices, getDevice - 404 Not Found, b' '
2022-08-18 17:28:52,760 [CRITI] An error occured in command execution, enable debugging to see more detail
2022-08-18 17:28:52,760 [CRITI] An exception was thrown and is logged below
2022-08-18 17:28:52,761 [ERROR] devices, getDevice - 404 Not Found, please wait a minute if the key or org was just newly created.
Traceback (most recent call last):
File "/home/eddie/.local/lib/python3.10/site-packages/meraki_cli/__main__.py", line 1314, in main
result = arg_obj.method(*positionals, **arg_dict)
File "/home/eddie/.local/lib/python3.10/site-packages/meraki/api/devices.py", line 26, in getDevice
return self._session.get(metadata, resource)
File "/home/eddie/.local/lib/python3.10/site-packages/meraki/rest_session.py", line 283, in get
response = self.request(metadata, 'GET', url, params=params)
File "/home/eddie/.local/lib/python3.10/site-packages/meraki/rest_session.py", line 277, in request
raise APIError(metadata, response)
meraki.exceptions.APIError: devices, getDevice - 404 Not Found, please wait a minute if the key or org was just newly created.

 

 

1 Accepted Solution
ShawnHu
Meraki Employee
Meraki Employee

It still looks like a wrong/non-existing SN to me. To narrow down this, first, ensure you have the right network permission(which I assume you already have as you can get the organization list). Then try the below curl command to rule out any library issues. 

 

curl -L --request GET \
--url https://api.meraki.com/api/v1/devices/[YOUR SERIAL NUMBER] \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'X-Cisco-Meraki-API-Key: [YOUR API KEY]'

View solution in original post

2 Replies 2
ShawnHu
Meraki Employee
Meraki Employee

It still looks like a wrong/non-existing SN to me. To narrow down this, first, ensure you have the right network permission(which I assume you already have as you can get the organization list). Then try the below curl command to rule out any library issues. 

 

curl -L --request GET \
--url https://api.meraki.com/api/v1/devices/[YOUR SERIAL NUMBER] \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'X-Cisco-Meraki-API-Key: [YOUR API KEY]'

dawydiuk
Comes here often

Thanks that worked, so I went back to the meraki-cli and by running the exact same command and not changing anything it worked... Not sure what to think but it's working today, thanks 🙂

Get notified when there are additional replies to this discussion.