Skip to content
This repository has been archived by the owner on Mar 25, 2024. It is now read-only.

getting an exception while deleting a record #13

Open
hazartilirot opened this issue Oct 3, 2020 · 0 comments
Open

getting an exception while deleting a record #13

hazartilirot opened this issue Oct 3, 2020 · 0 comments

Comments

@hazartilirot
Copy link

So, I've created a record:

/ip hotspot user add server all name user1 password 123456789 profile default

then I'm trying to delete it:

api.connect().then((client) => {
    client.menu("/ip hotspot user").where("name", "user1").remove().then((response) => {
        console.log(response);// response is an array of all items removed
    }).catch((err) => {
        // Error getting the list of firewall filter entries
        console.log(err);
    });
});

{
'$$path': '/ip/hotspot/user',
id: '*B',
name: 'user1',
password: 123456789,
profile: 'default',
uptime: '0s',
bytesIn: 0,
bytesOut: 0,
packetsIn: 0,
packetsOut: 0,
dynamic: false,
disabled: false
}
Response: true
events.js:292
throw er; // Unhandled 'error' event
^
RosException: Timed out after 10 seconds
at Connector.onTimeout (C:\Users\user\Desktop\temp\node_modules\node-routeros\dist\connector\Connector.js:187:30)
at Object.onceWrapper (events.js:421:28)
at Socket.emit (events.js:315:20)
at Socket._onTimeout (net.js:482:8)
at listOnTimeout (internal/timers.js:549:17)
at processTimers (internal/timers.js:492:7)
Emitted 'error' event on RouterOSClient instance at:
at RouterOSAPI. (C:\Users\user\Desktop\temp\node_modules\routeros-client\dist\RouterOSClient.js:34:53)
at Object.onceWrapper (events.js:422:26)
at RouterOSAPI.emit (events.js:315:20)
at Connector.connectedErrorListener (C:\Users\user\Desktop\temp\node_modules\node-routeros\dist\RouterOSAPI.js:105:30)
at Object.onceWrapper (events.js:422:26)
at Connector.emit (events.js:315:20)
at Connector.onTimeout (C:\Users\user\Desktop\develop\temp\node_modules\node-routeros\dist\connector\Connector.js:187:14)
at Object.onceWrapper (events.js:421:28)
at Socket.emit (events.js:315:20)
at Socket._onTimeout (net.js:482:8) {
errno: 'SOCKTMOUT'
}

a log records in routerOS:
00:00:00 system,info hotspot user user1 removed by admin
00:00:00 system,info,account user admin logged out from 192.168.1.254 via api

Thank you for the routerOS client! Well done! It's just what the doctor ordered! :D

@hazartilirot hazartilirot changed the title getting an exception once while deleting a record getting an exception while deleting a record Oct 3, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant