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

plugin won't start on my unraid #1

Closed
ziggyke opened this issue Nov 19, 2016 · 47 comments
Closed

plugin won't start on my unraid #1

ziggyke opened this issue Nov 19, 2016 · 47 comments

Comments

@ziggyke
Copy link

ziggyke commented Nov 19, 2016

Hi

First of all thanks for creating this plugin!
Second I want to try it out for the first time on my very first UnRAID installation, but according the log it would start except I can't get in the webUI...

I'm running UnRAID 6.2.4 (at the moment still in trial modus).
The plugin version of unBalanced is v1.8.0 and in the settings of unBalanced even if I set the option to enable the server to "Yes" still it won't work.

This is what I get in my log after enabling the plugin:

Nov 17 13:49:32 *** php: /usr/local/emhttp/plugins/unbalance/scripts/start
Nov 17 13:49:32 *** sudo:     root : TTY=unknown ; PWD=/usr/local/emhttp ; USER=nobody ; COMMAND=/bin/bash -c /usr/local/emhttp/plugins/unbalance/unbalance -port 6237
Nov 17 13:49:35 *** emhttp: cmd: /usr/local/emhttp/plugins/dynamix/scripts/tail_log syslog

Then I checked the permissions on the folder and files for unbalance and this is the output:

root@***:/usr/local/emhttp/plugins/unbalance# ls -al
total 7980
drwxr-xr-x  7  501 wheel     280 Nov 11 18:14 ./
drwxrwxrwx 36 root root      720 Nov 17 13:57 ../
-rw-r--r--  1  501 wheel   33487 Nov 11 18:14 CHANGES
-rw-r--r--  1  501 wheel     142 Nov 11 18:14 README.md
-rw-r--r--  1  501 wheel       6 Nov 11 18:14 VERSION
drwxr-xr-x  2  501 wheel      80 Nov 17 13:57 app/
drwxr-xr-x  2  501 wheel      80 Nov 17 13:57 event/
drwxr-xr-x  2  501 wheel      60 Nov 17 13:57 images/
drwxr-xr-x  2  501 wheel     240 Nov 17 13:57 img/
-rw-r--r--  1  501 wheel     666 Nov 11 18:14 index.html
drwxr-xr-x  2  501 wheel      80 Nov 17 13:57 scripts/
-rwxr-xr-x  1  501 wheel 7937102 Nov 11 18:14 unbalance*
-rw-r--r--  1  501 wheel    4030 Nov 11 18:14 unbalance.page
-rw-r--r--  1  501 wheel  179257 Nov 11 18:14 unbalance.png

To me that doesn't seem right, because user is set to "501" en group is set to "wheel".
Do I need and is it safe to chmod (755) and/or chown the unbalanced plugin folder and all the files inside to a "correct/known" user and/or group?

The following I've already tried, but all result into the same log:

  • Tried a different port to start the plugin
  • Tried a different user to start the plugin
  • Tried uninstalling and installing the plugin

I would like to take a look into the possibilities of this plugin, because now it seems to be doing nothing even if it is enabled.

What can I do to solve this issue and is this enough information to take a look into the problem or what information is needed to further look into this?

kind regards

kristof

@jbrodriguez
Copy link
Owner

jbrodriguez commented Nov 20, 2016

Hi @ziggyke even though the permissions seem a bit off, user, group and others have rights to read all the files and execute the unbalance binary. It doesn't seem like that should be an issue.

What's the log showing (/boot/logs/unbalance.log) ?

Ah I saw you mention the log shows the plugin as started.

If you go to http://<server address>:6237/, what does it show ?

There's been some reports in the past about ad-blockers not allowing access to some server pages (such as unbalance's).

Is it possible you have any router firewall rules blocking access ?

@ziggyke
Copy link
Author

ziggyke commented Nov 20, 2016

I don't have a dir called "logs" in the "boot" dir so can't see nor give you the output of this log.
I tried to find the log file, but got this output:

root@***:/# find / unbalance.log
... (searched every dir on my unRAID setup)
find: 'unbalance.log': No such file or directory

Yeah the log shows that it seems to be started, but the unRAID UI shows status: "Stopped".
Even in the process list I can't find anything that points towards that unbalanced is started.

So when I try to go to the unBalanced plugin webUI it gives me the output:
Site Unreachable/doesn't exist

I don't use a router nor firewall (software or hardware) with rules that block access to certain ports/addresses.

Thank you for taking a look into this.

@jbrodriguez
Copy link
Owner

Ok, try this ... from the server terminal

sudo -H -u nobody bash -c "/usr/local/emhttp/plugins/unbalance/unbalance -port 6237"

It should start and it should create a file /boot/logs/unbalance.log

You should also be able to browse to http://ip:6237 and get the plugin's interface.

Let me know how it goes.

@ziggyke
Copy link
Author

ziggyke commented Nov 20, 2016

thank you for the quick reply.
mmm... it doesn't create a log or do anything nor post a error/warning when doing the given terminal command.

@jbrodriguez
Copy link
Owner

mmm that's really strange ... can you post a screenshot ?

then try this ...

cd /usr/local/emhttp/plugins/unbalance
./unbalance -port 6237

@jbrodriguez
Copy link
Owner

@ziggyke I think I was able to reproduce the issue, I'm looking into it

@ziggyke
Copy link
Author

ziggyke commented Nov 20, 2016

Yeah I find it also bizar and strange.
Log from my terminal of output after doing the above 2 methods and checking if there is a log:

