[Support] Electric Brain Unraid API


Recommended Posts

  • 1 month later...
On 2/26/2022 at 7:01 PM, faroh said:

I'm having this exact issue. What do you mean by using the hashed host ip? 

 

Not the internal IP, eg 192.168.1.10

This is the hashed host ip.

image.png.e79ea57517006843777a9ed493c4e211.png

Note you not include HTTPS:// in the Sever IP field as you will be ticking the HTTPS option which adds that automatically.

 

 

 

Link to comment
  • 1 month later...
Posted (edited)
On 3/27/2022 at 9:17 AM, PsI-X said:

 

Not the internal IP, eg 192.168.1.10

This is the hashed host ip.

image.png.e79ea57517006843777a9ed493c4e211.png

Note you not include HTTPS:// in the Sever IP field as you will be ticking the HTTPS option which adds that automatically.

 

 

 

I have done this but still get "Failed with status code: undefined"

 

Also get the same error's with IP

image.png.677dd7ed41307f1e5f4fef54b38f18a4.png

Edited by MrLinford
Link to comment

Hi everyone. 

I'm trying to setup everything iot be able to monitor my unraid server on my homeassistant.

Home Assistant runs as a vm on unraid.

I hame made all the configs but I'm getting some errors.

I am attaching some pictures of my settings and the error.

Please advice

Regards Nick

unraid api (on unraid).png

unraid api settings.png

unraid settings.png

error unraid api.png

Link to comment
On 5/2/2022 at 6:42 PM, MrLinford said:

@ElectricBrainUK Any idea what could make the above happen?

As you mentioned you should be using the hashed url not the ip - the host unreachable error suggests to me that you have the unraid api on a custom bridge on the same machine as the unraid box itself? Unraid does not allow custom bridged dockers to reach the host.

 

On 5/9/2022 at 12:07 PM, nt7561 said:

Hi everyone. 

I'm trying to setup everything iot be able to monitor my unraid server on my homeassistant.

Home Assistant runs as a vm on unraid.

I hame made all the configs but I'm getting some errors.

I am attaching some pictures of my settings and the error.

Please advice

Regards Nick

unraid api (on unraid).png

unraid api settings.png

unraid settings.png

error unraid api.png

It looks like you have this set up in both home assistant and unraid? You only need the api in one or the other - I would recommend using the unraid one as the home assistant one is unreliable and outdated. It also looks like youre hosting the mqtt broker on home assistant - assuming that is all set up correctly with auto discovery and the unraid api is configured to read in from the unraid server you should be good to go

  • Like 1
Link to comment
  • 2 weeks later...
On 5/11/2022 at 2:15 PM, ElectricBrainUK said:

As you mentioned you should be using the hashed url not the ip - the host unreachable error suggests to me that you have the unraid api on a custom bridge on the same machine as the unraid box itself? Unraid does not allow custom bridged dockers to reach the host.

 

It looks like you have this set up in both home assistant and unraid? You only need the api in one or the other - I would recommend using the unraid one as the home assistant one is unreliable and outdated. It also looks like youre hosting the mqtt broker on home assistant - assuming that is all set up correctly with auto discovery and the unraid api is configured to read in from the unraid server you should be good to go

Hi ElectricBrainUK.

It worked. Did exactly what you said and now works fine.

Many thanks my friend

Cheers

  • Like 1
Link to comment
On 2/19/2022 at 9:34 PM, TRusselo said:

so why is this docker using over a gigabyte of memory?

its using more than anyother thing on my server....

same problem here....

 

I removed all files in appdata and reconfigured the Unraid-API adding this to the extra parameters because it slowed down my unraid server and the unraid-api container always crashed:

-e JAVA_OPTS="-Xmx2500m"

 

I also used the hashed url in the Unraid-API configuration and everything seemed to work as I saw my dockers, my vms and the unraid details like array, USBs.

 

But it still uses more than anyother thing on my server and finally crashes as before I had the "JAVA_OPTS" in the extra parameters (this picture was made before setting the java options!).

