nanoporetech / minknow_api

Protobuf and gRPC specifications for the MinKNOW API
Other
55 stars 12 forks source link

BUG: minKNOW non-default data output location broken in LINUX #60

Open cement-head opened 1 year ago

cement-head commented 1 year ago

Using Ubuntu 22.04 & 18.04 - latest versions of minKNOW do not let one choose and output folder other than the default.

I get a "Path not writable" error, meaning that more than likely the folder permissions are not be changed properly. This is a new bug.

0x55555555 commented 1 year ago

Hi @cement-head,

Can you go into a little more detail about how youre using the API, arguments you're passing and what the exact response/errors you receive are?

Additionally, what versions of minknow + the API youre using?

Thanks,

cement-head commented 1 year ago

@jorj1988 Will do, currently in the middle of a sequencing run, so it'll be a day or two - don't want to bugger the current run.

cement-head commented 1 year ago

@jorj1988 Okay, here's the situation. I have an Intel NUC (small computer) that has TWO (2) physically separate SSDs; one for the operating system (Ubuntu 22.04 LTS; about 500 GB) and one for the minKNOW data (1 TB).

The ONLY location that I can save data to during a run is the default </var/lib/minknow/data>. Choosing ANY other location gives an error when attempting to start run that says "ERROR: PATH IS NOT WRITABLE".

The permissions for </var/lib/minknow/data> are:

Screenshot from 2023-10-26 10-22-38

The permissions for the second SSD (1 TB) where I used to be able to select my storage location for the data are:

Screenshot from 2023-10-26 10-21-55

The issue (BUG) is that one cannot choose a location other than the default. This is a CRITICAL bug, as many people, including myself use a second SSD for the data only collection. This is a regression/new bug, as older versions of minKNOW did allow choosing a different path/locations to save the run data.

I am using Ubuntu 22.04 LTS; the minKNOW GUI is 5.7.14; the minKNOW is 23.07.12; minKNOW CORE 5.75; GUPPY 7.1.4; BREAM 7.7.6; SCRIPT 5.7.11

cement-head commented 1 year ago

Nanopore Community:

(1) https://community.nanoporetech.com/posts/path-not-writebable

(2) https://community.nanoporetech.com/posts/an-error-occurred-while-at

0x55555555 commented 1 year ago

@cement-head - the second image in your post seems to be the same as the first - I am interested to know the permissions on your external HDD, if possible.

We're trying to work back to what the issue is here - none of the changes (running as minknow user, needing write permissions for minknow user to dest) are new - so it's not clear what's broken the workflow.

juliano60 commented 1 year ago

@cement-head In addition to @jorj1988 's question above, could you please also tell us how you mounted your secondary SSD? Did you manually mount it from the command line? Many thanks.

Kindest Regards, Jules

cement-head commented 1 year ago

@jorj1988 Whoops! Thanks for the catch - updated the screenshot to the proper one. The cbfg-minion account is the user account (the only one on the machine).

@juliano60 Via the GUI UDISK2 -> Disks Utility

Screenshot from 2023-10-27 11-49-40

Screenshot from 2023-10-27 11-49-58

Edward-Knight commented 1 year ago

Hi @cement-head, could you show us the permissions of the DATA directory on your mounted drive instead of the contents? You can do this with ls -ld DATA instead of ls -l DATA.

cement-head commented 1 year ago

image

juliano60 commented 1 year ago

@cement-head ,

Thanks for that.

We can see (from your screenshot) that the DATA folder is lacking some permissions for the minknow user. Could you via the same GUI Disk Utility edit your mount options and append the following options (see screenshots below): rw,umask=0000

We believe that should resolve the permissions issue. To confirm this, could you also re-run the "ls -ld DATA" on your mounted drive and paste the new permissions here? Many thanks.

Capture_mount_options_2 Capture_mount_options
cement-head commented 1 year ago

Okay, will try and post back.

NOPE. It a mess now, and I can't even access the drive.

Screenshot from 2023-10-30 14-57-51