root@***:/boot# sudo -H -u nobody bash -c "/usr/local/emhttp/plugins/unbalance/unbalance -port 6237"
root@***:/boot# cd /usr/local/emhttp/plugins/unbalance/
root@***:/usr/local/emhttp/plugins/unbalance# ./unbalance -port 6237
root@***:/usr/local/emhttp/plugins/unbalance# ./unbalance -port 9292
root@***:/usr/local/emhttp/plugins/unbalance# ./unbalance -port 6237
root@***:/usr/local/emhttp/plugins/unbalance# ls -al /boot/
total 133440
drwxrwxrwx  7 root root     4096 Nov 20 10:26 ./
drwxrwxrwx 19 root root      420 Nov 18 14:13 ../
drwxrwxrwx  2 root root     4096 Nov  4 17:04 .preclear/
-rwxrwxrwx  1 root root  4092992 Nov  5 15:31 bzimage*
-rwxrwxrwx  1 root root 72526360 Nov  5 15:34 bzroot*
-rwxrwxrwx  1 root root 59585404 Nov  5 15:33 bzroot-gui*
-rwxrwxrwx  1 root root    22784 Nov  5 15:31 changes.txt*
drwxrwxrwx  7 root root     4096 Nov 20 18:02 config/
-r-xr-xr-x  1 root root   122308 Nov  4 12:30 ldlinux.c32*
-r-xr-xr-x  1 root root    69632 Nov  4 12:30 ldlinux.sys*
-rwxrwxrwx  1 root root     7959 Nov  5 15:31 license.txt*
-rwxrwxrwx  1 root root     1266 Nov  5 15:31 make_bootable.bat*
-rwxrwxrwx  1 root root     2913 Nov  2 10:03 make_bootable_linux*
-rwxrwxrwx  1 root root     1930 Nov  5 15:31 make_bootable_mac*
-rwxrwxrwx  1 root root   150024 Nov  5 15:31 memtest*
drwxrwxrwx  2 root root     4096 Nov 14 01:44 preclear_reports/
drwxrwxrwx  2 root root     4096 Nov  7 17:05 previous/
-rwxrwxrwx  1 root root    14322 Nov  4 17:04 readvz*
drwxrwxrwx  2 root root     4096 Nov  7 17:05 syslinux/
root@***:/usr/local/emhttp/plugins/unbalance#

Screenshot when trying to visit web (unfortunately it is in dutch):
schermafbeelding 2016-11-20 om 18 26 17

It basically says that the connection is refused by the server because of the unRAID server doesn't have a service running on port 6237...
I've the same website output when I turn off the plugin "Transmission".

@ziggyke
Copy link
Author

ziggyke commented Nov 20, 2016

Ah great to hear!
If you need logs or anything else from my side, I'll gladly help you with the necessary details you need.

@jbrodriguez
Copy link
Owner

Turns out I wasn't able to reproduce.

Not really sure what's the problem with the plugin in your server.

Try and change permissions and user/groups like you mentioned in your first post.

Below is how it's behaving in my server

This is /boot without a logs folder

root@wopr:/boot# ls -al
total 113928
drwxrwxrwx 11 root root     4096 Nov 20 13:23 ./
drwxr-xr-x 18 root root      380 Nov 20 12:51 ../
drwxrwxrwx  9 root root     4096 Nov 25  2015 backup/
-rwxrwxrwx  1 root root  3935392 Nov 17  2015 bzimage*
-rwxrwxrwx  1 root root 51421496 Nov 17  2015 bzroot*
-rwxrwxrwx  1 root root    13174 Nov 17  2015 changes.txt*
drwxrwxrwx  6 root root     4096 Nov 20 12:51 config/
drwxrwxrwx  8 root root     4096 Feb 18  2016 custom/
drwxrwxrwx  3 root root     4096 Nov 11  2015 docker/
-rwxrwxrwx  1 root root     2432 Nov 17  2015 install.txt*
-rwxrwxrwx  1 root root     7189 Nov 17  2015 license.txt*
-rwxrwxrwx  1 root root      942 Nov 17  2015 make_bootable.bat*
-rwxrwxrwx  1 root root     1872 Nov 17  2015 make_bootable_mac*
-rwxrwxrwx  1 root root   150024 Nov 17  2015 memtest*
drwxrwxrwx  2 root root     4096 Apr  2  2016 packages/
-rwxrwxrwx  1 root root    86964 Jun 19  2014 preclear_bjp.sh*
drwxrwxrwx  2 root root     4096 Nov 30  2015 preclear_reports/
drwxrwxrwx  2 root root     4096 Nov 27  2015 previous/
drwxrwxrwx  2 root root     4096 Aug 23  2014 syslinux/
drwxrwxrwx  2 root root     4096 Nov 17 20:51 tmp.logs/
root@wopr:/boot#

So I run the app

root@wopr:/boot# sudo -H -u nobody bash -c "/usr/local/emhttp/plugins/unbalance/unbalance -port 6237"
I: 2016/11/20 13:25:36 unbalance.go:29: unBALANCE v1.8.0-620.94a4a30 starting up ...
I: 2016/11/20 13:25:36 unbalance.go:39: Using config file /boot/config/plugins/unbalance/unbalance.conf ...
I: 2016/11/20 13:25:36 server.go:50: Starting service Server ...
I: 2016/11/20 13:25:36 server.go:67: Serving files from /usr/local/emhttp/plugins/unbalance
I: 2016/11/20 13:25:36 server.go:99: Server started listening on :6237
I: 2016/11/20 13:25:36 core.go:119: starting service Core ...
I: 2016/11/20 13:25:36 unbalance.go:49: Press Ctrl+C to stop ...
^CI: 2016/11/20 13:25:40 unbalance.go:53: Received signal: (interrupt) ... shutting down the app now ...
I: 2016/11/20 13:25:40 core.go:148: stopped service Core ...
I: 2016/11/20 13:25:40 server.go:104: stopped service Server ...
root@wopr:/boot#