554589317_Bildschirmfotovom2022-05-2712-48-27.png.fc44bc03409144b42f61f4040f4cd60d.png

 

These are the docker container logs from the new configured unraid-api (create>configure>authenticate>working>crash):

today at 11:25:24> unraidapi@0.5.0 start
today at 11:25:24> cross-env NUXT_HOST=0.0.0.0 NODE_ENV=production node server/index.js
today at 11:25:24
today at 11:25:25
today at 11:25:25 WARN  mode option is deprecated. You can safely remove it from nuxt.config
today at 11:25:25
today at 11:25:25(node:26) [DEP0148] DeprecationWarning: Use of deprecated folder mapping "./" in the "exports" field module resolution of the package at /app/node_modules/@nuxt/components/package.json.
today at 11:25:25Update this package.json to use a subpath pattern like "./*".
today at 11:25:25(Use `node --trace-deprecation ...` to show where the warning was created)
today at 11:25:26Connected to mqtt broker
today at 11:25:26Error: ENOENT: no such file or directory, open 'config/mqttKeys'
today at 11:25:26    at Object.openSync (node:fs:585:3)
today at 11:25:26    at Proxy.readFileSync (node:fs:453:35)
today at 11:25:26    at updateMQTT (/app/mqtt/index.js:276:30)
today at 11:25:26    at MqttClient.<anonymous> (/app/mqtt/index.js:49:7)
today at 11:25:26    at MqttClient.emit (node:events:539:35)
today at 11:25:26    at MqttClient.emit (node:domain:475:12)
today at 11:25:26    at Readable.<anonymous> (/app/node_modules/mqtt/lib/client.js:1449:14)
today at 11:25:26    at Readable.emit (node:events:527:28)
today at 11:25:26    at Readable.emit (node:domain:475:12)
today at 11:25:26    at endReadableNT (/app/node_modules/mqtt/node_modules/readable-stream/lib/_stream_readable.js:1010:12) {
today at 11:25:26  errno: -2,
today at 11:25:26  syscall: 'open',
today at 11:25:26  code: 'ENOENT',
today at 11:25:26  path: 'config/mqttKeys'
today at 11:25:26}
today at 11:25:26The secure keys for mqtt may have not been generated, you need to make 1 authenticated request via the API first for this to work
today at 11:25:26
today at 11:25:26 READY  Server listening on http://0.0.0.0:80
today at 11:25:26
today at 11:25:36Error: ENOENT: no such file or directory, open 'config/mqttKeys'
today at 11:25:36    at Object.openSync (node:fs:585:3)
today at 11:25:36    at Proxy.readFileSync (node:fs:453:35)
today at 11:25:36    at updateMQTT (/app/mqtt/index.js:276:30)
today at 11:25:36    at Timeout._onTimeout (/app/mqtt/index.js:308:5)
today at 11:25:36    at listOnTimeout (node:internal/timers:559:17)
today at 11:25:36    at processTimers (node:internal/timers:502:7) {
today at 11:25:36  errno: -2,
today at 11:25:36  syscall: 'open',
today at 11:25:36  code: 'ENOENT',
today at 11:25:36  path: 'config/mqttKeys'
today at 11:25:36}
today at 11:25:36The secure keys for mqtt may have not been generated, you need to make 1 authenticated request via the API first for this to work
today at 11:25:46Failed to retrieve config file, creating new.
today at 11:25:46
today at 11:25:46 ERROR  ENOENT: no such file or directory, open 'config/mqttKeys'
today at 11:25:46
today at 11:25:46  at Object.openSync (node:fs:585:3)
today at 11:25:46  at Proxy.readFileSync (node:fs:453:35)
today at 11:25:46  at default (api/getServers.js:27:36)
today at 11:25:46  at call (node_modules/connect/index.js:239:7)
today at 11:25:46  at next (node_modules/connect/index.js:183:5)
today at 11:25:46  at next (node_modules/connect/index.js:161:14)
today at 11:25:46  at next (node_modules/connect/index.js:161:14)
today at 11:25:46  at SendStream.error (node_modules/serve-static/index.js:121:7)
today at 11:25:46  at SendStream.emit (node:events:527:28)
today at 11:25:46  at SendStream.emit (node:domain:475:12)
today at 11:25:46
today at 11:25:46Error: ENOENT: no such file or directory, open 'config/mqttKeys'
today at 11:25:46    at Object.openSync (node:fs:585:3)
today at 11:25:46    at Proxy.readFileSync (node:fs:453:35)
today at 11:25:46    at updateMQTT (/app/mqtt/index.js:276:30)
today at 11:25:46    at Timeout._onTimeout (/app/mqtt/index.js:308:5)
today at 11:25:46    at listOnTimeout (node:internal/timers:559:17)
today at 11:25:46    at processTimers (node:internal/timers:502:7) {
today at 11:25:46  errno: -2,
today at 11:25:46  syscall: 'open',
today at 11:25:46  code: 'ENOENT',
today at 11:25:46  path: 'config/mqttKeys'
today at 11:25:46}
today at 11:25:46The secure keys for mqtt may have not been generated, you need to make 1 authenticated request via the API first for this to work
today at 11:25:56
today at 11:25:56 ERROR  ENOENT: no such file or directory, open 'config/mqttKeys'
today at 11:25:56
today at 11:25:56  at Object.openSync (node:fs:585:3)
today at 11:25:56  at Proxy.readFileSync (node:fs:453:35)
today at 11:25:56  at default (api/getServers.js:27:36)
today at 11:25:56  at call (node_modules/connect/index.js:239:7)
today at 11:25:56  at next (node_modules/connect/index.js:183:5)
today at 11:25:56  at next (node_modules/connect/index.js:161:14)
today at 11:25:56  at next (node_modules/connect/index.js:161:14)
today at 11:25:56  at SendStream.error (node_modules/serve-static/index.js:121:7)
today at 11:25:56  at SendStream.emit (node:events:527:28)
today at 11:25:56  at SendStream.emit (node:domain:475:12)
today at 11:25:56
today at 11:25:56Error: ENOENT: no such file or directory, open 'config/mqttKeys'
today at 11:25:56    at Object.openSync (node:fs:585:3)
today at 11:25:56    at Proxy.readFileSync (node:fs:453:35)
today at 11:25:56    at updateMQTT (/app/mqtt/index.js:276:30)
today at 11:25:56    at Timeout._onTimeout (/app/mqtt/index.js:308:5)
today at 11:25:56    at listOnTimeout (node:internal/timers:559:17)
today at 11:25:56    at processTimers (node:internal/timers:502:7) {
today at 11:25:56  errno: -2,
today at 11:25:56  syscall: 'open',
today at 11:25:56  code: 'ENOENT',
today at 11:25:56  path: 'config/mqttKeys'
today at 11:25:56}
today at 11:25:56The secure keys for mqtt may have not been generated, you need to make 1 authenticated request via the API first for this to work
today at 11:29:29Connected to mqtt broker
today at 11:29:30Connected to mqtt broker
today at 11:29:31Connected to mqtt broker
today at 11:29:33Connected to mqtt broker
today at 11:29:34Connected to mqtt broker
today at 11:29:35Connected to mqtt broker
today at 11:29:36Connected to mqtt broker
today at 11:29:37Connected to mqtt broker
today at 11:31:51npm ERR! path /app
today at 11:31:51npm ERR! command failed
today at 11:31:51npm ERR! signal SIGTERM
today at 11:31:51npm ERR! command sh -c cross-env NUXT_HOST=0.0.0.0 NODE_ENV=production node server/index.js
today at 11:31:51
today at 11:31:51npm ERR! A complete log of this run can be found in:
today at 11:31:51npm ERR!     /root/.npm/_logs/2022-05-27T09_25_24_461Z-debug-0.log
today at 11:31:52
today at 11:31:52> unraidapi@0.5.0 start
today at 11:31:52> cross-env NUXT_HOST=0.0.0.0 NODE_ENV=production node server/index.js
today at 11:31:52
today at 11:31:52
today at 11:31:52 WARN  mode option is deprecated. You can safely remove it from nuxt.config
today at 11:31:52
today at 11:31:52(node:26) [DEP0148] DeprecationWarning: Use of deprecated folder mapping "./" in the "exports" field module resolution of the package at /app/node_modules/@nuxt/components/package.json.
today at 11:31:52Update this package.json to use a subpath pattern like "./*".
today at 11:31:52(Use `node --trace-deprecation ...` to show where the warning was created)
today at 11:31:55Connected to mqtt broker
today at 11:31:55
today at 11:31:55 READY  Server listening on http://0.0.0.0:80
today at 11:31:55
today at 11:31:58Connected to mqtt broker
today at 11:31:59Connected to mqtt broker
today at 11:32:02Connected to mqtt broker
today at 11:32:03Connected to mqtt broker
today at 11:32:05Connected to mqtt broker
today at 11:32:06Connected to mqtt broker
today at 11:35:20Connected to mqtt broker
today at 11:35:21Connected to mqtt broker
today at 11:35:24Connected to mqtt broker
today at 11:35:25Connected to mqtt broker
today at 11:38:39Connected to mqtt broker
today at 11:38:40Connected to mqtt broker
today at 11:38:42Connected to mqtt broker
today at 11:38:43Connected to mqtt broker
today at 11:38:45Connected to mqtt broker
today at 11:41:59Connected to mqtt broker
today at 11:42:01Connected to mqtt broker
today at 11:42:02Connected to mqtt broker
today at 11:45:16Connected to mqtt broker
today at 11:45:17Connected to mqtt broker
today at 11:45:19Connected to mqtt broker
today at 11:45:20Connected to mqtt broker
today at 11:48:35Connected to mqtt broker
today at 11:48:36Connected to mqtt broker
today at 11:48:38Connected to mqtt broker
today at 11:48:39Connected to mqtt broker
today at 11:48:41Connected to mqtt broker
today at 11:48:42Connected to mqtt broker
today at 11:50:42
today at 11:50:42<--- Last few GCs --->
today at 11:50:42
today at 11:50:42[26:0x4aaa470]  1130031 ms: Mark-sweep 3995.4 (4140.7) -> 3992.9 (4138.4) MB, 86.6 / 0.1 ms  (average mu = 0.111, current mu = 0.032) allocation failure scavenge might not succeed
today at 11:50:42[26:0x4aaa470]  1130120 ms: Mark-sweep 3996.0 (4141.3) -> 3993.7 (4139.2) MB, 86.3 / 0.0 ms  (average mu = 0.074, current mu = 0.034) allocation failure scavenge might not succeed
today at 11:50:42
today at 11:50:42
today at 11:50:42<--- JS stacktrace --->
today at 11:50:42
today at 11:50:42FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
today at 11:50:42 1: 0xb09c10 node::Abort() [node]
today at 11:50:42 2: 0xa1c193 node::FatalError(char const*, char const*) [node]
today at 11:50:42 3: 0xcf8dbe v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, bool) [node]
today at 11:50:42 4: 0xcf9137 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, bool) [node]
today at 11:50:42 5: 0xeb09d5  [node]
today at 11:50:42 6: 0xeb14b6  [node]
today at 11:50:42 7: 0xebf9de  [node]
today at 11:50:42 8: 0xec0420 v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [node]
today at 11:50:42 9: 0xec339e v8::internal::Heap::AllocateRawWithRetryOrFailSlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [node]
today at 11:50:4210: 0xe848da v8::internal::Factory::NewFillerObject(int, bool, v8::internal::AllocationType, v8::internal::AllocationOrigin) [node]
today at 11:50:4211: 0x11fd626 v8::internal::Runtime_AllocateInYoungGeneration(int, unsigned long*, v8::internal::Isolate*) [node]
today at 11:50:4212: 0x15f2099  [node]
today at 11:50:42Container stopped
Link to comment

