OpenMediaVault-Plugin-Developers / openmediavault-flashmemory

OpenMediaVault plugin for folder2ram
25 stars 6 forks source link

installation error #24

Closed happyreacer closed 4 years ago

happyreacer commented 4 years ago

I install the flashmemoryplugin over the webgui. On the installation it throw it out from the webgui to the loginside. I cant login anymore. i see on my omv system the error [450.125706] tmpfs: Unknown parameter '#keep_folder_strukture folder2ram does not have an equivalent yet

ryecoaaron commented 4 years ago

I think the folder2ram update not the plugin is causing this. I will have to check it out. it hasn’t blocked me from the web interface though.

happyreacer commented 4 years ago

even after uninstalling via ssh and the apt-get remove openmediavault-flashmemory I still cannot log in to the web interface btw i have already cleaned my browsercache

Trottel commented 4 years ago

Same situation here. After flashmemory and folder2ram plugins update, I can't login to web interface.

adiulalam commented 4 years ago

same here, tried (sudo apt-get --purge remove openmediavault-flashmemory) but does not work

ryecoaaron commented 4 years ago

“does not work” doesn’t help. I’m not near a computer. So people will just have to be patient.

happyreacer commented 4 years ago

So people will just have to be patient.

@ryecoaaron No problem, I'll wait and be glad I'm not alone

ryecoaaron commented 4 years ago

I pulled the update. Have you rebooted? What version of OMV? I just painfully tried this from my phone and had no problems on OMV 5.

ryecoaaron commented 4 years ago

folder2ram -disablesystemd folder2ram -unmountall

might help if you can't uninstall.

adiulalam commented 4 years ago

OMV5, rebooted and tried to reinstall, still same issue

ryecoaaron commented 4 years ago

other commands?

apt-get install folder2ram=0.3.1

This is from memory so you might need to do some thinking

yllekz commented 4 years ago

Chiming in here because this seems to have nuked my OMV web interface and now I can't log in nor update anything.

1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] y
Setting up openmediavault-flashmemory (5.0.6) ...
/usr/lib/python3/dist-packages/salt/utils/path.py:265: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated, and in 3.8 it will stop working
  if not isinstance(exes, collections.Iterable):
raspberrypi:

----------
          ID: configure_rrd_dir
    Function: file.directory
        Name: /var/lib/openmediavault/rrd
      Result: True
     Comment: The directory /var/lib/openmediavault/rrd is in the correct state
     Started: 20:26:40.469922
    Duration: 13.785 ms
     Changes:
----------
          ID: configure_samba_dir
    Function: file.directory
        Name: /var/cache/samba
      Result: True
     Comment: The directory /var/cache/samba is in the correct state
     Started: 20:26:40.484001
    Duration: 1.745 ms
     Changes:
----------
          ID: configure_folder2ram_dir
    Function: file.directory
        Name: /etc/folder2ram
      Result: True
     Comment: The directory /etc/folder2ram is in the correct state
     Started: 20:26:40.486001
    Duration: 1.63 ms
     Changes:
----------
          ID: configure_flashmemory
    Function: file.managed
        Name: /etc/folder2ram/folder2ram.conf
      Result: True
     Comment: File /etc/folder2ram/folder2ram.conf is in the correct state
     Started: 20:26:40.487880
    Duration: 64.421 ms
     Changes:
----------
          ID: remove_cron_apt_file
    Function: file.absent
        Name: /etc/cron-apt/action.d/3-download
      Result: True
     Comment: File /etc/cron-apt/action.d/3-download is not present
     Started: 20:26:40.552649
    Duration: 5.412 ms
     Changes:
----------
          ID: folder2ram_enable_systemd
    Function: cmd.run
        Name: /usr/sbin/folder2ram -enablesystemd
      Result: False
     Comment: Command "/usr/sbin/folder2ram -enablesystemd" run
     Started: 20:26:40.559859
    Duration: 16.726 ms
     Changes:
              ----------
              pid:
                  1991
              retcode:
                  127
              stderr:
                  /bin/bash: /usr/sbin/folder2ram: No such file or directory
              stdout:
----------
          ID: folder2ram_mountall
    Function: cmd.run
        Name: /usr/sbin/folder2ram -mountall
      Result: False
     Comment: Command "/usr/sbin/folder2ram -mountall" run
     Started: 20:26:40.577161
    Duration: 13.744 ms
     Changes:
              ----------
              pid:
                  1992
              retcode:
                  127
              stderr:
                  /bin/bash: /usr/sbin/folder2ram: No such file or directory
              stdout:
`
Summary for raspberrypi
------------
Succeeded: 5 (changed=2)
Failed:    2
------------
Total states run:     7
Total run time: 117.463 ms
Mamitose commented 4 years ago

I was able to get logged back in by adding write permissions to /var/lib/php/sessions folder and then a nginx -s reload Its not permanent and a reboot will lock you out again so I had to remove the plugin and now its fine.

yllekz commented 4 years ago

I was able to get logged back in by adding write permissions to /var/lib/php/sessions folder and then a nginx -s reload Its not permanent and a reboot will lock you out again so I had to remove the plugin and now its fine.

[solved, see below] ~~Do you mind sharing the command you used to do the write permission adjustment? I tried sudo chmod +rwx /var/lib/php/sessions but that doesn't seem to have done anything.~~

Mamitose commented 4 years ago

I was able to get logged back in by adding write permissions to /var/lib/php/sessions folder and then a nginx -s reload Its not permanent and a reboot will lock you out again so I had to remove the plugin and now its fine.

Do you mind sharing the command you used to do the write permission adjustment? I tried sudo chmod +rwx /var/lib/php/sessions but that doesn't seem to have done anything.

I tried doing the same and it didn't work for me so I had to use WinSCP and change the permissions from the properties of the folder.

yllekz commented 4 years ago

got it, even WinSCP denied me. I had to delete and recreate it using mkdir:

sudo rm -rf /var/lib/php/sessions
sudo mkdir -m 777 /var/lib/php/sessions
ls /var/lib/php -l
sudo nginx -s reload

Then the web interface started working for me. Like you said though, it might only be temporary.

Went to plugins, found openmediavault-flashmemory 5.0.6 and uninstalled it.

Rebooted the Pi and the web interface still works.

Now for getting the plugin reinstalled....Now that the web interface works again I can wait for the permanent solution...

ryecoaaron commented 4 years ago

I didn’t test on an rpi and of course, that always bites me. grrr. did anyone try the disable commands??!

bobafetthotmail commented 4 years ago

folder2ram script is in /sbin/folder2ram, while the plugin is calling it from /usr/sbin/folder2ram and obviously this returns an error. /usr/sbin/folder2ram: No such file or directory see here for the file where that is defined https://github.com/OpenMediaVault-Plugin-Developers/openmediavault-flashmemory/blob/master/srv/salt/omv/deploy/flashmemory/default.sls

Also the error at the first post is a comment in the folder2ram config file. [450.125706] tmpfs: Unknown parameter '#keep_folder_strukture folder2ram does not have an equivalent yet

makes me think that the same file I linked above is not generating a correct config file for folder2ram, as now what is a comment in that file is used as mount option for the tmpfs and this of course results in error and nothing is mounted.

OMV web interface fails to run if it does not find some of the folders defined in this plugin, I think the "/var/lib/php" folder is the one, as also confirmed by others above.

It might be worth removing it from the list so possible future issues won't block the web interface, afaik the main writes happen in the /var/lib/rrdcached/ and /var/lib/openmediavault/rrd anyway (the statistic databases for the performance graphs are stored there, and updated every few seconds)

ryecoaaron commented 4 years ago

folder2ram script is in /sbin/folder2ram, while the plugin is calling it from /usr/sbin/folder2ram and obviously this returns an error. /usr/sbin/folder2ram: No such file or directory see here for the file where that is defined

On Debian 10 (OMV 5.x), /sbin/ is a symlink to /usr/sbin/. This symlink may not be created on upgraded systems. So, I will change it.

I will also remove /var/lib/php.

ryecoaaron commented 4 years ago

5.0.7 in the repo now.

yllekz commented 4 years ago

Will that make its way out via the usual update channels or do we need to grab it manually somehow?

ryecoaaron commented 4 years ago

in the repo means apt-get update and apt-get upgrade will install the updates

happyreacer commented 4 years ago

@ryecoaaron thank's a lot. 5.0.7 works !

ryester19 commented 4 years ago

Are OMV4 installations still broken?

ryester27@Rye-NAS:~$ sudo apt install openmediavault-flashmemory
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
  folder2ram
The following NEW packages will be installed:
  folder2ram openmediavault-flashmemory
0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
Need to get 27.6 kB of archives.
After this operation, 215 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 https://dl.bintray.com/openmediavault-plugin-developers/arrakis stretch/main amd64 folder2ram all 0.3.3 [13.4 kB]
Get:2 https://dl.bintray.com/openmediavault-plugin-developers/arrakis stretch/main amd64 openmediavault-flashmemory all 4.2.1 [14.2 kB]
Fetched 27.6 kB in 0s (42.9 kB/s)                  
Selecting previously unselected package folder2ram.
(Reading database ... 82781 files and directories currently installed.)
Preparing to unpack .../folder2ram_0.3.3_all.deb ...
Unpacking folder2ram (0.3.3) ...
Selecting previously unselected package openmediavault-flashmemory.
Preparing to unpack .../openmediavault-flashmemory_4.2.1_all.deb ...
Unpacking openmediavault-flashmemory (4.2.1) ...
Setting up folder2ram (0.3.3) ...
Setting up openmediavault-flashmemory (4.2.1) ...

Created symlink /etc/systemd/system/basic.target.wants/folder2ram_startup.service → /lib/systemd/system/folder2ram_startup.service.
Created symlink /etc/systemd/system/shutdown.target.wants/folder2ram_shutdown.service → /lib/systemd/system/folder2ram_shutdown.service.
Created symlink /etc/systemd/system/reboot.target.wants/folder2ram_shutdown.service → /lib/systemd/system/folder2ram_shutdown.service.
Created symlink /etc/systemd/system/halt.target.wants/folder2ram_shutdown.service → /lib/systemd/system/folder2ram_shutdown.service.

will now start all mountpoints
start /var/log
start /var/tmp
start /var/lib/openmediavault/rrd
start /var/spool
start /var/lib/rrdcached
start /var/lib/monit
start /var/lib/php
mount: wrong fs type, bad option, bad superblock on folder2ram,
       missing codepage or helper program, or other error

       In some cases useful info is found in syslog - try
       dmesg | tail or so.
cp: '/var/folder2ram/var/lib/php' and '/var/lib/php' are the same file
copy files to /var/lib/php failure, rolling back the mount
umount: /var/lib/php: not mounted
start /var/lib/netatalk/CNID
start /var/cache/samba
Processing triggers for openmediavault (4.1.35-1) ...
Updating locale files ...
Updating file permissions ...
Purging internal cache ...
Restarting engine daemon ...
ChriKn commented 4 years ago

Still not working for me on OMV 4. I tried to apt update and apt upgrade (as well as apt-get both) Should I uninstall those first ?

ryecoaaron commented 4 years ago

I guess so. I will have to push out an update in a while.

ryecoaaron commented 4 years ago

4.2.2 is in the repo.

ChriKn commented 4 years ago

Hi Aaron, sadly the update has not changed much on my end... I updates/upgraded and rebooted, but still unable to login correctly... What can I do to help ?

ryecoaaron commented 4 years ago

for omv 4.x, I would: omv-mkconf nginx omv-mkconf php-fpm systemctl restart nginx systemctl restart php7.0-fpm

ChriKn commented 4 years ago

Just did that, sadly not changing anything (might also be an error on my side... I am not a linux genius...)

ChriKn commented 4 years ago

It just worked by running these : sudo rm -rf /var/lib/php/sessions sudo mkdir -m 777 /var/lib/php/sessions ls /var/lib/php -l sudo nginx -s reload

Sorry if I misread something. Thought the update was doing the fix on itself...

spikysimonw commented 4 years ago

Hi, thanks for the quick turn-around getting this fixed!

Can someone please confirm the default out-the-box permissions for /var/lib/php/sessions (while a wide-open 777 obviously works, very much doubt this was the default)?

spikysimonw commented 4 years ago

for omv 4.x, I would: omv-mkconf nginx omv-mkconf php-fpm systemctl restart nginx systemctl restart php7.0-fpm

Doesn't recreate the required /var/lib/php/sessions directory unfortunately, needs to be removed then recreated manually (with correct permissions).

adatum commented 4 years ago

I had the same problem with a "login loop" after an update and reboot. At that point I could still access the system through SSH. Later, I saw an update to flashmemory plugin and installed it and rebooted. Since then, SSH connections are refused by OMV.

I tried chmod 777 /var/lib/php/sessions but at this point it made no difference.

Any ideas what could be wrong? It seems I no longer have access to my OMV device, but I could edit files by putting the SD card with the OMV installation on another machine. If only I could know what to look for.

dgayubo commented 4 years ago

for omv 4.x, I would: omv-mkconf nginx omv-mkconf php-fpm systemctl restart nginx systemctl restart php7.0-fpm

Thanks @ryecoaaron . It's works for me!

@adatum In /etc/rc.local Try to add the line: chmod 777 /var/lib/php/sessions

adatum commented 4 years ago

@adatum In /etc/rc.local Try to add the line: chmod 777 /var/lib/php/sessions

I already have /var/lib/php/sessions with 777 permissions. How is adding that in rc.local going to help?

Right now my problem is that SSH connections to OMV are refused, and I don't know why, or what else may now be broken. Any ideas for diagnosing this?

ryecoaaron commented 4 years ago

once you install the updated plugin, you should only have to fix those permissions once. No need to put in rc.local.

If ssh isnt working, disable it and apply and then enable it and apply from web interface.

adatum commented 4 years ago

@ryecoaaron Perhaps I wasn't clear. The web interface isn't working, and neither is SSH at this point, so I can't probe if/how OMV is working when booted on my Odroid HC2.

This total breakdown happened after updating the flashmemory plugin to 4.2.2 (I think) and rebooting.

The only recourse I seem to have is to edit files on the OMV SD card on another machine.

ryecoaaron commented 4 years ago

Ah, that is a problem with the hc1/2 unless you have a serial device. If you put the sd card in another machine, you would need to chroot into the sd card environment to really fix things but a lot of OMV things don’t work in chroot. Re-installing is going to be easiest unless you have an xu4 sitting around.

adatum commented 4 years ago

I don't have a serial device or xu4. Before resorting to reinstalling, do you have any suggestions to try?

ryecoaaron commented 4 years ago

make sure log directories and config files are there. hard to say

adatum commented 4 years ago

Log files (in /var/log) and config files (eg /etc/openmediavault/config.xml and /etc/sysctl.conf) are there. But I noticed that the timestamps/entries in the log file end at the time of the reboot after which I lost SSH access. Further boots don't seem to add to the logs.