It created the logs folder

root@wopr:/boot# ls -al
total 113932
drwxrwxrwx 12 root root     4096 Nov 20 13:25 ./
drwxr-xr-x 18 root root      380 Nov 20 12:51 ../
drwxrwxrwx  9 root root     4096 Nov 25  2015 backup/
-rwxrwxrwx  1 root root  3935392 Nov 17  2015 bzimage*
-rwxrwxrwx  1 root root 51421496 Nov 17  2015 bzroot*
-rwxrwxrwx  1 root root    13174 Nov 17  2015 changes.txt*
drwxrwxrwx  6 root root     4096 Nov 20 12:51 config/
drwxrwxrwx  8 root root     4096 Feb 18  2016 custom/
drwxrwxrwx  3 root root     4096 Nov 11  2015 docker/
-rwxrwxrwx  1 root root     2432 Nov 17  2015 install.txt*
-rwxrwxrwx  1 root root     7189 Nov 17  2015 license.txt*
drwxrwxrwx  2 root root     4096 Nov 20 13:25 logs/
-rwxrwxrwx  1 root root      942 Nov 17  2015 make_bootable.bat*
-rwxrwxrwx  1 root root     1872 Nov 17  2015 make_bootable_mac*
-rwxrwxrwx  1 root root   150024 Nov 17  2015 memtest*
drwxrwxrwx  2 root root     4096 Apr  2  2016 packages/
-rwxrwxrwx  1 root root    86964 Jun 19  2014 preclear_bjp.sh*
drwxrwxrwx  2 root root     4096 Nov 30  2015 preclear_reports/
drwxrwxrwx  2 root root     4096 Nov 27  2015 previous/
drwxrwxrwx  2 root root     4096 Aug 23  2014 syslinux/
drwxrwxrwx  2 root root     4096 Nov 17 20:51 tmp.logs/
root@wopr:/boot#

I checked the size of the executable from the terminal output you sent and it matches what I have

root@wopr:/boot# ls -al /usr/local/emhttp/plugins/unbalance
total 7988
drwxr-xr-x  7  501 games     300 Nov 20 13:16 ./
drwxr-xr-x 17 root root      340 Nov 20 12:51 ../
-rw-r--r--  1  501 games   30730 Jun  9 11:22 CHANGES
-rw-r--r--  1  501 games     142 Jun  9 11:22 README.md
-rw-r--r--  1  501 games       6 Jun  9 11:22 VERSION
drwxr-xr-x  2  501 games     120 Nov 20 13:16 app/
drwxr-xr-x  2  501 games      80 Nov 20 12:51 event/
drwxr-xr-x  2  501 games      60 Nov 20 12:51 images/
drwxr-xr-x  2  501 games     420 Nov 20 13:16 img/
-rw-r--r--  1  501 games     666 Nov 20 13:16 index.html
drwxr-xr-x  2  501 games      80 Nov 20 12:51 scripts/
-rwxr-xr-x  1  501 games 7937102 Nov 20 13:16 unbalance*
-rw-r--r--  1  501 games    4030 Jun  9 11:22 unbalance.page
-rw-r--r--  1  501 games  179257 Jun  9 11:22 unbalance.png

@ziggyke
Copy link
Author

ziggyke commented Nov 22, 2016

I've changed the permissions to 755 for the dir "unbalance" and the files within:

root@***:/usr/local/emhttp/plugins/unbalance# ls -al
total 7980
drwxr-xr-x  7 nobody nobody     280 Nov 11 18:14 ./
drwxr-xr-x 38 root   root       760 Nov 20 11:00 ../
-rwxr-xr-x  1 nobody nobody   33487 Nov 11 18:14 CHANGES*
-rwxr-xr-x  1 nobody nobody     142 Nov 11 18:14 README.md*
-rwxr-xr-x  1 nobody nobody       6 Nov 11 18:14 VERSION*
drwxr-xr-x  2 nobody nobody      80 Nov 17 13:57 app/
drwxr-xr-x  2 nobody nobody      80 Nov 17 13:57 event/
drwxr-xr-x  2 nobody nobody      60 Nov 17 13:57 images/
drwxr-xr-x  2 nobody nobody     240 Nov 17 13:57 img/
-rwxr-xr-x  1 nobody nobody     666 Nov 11 18:14 index.html*
drwxr-xr-x  2 nobody nobody      80 Nov 17 13:57 scripts/
-rwxr-xr-x  1 nobody nobody 7937102 Nov 11 18:14 unbalance*
-rwxr-xr-x  1 nobody nobody    4030 Nov 11 18:14 unbalance.page*
-rwxr-xr-x  1 nobody nobody  179257 Nov 11 18:14 unbalance.png*

I've also manually created the "logs" dir in the "boot" dir.

Still when I try to start by command line or trough the webGUI of unRAID the status stays stopped and nothing is started...

Can it be that a plugin/docker is conflicting with your plugin?
List of plugins with all on there default settings and up-to-date:
CA AutoUpdate Plugins
CA Backup / Restore Appdata
CA Cleanup Appdata
Community Applications
CouchPotato -> Not running/started/enabled
Docker Buttons
Dynamix Date Time
Dynamix Local Master
Dynamix Schedules
Dynamix SCSI Devices
Dynamix System Buttons
Dynamix System Statistics
Dynamix webGui
Enhanced Log Viewer
Fix Common Problems
Headphones -> Not running/started/enabled
IPMI support
Nerd Tools
Open Files
Plex Media Server -> Not running/started/enabled
Preclear Disks
Server Layout
SickRage -> Not running/started/enabled
Sonarr
ssh Plugin
Tips and Tweaks
Transmission
Unassigned Devices
unBALANCE
unRAID Server OS