I think this container was slowing and then killing the unraid web ui after filling up logs after updating to 6.10.  A reboot of unraid fixes the issue temporarily.  My log is filled with this:

May 29 08:49:08 NAStheRIPPER nginx: 2022/05/29 08:49:08 [error] 8928#8928: *1899305 limiting requests, excess: 20.348 by zone "authlimit", client: 172.17.0.15, server: , request: "POST /login HTTP/1.1", host: "192.168.1.10"

I see here that we are supposed to use the hash URL, I wasn't using the MyServers plugin previous to updating to 6.10.  I'm not sure I got the hash URL correct, I recently rebooted to get things working more quickly, otherwise pages to 5-10 minutes to load, and I'm still seeing errors, 2st is docker log, 2nd is unraid log

Get Main Details for ip: https://NUMBERS.CENSORED.myunraid.net:444/ Failed

May 30 10:38:49 NAStheRIPPER nginx: 2022/05/30 10:38:49 [error] 8994#8994: *64073 limiting requests, excess: 20.086 by zone "authlimit", client: 192.168.1.1, server: NUMBERS.CENSORED.myunraid.net, request: "GET /login HTTP/1.1", host: "NUMBERS.CENSORED.myunraid.net:444"

Note: The censored "NUMBERS" after server is my unbraid local IP, and for host it is different and matches the hashed URL.

 

 