EDIT: is that umask=ZEROZEROZEROZERO, or umask=OOOO ?

juliano60 commented 1 year ago

@cement-head , apologies that was ZEROZEROZEROZERO. Would you also please be able to provide a screenshot of your mount options page (as you did in a previous post) whilst you're at it? Many thanks.

Kindest Regards, Jules

cement-head commented 1 year ago

@juliano60 Okay, so reversing (removing & rebooting) the addition of rw,umask=0000 allows me (USER=cbfg-minion) to access the drive again, but again the minKNOW program (USER=minknow) cannot/doesn't have write permissions.

image

juliano60 commented 1 year ago

@cement-head , Okay, let's try it again but this time from the command-line.

I am assuming in the following discussion that the drive you are trying to mount is /dev/sdb (as per one of your screenshots above). I am also assuming that the mount point will be located at:/media/cbfg-minion/app-data .

Could you please run the following commands from a terminal: sudo mkdir /media/cbfg-minion/app-data sudo mount -t vfat /dev/sdb /media/cbfg-minion/app-data -o rw,umask=0000

The first command creates the directory whilst the second command mounts the device on that directory. If your device is no longer called /dev/sdb you will need to update the command above as appropriate. The Disk Utility shows what the device is called.

Then once done, could you please run a ls -d /media/cbfg-minion/app-data and post a screenshot on here. It is important that the permissions be correct in order for it to work. Many thanks.

Kindest Regards, Jules

juliano60 commented 1 year ago

Note that -o is lowercase O as in option I should also point out that the device must NOT already be mounted before you run the commands above (you can unmount it using the Disk Utility).

juliano60 commented 1 year ago

@cement-head , It turns out that your external drive has a different filesystem (namely ext4 as per one of your screenshots above) to what I had in mind, which might explain why you experienced some issues with the "umask" option earlier. I would have to try it here and get back to you. Many thanks.

Kindest Regards, Jules

juliano60 commented 1 year ago

@cement-head , My previous post now becomes as follows.

I am assuming in the following discussion that the drive you are trying to mount is /dev/sdb (as per one of your screenshots above). I am also assuming that the mount point will be located at: /media/cbfg-minion/app-data .

Could you please run the following commands from a terminal:

sudo mkdir /media/cbfg-minion/app-data
sudo mount -t ext4 /dev/sdb /media/cbfg-minion/app-data -o rw
sudo chown -R minknow:minknow /media/cbfg-minion/app-data
sudo chmod 777 /media/cbfg-minion/app-data

The first command creates the directory. The second command mounts the device on that directory. The third command reconfigures the permissions for the mount point. The last command achieves a similar purpose but is used in case the third command fails for some reason.

If your device is no longer called /dev/sdb you will need to update the command above as appropriate. The Disk Utility shows what the device is called.

Then once done, could you please run a ls -d /media/cbfg-minion/app-data and post a screenshot on here. It is important that the permissions be correct in order for it to work. Many thanks.

Once again, please ensure that your device is NOT already mounted before running the command above (you can use the Disk Utility to unmount).

Kindest Regards,

cement-head commented 1 year ago

We will try this tomorrow AM, as we're finishing up a large run right now.

juliano60 commented 1 year ago

Sounds good @cement-head , do let us know how it goes.

Kindest Regards, Jules

cement-head commented 1 year ago
$ ls -ld /media/cbfg-minion/app-data/
drwxrwxrwx 4 minknow minknow 4096 Oct 30 15:53 /media/cbfg-minion/app-data/

Still the same error "/path/ not writable"

juliano60 commented 1 year ago

Thanks @cement-head ,

The permissions look good now. Just to confirm, did you also select /media/cbfg-minion/app-data as the output directory at the start of the experiment?

Kindest Regards, Juls

cement-head commented 1 year ago