List of dockers:
schermafbeelding 2016-11-22 om 08 42 00

Further nothing can be found in the logs of unRAID what the plugin is doing or why it won't start...

@jbrodriguez
Copy link
Owner

@ziggyke I don't have too many more ideas ... last thing I can think of is create a /boot/config/plugins/unbalance folder, start the app, see if it works.
If that fails create a /boot/config/plugins/unbalance/unbalance.conf file (it should be fine empty), start the app, see if it works.

I had replicated the behaviour (not starting), but only when running on my mac, which doesn't have the same filesystem structure as unRAID, so it wasn't a proper test.

It's baffling, I will say that.

@ziggyke
Copy link
Author

ziggyke commented Nov 23, 2016

that folder is created correctly and also a config is present in that folder when installing the plugin, so I'm not sure if that would solve the problem. When I get home I'll try to perform this test.

Aha that maybe a direction to a solution...
I'm not using the standard filesystem: XFS, but I'm using BTRFS as my main filesystem for my unRAID setup.

Also on the forum there are 2 other people who are mentioning to having this problem.

@ZataH
Copy link

ZataH commented Nov 23, 2016

I am one of the others with the problem.
Tried to reinstall several times.
Nothing happens when i issue the command manually. Logs are never created, and no output from shell.

I am running XFS as filesystem.
Tried to remove some plugins, which was the same as ziggy, but no change.

/boot/config/plugins/unbalance# ls -al
total 3328
drwxrwxrwx  2 root root    8192 Nov 23 23:52 ./
drwxrwxrwx 24 root root    8192 Nov 23 23:55 ../
-rwxrwxrwx  1 root root 3379598 Nov 11 18:28 unbalance-1.8.0.tgz*
-rwxrwxrwx  1 root root      43 Nov 23 23:56 unbalance.cfg*
/usr/local/emhttp/plugins/unbalance# ls -al
total 7980
drwxr-xr-x  7  501 wheel     280 Nov 11 18:14 ./
drwxr-xr-x 28 root root      560 Oct 24 09:14 ../
-rw-r--r--  1  501 wheel   33487 Nov 11 18:14 CHANGES
-rw-r--r--  1  501 wheel     142 Nov 11 18:14 README.md
-rw-r--r--  1  501 wheel       6 Nov 11 18:14 VERSION
drwxr-xr-x  2  501 wheel      80 Nov 23 23:49 app/
drwxr-xr-x  2  501 wheel      80 Nov 23 23:49 event/
drwxr-xr-x  2  501 wheel      60 Nov 23 23:49 images/
drwxr-xr-x  2  501 wheel     240 Nov 23 23:49 img/
-rw-r--r--  1  501 wheel     666 Nov 11 18:14 index.html
drwxr-xr-x  2  501 wheel      80 Nov 23 23:49 scripts/
-rwxr-xr-x  1  501 wheel 7937102 Nov 11 18:14 unbalance*
-rw-r--r--  1  501 wheel    4030 Nov 11 18:14 unbalance.page
-rw-r--r--  1  501 wheel  179257 Nov 11 18:14 unbalance.png

@ZataH
Copy link

ZataH commented Nov 23, 2016

One thing there could be an issue regarding starting it from settings, is that it seems like it is clearing the .cfg after a few seconds
This is from syslog, when i try to start it:

Nov 24 00:04:42 HOMESRV php: /usr/local/emhttp/plugins/unbalance/scripts/start
Nov 24 00:04:42 HOMESRV sudo:     root : TTY=unknown ; PWD=/usr/local/emhttp ; USER=nobody ; COMMAND=/bin/bash -c /usr/local/emhttp/plugins/unbalance/unbalance -port 6237

@tobytl
Copy link

tobytl commented Nov 24, 2016

TL;DR: Make sure you have an "unbalance.conf" not just an "unbalance.cfg", different files there. A simple touch can fix it.
# touch /boot/config/plugins/unbalance/unbalance.conf

So, I'm an idiot... I had this problem too. Sat here looking at the code, trying to figure out whats happening (saw it, btw, just didn't think it was a showstopper). Finally decided to run an strace.... And, it can't open the config file and exits with code 2. Looks familiar, that's what should happen with flag.Parse() if it's error handling is set to exitonerror, except the default is to continue on error (or it is supposed to be?) and I couldn't see a place where you changed it. But ah well, exit(2) when the config file can't be read none the less.

@ZataH
Copy link

ZataH commented Nov 24, 2016

Nice :) That did the trick

root@HOMESRV:~# touch /boot/config/plugins/unbalance/unbalance.conf

root@HOMESRV:/usr/local/emhttp/plugins/unbalance# sudo -H -u nobody bash -c "/usr/local/emhttp/plugins/unbalance/unbalance -port 6237"
I: 2016/11/24 10:02:14 unbalance.go:29: unBALANCE v1.8.0-617.8f6eba1 starting up ...
I: 2016/11/24 10:02:14 unbalance.go:39: Using config file /boot/config/plugins/unbalance/unbalance.conf ...
I: 2016/11/24 10:02:14 server.go:50: Starting service Server ...
I: 2016/11/24 10:02:14 server.go:67: Serving files from /usr/local/emhttp/plugins/unbalance
I: 2016/11/24 10:02:14 server.go:99: Server started listening on :6237
I: 2016/11/24 10:02:14 core.go:119: starting service Core ...