I may have initially had the wrong url, like I hadn't removed https://, and I may have included too much at the end.  Now I am using NUMBERS.CENSORED.myunraid.net in the unraid api web ui, and checking the https box.   The list there is populated, and I can, for example, pause a container, after being asked for username and password again. But at the same time I'm still getting the errors which leads me to believe I'm back on my way to having a full log file and slow to no web gui response. I'm at 3% log file after around an hour.

 

I have a second unraid box that seems like it should have the same issue, but I don't see anything in the syslog and it hasn't had any slow or unresponive web ui issues, I updated the unraid api settings and now its log has the same errors.

nastheripper-diagnostics-20220530-1054.zip

Link to comment

Yeah looks like there is a memory leak - unfortuantely I dont have the time to fix it. Happy to merge pull requests if someone else has the time to look into it.

 

@bobobeastie I just have https://hash.unraid.net as I only set it up via https and not via myservers plugin

On 5/30/2022 at 4:01 PM, bobobeastie said:

I think this container was slowing and then killing the unraid web ui after filling up logs after updating to 6.10.  A reboot of unraid fixes the issue temporarily.  My log is filled with this:

May 29 08:49:08 NAStheRIPPER nginx: 2022/05/29 08:49:08 [error] 8928#8928: *1899305 limiting requests, excess: 20.348 by zone "authlimit", client: 172.17.0.15, server: , request: "POST /login HTTP/1.1", host: "192.168.1.10"