@juliano60 Yes, I did - and the same error popped up. I'm going to try a fresh install next week and see if that makes a difference - let's put a hold on trouble shooting until then. We have another run that needs to get started, but once that's done (Mon/Tues). I'll reinstall Ubuntu 22.04 from scratch and see if I can get it to work. There maybe something buggered with the current install, and a clean system might be the fastest way to track down this problem.

juliano60 commented 1 year ago

@cement-head , Sounds good. Do let us know how it goes next week.

Thanks and Regards, Jules

ChristopherAdelmann commented 9 months ago

Hello @cement-head, as I am facing a similar issue, I wonder if this could be resolved? Do you have any updates on this?

Best, Christopher

jackwadden commented 6 months ago

Any updates on this? We've been unable to write to alternate directories for about..... five years now.

juliano60 commented 6 months ago

@cement-head Any luck with the re-install?

Kindest Regards, Jules

0x55555555 commented 6 months ago

Hi @jackwadden + @ChristopherAdelmann,

Can you provide info on your specific systems (OS, minknow version) and where you are trying to write, the permissions of that location etc.

Thanks,

jackwadden commented 6 months ago

I'm on Ubuntu 20.04. I'm trying to write to a folder in my home directory. The permissions are 777 and the owner and group are 'minknow:minknow'. Installed Minknow version is 24.02.10 core 5.9.7.

juliano60 commented 6 months ago

Thanks @jackwadden , Just for absolute clarity, would you mind pasting a screenshot of the permissions for that folder on here. That is, the output of running an ls -ald on that folder.

Kindest Regards, Jules

jackwadden commented 6 months ago

drwxrwxrwx 6 minknow minknow 4096 Apr 23 17:59 sequencing_runs/ Screenshot from 2024-04-24 10-13-47

juliano60 commented 6 months ago

Thanks @jackwadden

Those look good. It is worth noting that for the user minknow to be able to access a folder, say folder dir-c, example /dir-a/dir-b/dir-c where dir-a and dir-b are intermediate directories, the user "minknow" must also have at least both the read and execute permissions set on folders dir-a and dir-b.

For your use-case, we want At least Read and Execute on / for the minknow user At least Read and Execute on home for the minknow user At least Read and Execute on wadden for the minknow user At least Read and Execute on sequencing_runs for the minknow user (that's already the case, so no change required)

Could you please double-check each of them (by running ls -ald on each folder)? Or paste a screenshot showing the permissions for each folder on here so we can double-check those also.

Kindest Regards, Jules

jackwadden commented 6 months ago

OK, thanks for the detailed response, and understood. I'll check/change those permissions and reply back later today when I'm able to retest. Is there any (easy) way to test without a live flowcell?

juliano60 commented 6 months ago

@jackwadden

One way to test (and to make sure) that the permissions are correct would be to login as that user (that is, as the user "minknow") and to attempt to create a dummy file in that folder of interest. Otherwise checking each of the intermediate folders' permissions should cover it.

Kindest Regards, Jules

jackwadden commented 6 months ago

Yeah, perfect. I'll do that now and reply later when I've tested with a live run.

Thanks again for the quick and helpful responses.

juliano60 commented 6 months ago

Cheers @jackwadden , Note that loging in as "minknow" might be tricky depending on whether that user has a login shell configured. If you are able to login, great, otherwise we are back to checking all the permissions individually.

Kindest Regards, Jules

0x55555555 commented 6 months ago

If that doesnt resolve your issue @jackwadden I'd like to take a look at your logs, are you able to contact support (via https://nanoporetech.com/support) and pass over a log dump from your machine?

Thanks,

jackwadden commented 6 months ago

Just updating here because I was able to make some progress but am still am having issues. Examining the log files was extremely helpful.

jackwadden commented 6 months ago

OK, I think all is good now

So to summarize:

To successfully adjust your output directory for all output files in the case /var is too small, you need to follow these steps in order:

Hopefully this helps anyone running into the same issues. And thanks to George and Jules for the quick responses.

-Jack

0x55555555 commented 6 months ago

Thanks @jackwadden,

I'm glad you got it working - I will take your advice here and get the docs updated to reflect the advice!