And now the web ui works

@ZataH
Copy link

ZataH commented Nov 24, 2016

The webui link on the settings page, does not work though. Its just getting me a blank about page

@ziggyke
Copy link
Author

ziggyke commented Nov 24, 2016

@ziggyke I don't have too many more ideas ... last thing I can think of is create a /boot/config/plugins/unbalance folder, start the app, see if it works.
If that fails create a /boot/config/plugins/unbalance/unbalance.conf file (it should be fine empty), start the app, see if it works.

I had replicated the behaviour (not starting), but only when running on my mac, which doesn't have the same filesystem structure as unRAID, so it wasn't a proper test.

It's baffling, I will say that.

That did the trick!!
But why does the plugin install doesn't create the correct conf file?
Because after installation there is a unbalance.cfg file created and nothing else.

root@***:/boot/config/plugins/unbalance# ls -al
total 3320
drwxrwxrwx  2 root root    4096 Nov 22 09:41 ./
drwxrwxrwx 32 root root    8192 Nov 22 09:41 ../
-rwxrwxrwx  1 root root 3379598 Nov 11 18:28 unbalance-1.8.0.tgz*
-rwxrwxrwx  1 root root      45 Nov 22 09:42 unbalance.cfg*

Maybe you can update the plugin that it also creates the unbalance.conf so that this should stop it from not starting.
WebUI works but indeed not from the link on the settingspage of the plugin.
It's just creates a new tabbed window.

@jbrodriguez
Copy link
Owner

hi @ziggyke @ZataH @tobytl I'm really glad the root cause was finally found.

Thanks @tobytl for the analysis, I'll have to learn a bit more about strace.

I actually see an error now in the plugin template .. it tries to create unbalance.cfg instead of unbalance.conf.

I'll fix that and it should start working normally again (hopefully).

I will also revise the flag parsing logic ... it should catch that error anyway.

Thanks a lot to all for helping me figure this out ! I really appreciate it.

@ZataH
Copy link

ZataH commented Nov 24, 2016

@jbrodriguez Most importanly we found the cause :)
Will you release a new version, or just update the plugin file?

@jbrodriguez
Copy link
Owner

@ZataH I'll release a new version, since the source for all the components (server, client and plugin code) is contained in a single repo.

I'll try to release it later today or tomorrow at the latest

@ziggyke
Copy link
Author

ziggyke commented Nov 24, 2016

maybe a possible solution to implement.
Using the following files:
unbalance.cfg -> for saving settings from the plugin within unRAID GUI
webgui.cfg or webuig.conf -> for saving settings for the unbalance plugin itself from within the webGUI.

This to overcome this fault in the future and make it more visible for others what conf file is for what?

Thanks for updating this and searching with me to solve the issue.

@jbrodriguez
Copy link
Owner

@ziggyke it's a good idea but it would take a "non-zero" (tm) amount of effort to implement :)

unbalance.conf should really be transparent to the user, it shouldn't be touched directly.

I think the changes I'll be making should prevent further recurrence of this issue.

@ziggyke
Copy link
Author

ziggyke commented Nov 24, 2016

ok fair enough.

@ZataH
Copy link

ZataH commented Nov 24, 2016

Hmm it is still not working. It is creating the .conf file now though. But I have no idea why it is not working

root@HOMESRV:/boot/config/plugins/unbalance# ls -ll
total 3320
-rwxrwxrwx 1 root root 3379980 Nov 24 21:52 unbalance-1.8.1.tgz*
-rwxrwxrwx 1 root root      32 Nov 24 23:59 unbalance.cfg*
-rwxrwxrwx 1 root root      45 Nov 24 23:59 unbalance.conf*

no logs in /boot/logs

Tried to remove and reinstall the plugin several times

:/boot/logs# sudo -H -u nobody bash -c "/usr/local/emhttp/plugins/unbalance/unbalance -port 6237"
configuration variable provided but not defined: SERVICE
Usage of /usr/local/emhttp/plugins/unbalance/unbalance:
  -apiFolders="/var/local/emhttp": folders to look for api endpoints
  -config="": config location
  -dryRun=true: perform a dry-run rather than actual work
  -folders="": folders that will be scanned for media
  -log="/boot/logs/unbalance.log": pathname where log file will be written to
  -notifyCalc=0: notify via email after calculation operation has completed (unraid notifications must be set up first): 0 - No notifications; 1 - Simple notifications; 2 - Detailed notifications
  -notifyMove=0: notify via email after move operation has completed (unraid notifications must be set up first): 0 - No notifications; 1 - Simple notifications; 2 - Detailed notifications
  -port="6237": port to run the server
  -rsyncFlags="": custom rsync flags

But still nothing when i try to reach the address

@jbrodriguez
Copy link
Owner

Thanks @ZataH I actually failed to add some flags on the server side of the code.

And turns out there were many other instances of unbalance.cfg I had to replace 😳

@ziggyke
Copy link
Author

ziggyke commented Nov 25, 2016

I've updated the unbalance plugin and it behaved the same way as before, still everything was in place and should be fine.

I needed to re-install the plugin and know everything is working again.
Just wanted to mention this, no big deal for me.

Thanks for the quick fix although!

@ZataH
Copy link

ZataH commented Nov 25, 2016

Just tried to reinstall it @jbrodriguez and both the server and webui button are working now :) Thanks

@ziggyke
Copy link
Author

ziggyke commented Nov 25, 2016