I see here that we are supposed to use the hash URL, I wasn't using the MyServers plugin previous to updating to 6.10.  I'm not sure I got the hash URL correct, I recently rebooted to get things working more quickly, otherwise pages to 5-10 minutes to load, and I'm still seeing errors, 2st is docker log, 2nd is unraid log

Get Main Details for ip: https://NUMBERS.CENSORED.myunraid.net:444/ Failed

May 30 10:38:49 NAStheRIPPER nginx: 2022/05/30 10:38:49 [error] 8994#8994: *64073 limiting requests, excess: 20.086 by zone "authlimit", client: 192.168.1.1, server: NUMBERS.CENSORED.myunraid.net, request: "GET /login HTTP/1.1", host: "NUMBERS.CENSORED.myunraid.net:444"

Note: The censored "NUMBERS" after server is my unbraid local IP, and for host it is different and matches the hashed URL.

 

 

I may have initially had the wrong url, like I hadn't removed https://, and I may have included too much at the end.  Now I am using NUMBERS.CENSORED.myunraid.net in the unraid api web ui, and checking the https box.   The list there is populated, and I can, for example, pause a container, after being asked for username and password again. But at the same time I'm still getting the errors which leads me to believe I'm back on my way to having a full log file and slow to no web gui response. I'm at 3% log file after around an hour.

 