mmm on second though I needed to reboot server, because I bougth unRAID Basic key.
Now plugin won't start anymore and giving me this error:

root@***:/usr/local/emhttp/plugins/unbalance# ./unbalance -PORT 6237
invalid boolean value "\"1\"" for configuration variable dryRun: strconv.ParseBool: parsing "\"1\"": invalid syntax

If I do it like you described previously then it gives also an error that flag isn't defined:

root@***:/usr/local/emhttp/plugins/unbalance# ./unbalance -port 6237
flag provided but not defined: -port
Usage of ./unbalance:
  -PORT="6237": port to run the server
  -RUNAS="nobody": which users should own the plugin process
  -SERVICE="disable": which state should the plugin start in
  -apiFolders="/var/local/emhttp": folders to look for api endpoints
  -config="": config location
  -dryRun=true: perform a dry-run rather than actual work
  -folders="": folders that will be scanned for media
  -log="/boot/logs/unbalance.log": pathname where log file will be written to
  -notifyCalc=0: notify via email after calculation operation has completed (unraid notifications must be set up first): 0 - No notifications; 1 - Simple notifications; 2 - Detailed notifications
  -notifyMove=0: notify via email after move operation has completed (unraid notifications must be set up first): 0 - No notifications; 1 - Simple notifications; 2 - Detailed notifications
  -rsyncFlags="": custom rsync flags

I noticed that there isn't a unbalance.cfg anymore, so I created it:

root@***:/boot/config/plugins/unbalance# ls -al
total 3320
drwxrwxrwx  2 root root    4096 Nov 25 09:52 ./
drwxrwxrwx 32 root root    8192 Nov 25 08:43 ../
-rwxrwxrwx  1 root root 3380792 Nov 25 00:45 unbalance-1.8.2.tgz*
-rwxrwxrwx  1 root root     112 Nov 25 10:45 unbalance.conf*
root@***:/boot/config/plugins/unbalance# touch unbalance.cfg
root@***:/boot/config/plugins/unbalance# ls -al
total 3320
drwxrwxrwx  2 root root    4096 Nov 25 10:51 ./
drwxrwxrwx 32 root root    8192 Nov 25 08:43 ../
-rwxrwxrwx  1 root root 3380792 Nov 25 00:45 unbalance-1.8.2.tgz*
-rwxrwxrwx  1 root root       0 Nov 25 10:51 unbalance.cfg*
-rwxrwxrwx  1 root root     112 Nov 25 10:45 unbalance.conf*

But even after that still starting the plugin provides the same error as mentioned in the beginning of my comment.

The unbalance log gives this error:

W: 2016/11/25 09:05:59 server.go:284: closing socket (&{id: ws:0xc4200a23f0 onMessage:0x473180 onClose:0x4731d0}): EOF
I: 2016/11/25 09:06:00 unraid.go:391: Unraid Box Condition: &{NumDisks:3 NumProtected:0 Synced:2016-11-17 10:06:10 +0100 CET SyncErrs:0 Resync:0 ResyncPos:0 State:STARTED Size:3640738750464 Free:1997161775104 NewFree:1997161775104}
I: 2016/11/25 09:06:00 unraid.go:392: Unraid Box SourceDiskName:
I: 2016/11/25 09:06:00 unraid.go:393: Unraid Box BytesToMove: 0
I: 2016/11/25 09:06:00 unraid.go:404: Id(2); Name(disk2); Path(/mnt/disk2); Device(sdc); Type(Data); FsType(btrfs); Free(465.3G); NewFree(465.3G); Size(1.8T); Serial(TOSHIBA_DT01ACA200_25QDV1PAS); Status(DISK_OK); Bin(<nil>)
I: 2016/11/25 09:06:00 unraid.go:404: Id(3); Name(disk3); Path(/mnt/disk3); Device(sde); Type(Data); FsType(btrfs); Free(804.6G); NewFree(804.6G); Size(931.5G); Serial(Hitachi_HDT721010SLA360_STF605MH2DVAJK); Status(DISK_OK); Bin(<nil>)
I: 2016/11/25 09:06:00 unraid.go:404: Id(30); Name(cache); Path(/mnt/cache); Device(sdd); Type(Cache); FsType(btrfs); Free(590.1G); NewFree(590.1G); Size(596.2G); Serial(WDC_WD6400AAKS-00A7B0_WD-WCASY1477798); Status(DISK_OK); Bin(<nil>)
I: 2016/11/25 09:06:00 core.go:164: Sending config
W: 2016/11/25 09:06:22 server.go:284: closing socket (&{id: ws:0xc4200a2120 onMessage:0x473180 onClose:0x4731d0}): EOF
I: 2016/11/25 09:06:38 unbalance.go:53: Received signal: (terminated) ... shutting down the app now ...
I: 2016/11/25 09:06:38 core.go:148: stopped service Core ...
I: 2016/11/25 09:06:38 server.go:104: stopped service Server ...

@jbrodriguez
Copy link
Owner

I honestly don't know how the settings/flags system has been "working" since I changed from docker to plugin :)

@ziggyke,

You should use PORT not port.

Can you show me your unbalance.conf ?

@ziggyke
Copy link
Author

ziggyke commented Nov 25, 2016

right forgot to post it.
Here is the unbalance.conf file:

folders="0"
dryRun="1"
notifyCalc="2"
notifyMove="2"
rsyncFlags="0"
SERVICE="enable"
PORT="6237"
RUNAS="nobody"

which the plugin itself had created, because when uninstalling the plugin it deletes everything (config, logs, plugin itself) which is a good thing!

@jbrodriguez
Copy link
Owner

Well, turns out 1.8.0 used unbalance.cfg for the plugin system and unbalance.conf for the unbalance settings ... just what you had mentioned @ziggyke

What I did now, was to account for /boot/config/plugins/unbalance/unbalance.conf possibly not being present and handle accordingly.

I think this will fix the issue.

@ziggyke your unbalance.conf is corrupt, you need to delete it and install 1.8.3

@ziggyke
Copy link
Author

ziggyke commented Nov 25, 2016

I removed the plugin again and yaj! It's working again!
héhé, awesome that you can solve/fix it so fast.

@jbrodriguez
Copy link
Owner

that's good to know !

@ziggyke
Copy link
Author

ziggyke commented Nov 25, 2016

@jbrodriguez you probably can add milestone (as off 1.8.3) to this issue and close it as solved.
So it keeps clean and easy manageable from your end to track any issues.

@jbrodriguez
Copy link
Owner

sure I don't have milestones, but I'll close the issue 👍

@fithwum
Copy link

fithwum commented Mar 17, 2018

i have a strange problem trying to start unbalance and i have no idea why it is happening

LOG
"I: 2018/03/13 09:25:07 app.go:51: unbalance v5.0.0-1042-b4a3ac6-v2018.02.27 starting ...
I: 2018/03/13 09:25:07 app.go:59: No config file specified. Using app defaults ...
I: 2018/03/13 09:25:07 server.go:54: Starting service Server ...
I: 2018/03/13 09:25:07 server.go:71: Serving files from /usr/local/emhttp/plugins/unbalance
I: 2018/03/13 09:25:07 server.go:129: Server started listening https on :6237
I: 2018/03/13 09:25:07 array.go:45: starting service Array ...
I: 2018/03/13 09:25:07 planner.go:50: starting service Planner ...
I: 2018/03/13 09:25:07 core.go:98: starting service Core ...
W: 2018/03/13 09:25:07 shell.go:51: Refresh error::(df: /mnt/cache-43cd55500255: No such file or directory
)
W: 2018/03/13 09:25:07 shell.go:99: Refresh error:: waitError: signal: broken pipe
F: 2018/03/13 09:25:07 app.go:71: signal: broken pipe
I: 2018/03/17 09:16:18 app.go:51: unbalance v5.0.0-1042-b4a3ac6-v2018.02.27 starting ...
I: 2018/03/17 09:16:18 app.go:59: No config file specified. Using app defaults ...
I: 2018/03/17 09:16:18 server.go:54: Starting service Server ...
I: 2018/03/17 09:16:18 server.go:71: Serving files from /usr/local/emhttp/plugins/unbalance
I: 2018/03/17 09:16:18 server.go:129: Server started listening https on :6237
I: 2018/03/17 09:16:18 array.go:45: starting service Array ...
I: 2018/03/17 09:16:18 planner.go:50: starting service Planner ...
I: 2018/03/17 09:16:18 core.go:98: starting service Core ...
W: 2018/03/17 09:16:18 shell.go:51: Refresh error::(df: /mnt/cache-43cd55500255: No such file or directory
)
W: 2018/03/17 09:16:18 shell.go:99: Refresh error:: waitError: exit status 1
F: 2018/03/17 09:16:18 app.go:71: exit status 1
I: 2018/03/17 09:17:56 app.go:51: unbalance v5.0.0-1042-b4a3ac6-v2018.02.27 starting ...
I: 2018/03/17 09:17:56 app.go:59: No config file specified. Using app defaults ...
I: 2018/03/17 09:17:56 server.go:54: Starting service Server ...
I: 2018/03/17 09:17:56 server.go:71: Serving files from /usr/local/emhttp/plugins/unbalance
I: 2018/03/17 09:17:56 server.go:129: Server started listening https on :6237
I: 2018/03/17 09:17:56 array.go:45: starting service Array ...
I: 2018/03/17 09:17:56 planner.go:50: starting service Planner ...
I: 2018/03/17 09:17:56 core.go:98: starting service Core ...
W: 2018/03/17 09:17:56 shell.go:51: Refresh error::(df: /mnt/cache-43cd55500255: No such file or directory
)
W: 2018/03/17 09:17:56 shell.go:99: Refresh error:: waitError: signal: broken pipe
F: 2018/03/17 09:17:56 app.go:71: signal: broken pipe
I: 2018/03/17 09:19:34 app.go:51: unbalance v5.0.0-1042-b4a3ac6-v2018.02.27 starting ...
I: 2018/03/17 09:19:34 app.go:59: No config file specified. Using app defaults ...
I: 2018/03/17 09:19:34 server.go:54: Starting service Server ...
I: 2018/03/17 09:19:34 server.go:71: Serving files from /usr/local/emhttp/plugins/unbalance
I: 2018/03/17 09:19:34 server.go:129: Server started listening https on :6237
I: 2018/03/17 09:19:34 array.go:45: starting service Array ...
I: 2018/03/17 09:19:34 planner.go:50: starting service Planner ...
I: 2018/03/17 09:19:34 core.go:98: starting service Core ...
W: 2018/03/17 09:19:34 shell.go:51: Refresh error::(df: /mnt/cache-43cd55500255: No such file or directory
)
W: 2018/03/17 09:19:34 shell.go:99: Refresh error:: waitError: exit status 1
F: 2018/03/17 09:19:34 app.go:71: exit status 1
I: 2018/03/17 09:20:02 app.go:51: unbalance v5.0.0-1042-b4a3ac6-v2018.02.27 starting ...
I: 2018/03/17 09:20:02 app.go:59: No config file specified. Using app defaults ...
I: 2018/03/17 09:20:02 server.go:54: Starting service Server ...
I: 2018/03/17 09:20:02 server.go:71: Serving files from /usr/local/emhttp/plugins/unbalance
I: 2018/03/17 09:20:02 server.go:129: Server started listening https on :6237
I: 2018/03/17 09:20:02 array.go:45: starting service Array ...
I: 2018/03/17 09:20:02 planner.go:50: starting service Planner ...
I: 2018/03/17 09:20:02 core.go:98: starting service Core ...
W: 2018/03/17 09:20:02 shell.go:51: Refresh error::(df: /mnt/cache-43cd55500255: No such file or directory
)
W: 2018/03/17 09:20:02 shell.go:99: Refresh error:: waitError: signal: broken pipe
F: 2018/03/17 09:20:02 app.go:71: signal: broken pipe
I: 2018/03/17 09:23:22 app.go:51: unbalance v5.0.0-1042-b4a3ac6-v2018.02.27 starting ...
I: 2018/03/17 09:23:22 app.go:59: No config file specified. Using app defaults ...
I: 2018/03/17 09:23:22 server.go:54: Starting service Server ...
I: 2018/03/17 09:23:22 server.go:71: Serving files from /usr/local/emhttp/plugins/unbalance
I: 2018/03/17 09:23:22 server.go:129: Server started listening https on :6237
I: 2018/03/17 09:23:22 array.go:45: starting service Array ...
I: 2018/03/17 09:23:22 planner.go:50: starting service Planner ...
I: 2018/03/17 09:23:22 core.go:98: starting service Core ...
W: 2018/03/17 09:23:22 shell.go:99: Refresh error:: waitError: signal: broken pipe
F: 2018/03/17 09:23:22 app.go:71: signal: broken pipe
I: 2018/03/17 09:39:11 app.go:51: unbalance v5.0.0-1042-b4a3ac6-v2018.02.27 starting ...
I: 2018/03/17 09:39:11 app.go:59: No config file specified. Using app defaults ...
I: 2018/03/17 09:39:11 server.go:54: Starting service Server ...
I: 2018/03/17 09:39:11 server.go:71: Serving files from /usr/local/emhttp/plugins/unbalance
I: 2018/03/17 09:39:11 server.go:129: Server started listening https on :6237
I: 2018/03/17 09:39:11 array.go:45: starting service Array ...
I: 2018/03/17 09:39:11 planner.go:50: starting service Planner ...
I: 2018/03/17 09:39:11 core.go:98: starting service Core ...
W: 2018/03/17 09:39:11 shell.go:51: Refresh error::(df: /mnt/cache-43cd55500255: No such file or directory
)
W: 2018/03/17 09:39:11 shell.go:99: Refresh error:: waitError: signal: broken pipe
F: 2018/03/17 09:39:11 app.go:71: signal: broken pipe
"