I have a second unraid box that seems like it should have the same issue, but I don't see anything in the syslog and it hasn't had any slow or unresponive web ui issues, I updated the unraid api settings and now its log has the same errors.

nastheripper-diagnostics-20220530-1054.zip 300.8 kB · 0 downloads

 

Link to comment
  • 1 month later...
On 3/27/2022 at 10:17 AM, PsI-X said:

 

Not the internal IP, eg 192.168.1.10

This is the hashed host ip.

image.png.e79ea57517006843777a9ed493c4e211.png

Note you not include HTTPS:// in the Sever IP field as you will be ticking the HTTPS option which adds that automatically.

 

 

 

I cannot make this work. I enter my hashed host IP without https://, enable https checkmark, and then provide the login details. Nothing happens. Do I enter my local login details or my unraid.net login?

Edited by Wieuwzak
a word
Link to comment
14 minutes ago, Wieuwzak said:

I cannot make this work. I enter my hashed host IP without https://, enable https checkmark, and then provide the login details. Nothing happens. Do I enter my local login details or my unraid.net login?

The user is always the root user+password combination. Including the Https:// shouldn't make a difference either way - if it continues to fail it may be worth checking your logs

Link to comment
  • 2 weeks later...

Hello, my dears,

after almost a year I thought I'd try again with the UnraidAPI. But unfortunately I still have no success.

I still get a 503 code on my one server, even though I've checked everything multiple times. Changed the root password multiple times. But nothing.

Then with my other server I don't get a code 503 but he probably can't even hear it see here

 

READY Server listening on http://0.0.0.0:80

Connected to mqtt broker
Get Dashboard Details for ip: 192.168.1.59 Failed with status code: undefined

connect ECONNREFUSED 192.168.1.59:80
Get VM Details for ip: 192.168.1.59 Failed

connect ECONNREFUSED 192.168.1.59:80
Get Docker Details for ip: 192.168.1.59 Failed

connect ECONNREFUSED 192.168.1.59:80
Get Main Details for ip: 192.168.1.59 Failed

I hope you can help me there.

Regards Maggi0r

 

Update: I was able to fix the error with errorconnectrefused. But now I always get the ERROR CODE 503. Have already changed the root password. Or do I have to reset the password via recovery?

Greetings Maggi

 

Edited by Maggi0r
Update
Link to comment
  • 3 weeks later...
On 10/11/2021 at 12:15 AM, okkies said:

Fresh install of the plugin - docker

fresh install of Homeassistant - docker

fresh install of MQTT - docker

 

only thing i get to see are the docker containers. 
yeN5v02.png

it wont show me the VM's 
However, when i go to the GUI, i see and interact with the VM's just fine

APWBLM1.png


im clueless, wtf is going on

MQTTlogs.txt 23.44 kB · 8 downloads

Any updates on that? i have the same problem.

i can use the vms over the api but none of them are topics inside of mqtt. 

Link to comment
  • 2 weeks later...
On 5/31/2022 at 11:54 AM, ElectricBrainUK said:

Yeah looks like there is a memory leak - unfortuantely I dont have the time to fix it. Happy to merge pull requests if someone else has the time to look into it.

 

still no time to fix your memory leak? 

that was may, now its september

 

i cant run this docker for more than 5 minutes without the memory leak locking up my unraid GUI.
 

Edited by TRusselo
Link to comment
  • 2 weeks later...

Does anyone else get this error on unraid 6.11 

 

Get VM Details for ip: https://192.168.*.* Failed
Cannot read properties of undefined (reading 'children')
Connected to mqtt broker
Get VM Details for ip: https://192.168.*.* Failed
Cannot read properties of undefined (reading 'children')
Connected to mqtt broker

 

and it keeps on repeating every second.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.