@jbrodriguez
Copy link
Owner

jbrodriguez commented Mar 17, 2018

Never saw this error before, it's quite unusual.

I guess that you can see your array normally from the unRAID webGUI right ?

Can you do

$ df --block-size=1 /mnt/*

What does it return ?

@fithwum
Copy link

fithwum commented Mar 17, 2018

untitled

this is what it gave me

@jbrodriguez
Copy link
Owner

I don't know what those cache/socket/tmp files/folders are ... if someone with more linux knowledge can weigh in, I'd appreciate it.

In the meantime, let me give this some thought.

@fithwum
Copy link

fithwum commented Mar 17, 2018

yea i have no idea what they are or why they are there but they have been there for a while now

@jbrodriguez
Copy link
Owner

unBALANCE fails due to these 'pseudo'-folders.

I'm not sure where they come from, I'll do some research

@fithwum
Copy link

fithwum commented Mar 17, 2018

i am also still on unraid 6.4.1 with 6.5 waiting to install also i have a dyeing drive in my array that i cant do anything about until next week

@fithwum
Copy link

fithwum commented Mar 23, 2018

so i still have no idea what happened as far as the phantom folders but after updating to unraid 6.5.0 everything seems fine. could have been a problem with the last update or the dying drive that is not gone and a new one in its place.

@jbrodriguez
Copy link
Owner

Hey, that's good to know !

Glad it's working now.

@wuast94
Copy link

wuast94 commented Sep 3, 2018

I have the same issue .. nothing above helped. i would start it per command line and see that a nother file is missing in conf dir: unbalance.hist .. so i created it and no he says EOF (end of file?)

"netstat -an | grep LISTENING" is also not showing this port

log file: I: 2018/09/03 02:15:41 app.go:51: unbalance v5.2.1-1075-77e21d9-v2018.06.05 starting ...
I: 2018/09/03 02:15:41 app.go:59: No config file specified. Using app defaults ...
I: 2018/09/03 02:15:41 server.go:54: Starting service Server ...
I: 2018/09/03 02:15:41 server.go:71: Serving files from /usr/local/emhttp/plugins/unbalance
I: 2018/09/03 02:15:41 server.go:130: Server started listening https on :6237
I: 2018/09/03 02:15:41 array.go:46: starting service Array ...
I: 2018/09/03 02:15:41 planner.go:52: starting service Planner ...
I: 2018/09/03 02:15:41 core.go:101: starting service Core ...
W: 2018/09/03 02:15:41 core.go:116: Unable to read history: open /boot/config/plugins/unbalance/unbalance.hist: no such file or directory
I: 2018/09/03 02:15:41 app.go:73: Press Ctrl+C to stop ...

@jbrodriguez
Copy link
Owner

delete unbalance.hist
change http to https in the browser address

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

6 participants