Re: [R-sig-Fedora] Problem with R, staged installation for packages, and samba share

2023-06-14 Thread Iñaki Ucar
On Thu, 15 Jun 2023 at 00:04, Alexandre Courtiol
 wrote:
>
> Hi all,
>
> The admin from our setup created a script that should help you reproduce our 
> problem (see below).
> Of course, it may be that it is not an RPM-related issue, but we hope you 
> will have an idea on how to solve the issue all the same.
>
> # 1. Prepare VM and set up Samba
>
> - install Fedora 38 Workstation (Fedora-Workstation-Live-x86_64-38-1.6.iso). 
> Username: 'user'
> - disable SELinux (edit /etc/selinux/config and set "SELINUX=disabled") and 
> reboot. Alternatively set up SELinux as described here: 
> https://docs.fedoraproject.org/en-US/quick-docs/samba/
>
> ```
> sudo dnf install samba
> mkdir ~/share
> sudo mkdir /mnt/share
> sudo smbpasswd -a user
> sudo cat << 'EOF' >> /etc/samba/smb.conf
> [share]
>   path = /home/user/share
>   writable = yes
>   browsable = yes
>   valid users = user
>   create mask = 0660
>   directory mask = 0770
> EOF
> sudo systemctl restart smb
> sudo mount -t cifs //localhost/share /mnt/share -o username=user,uid=user
> ```
>
>
> # 2. Install R with dnf
>
> ```
> sudo dnf install R
> mkdir /mnt/share/R
> ln -s /mnt/share/R ~/R
> ```
> - start R and install a package with dependencies (e.g. 
> "install.packages('dplyr')")
> - installation should fail (it does so on our side)

Well, actually not "a package with dependencies". Only dplyr seems to
fail, but no other package.

> # 3. Compile R from sources
>
> ```
> sudo dnf erase R
> sudo dnf builddep R
> sudo dnf install java-17-openjdk-devel
> curl -Ls https://cran.r-project.org/src/base/R-4/R-4.3.0.tar.gz | tar xzf -
> cd R-4.3.0
> ./configure
> make
> sudo make install
> ```
> - installing a package with dependencies should succeed now (on our side at 
> least)

The difference with the installation above is that this build is not
installing the help pages. Run R CMD INSTALL with --no-html above and
the installation succeeds too. So something happens with dplyr's html
pages (too many? so too much activity somehow locks the mounted files
temporarily?). No idea, but I don't think it has anything to do with
R.

Iñaki

>
>
> Many thanks, for having another look at this knot.
> Best,
> Alex
>
> On Wed, 14 Jun 2023 at 10:50, Alexandre Courtiol 
>  wrote:
>>
>> Thanks again, unfortunately it still fails when mounting the drive on a 
>> windows machine (even using nolease) on our end.
>> We will prepare a fully reproducible example using a virtual machine. This 
>> could take us a day or two.
>> ++
>>
>> On Tue, 13 Jun 2023 at 11:05, Iñaki Ucar  wrote:
>>>
>>> On Tue, 13 Jun 2023 at 10:35, Alexandre Courtiol
>>>  wrote:
>>> >
>>> > Thanks a lot for persevering.
>>> >
>>> > Iñaki, that sounds very promising, could you please tell me what software 
>>> > your SMB share is running on (i.e. what does the server side look like?), 
>>> > and if it's Samba, then what version did you use?
>>>
>>> There was a Windows 10 machine around, so I created a test folder and
>>> hit "share".
>>>
>>> > (and yes, I am aware of your excellent cran2copr project).
>>> >
>>> > Tom, yes it also created the same issue with older RPMs. Please also find 
>>> > the configure log attached to this email.
>>>
>>> I see no significant differences, so this supports the hypothesis that
>>> the issue is in the mount.
>>>
>>> Iñaki
>>>
>>> >
>>> > Best,
>>> >
>>> > Alex
>>> >
>>> >
>>> >
>>> > On Mon, 12 Jun 2023 at 21:08, Iñaki Ucar  wrote:
>>> >>
>>> >> Update:
>>> >>
>>> >> On Mon, 12 Jun 2023 at 17:40, Iñaki Ucar  wrote:
>>> >> >
>>> >> > Unfortunately, I cannot reproduce the issue here. :( I mounted a smb
>>> >> > share, created a symlink from ~/R, and installed dplyr without any
>>> >> > issue (apart from the installation process taking ages). Fortunately,
>>> >> > this rules out our binary R package as responsible for the issue you
>>> >> > are experiencing, unless I'm missing something.
>>> >>
>>> >> The experiment above was done using kio-fuse to mount the folder. Now
>>> >> I've been able to reproduce the error using a regular CIFS mount. I
>>> >> reproduced this both with Fedora and Debian R binaries. Then I
>>> >> executed the installation step by step, and I checked that, when the
>>> >> mv command is invoked, manually running mv in the console does trigger
>>> >> the error too. So again, I don't think there's any issue with R.
>>> >>
>>> >> However, I've also managed to fix the issue by adding the nolease
>>> >> option to the mount command. Hope it helps.
>>> >>
>>> >> Iñaki
>>> >>
>>> >> >
>>> >> > Issue aside, may I ask what is the purpose of putting the library in a
>>> >> > smb share? May I suggest [1]?
>>> >> >
>>> >> > [1] https://cran.r-project.org/bin/linux/fedora/#additional-packages
>>> >> >
>>> >> > Iñaki
>>> >> >
>>> >> > On Mon, 12 Jun 2023 at 16:48, Tom Callaway  wrote:
>>> >> > >
>>> >> > > The log of you running configure on your instance allows me to 
>>> >> > > compare it to the log of when we build it as a package (you don't 
>>> >> > > need to provide that 

Re: [R-sig-Fedora] Problem with R, staged installation for packages, and samba share

2023-06-14 Thread Alexandre Courtiol
Hi all,

The admin from our setup created a script that should help you reproduce
our problem (see below).
Of course, it may be that it is not an RPM-related issue, but we hope you
will have an idea on how to solve the issue all the same.

# 1. Prepare VM and set up Samba

- install Fedora 38 Workstation
(Fedora-Workstation-Live-x86_64-38-1.6.iso). Username: 'user'
- disable SELinux (edit /etc/selinux/config and set "SELINUX=disabled") and
reboot. Alternatively set up SELinux as described here:
https://docs.fedoraproject.org/en-US/quick-docs/samba/

```
sudo dnf install samba
mkdir ~/share
sudo mkdir /mnt/share
sudo smbpasswd -a user
sudo cat << 'EOF' >> /etc/samba/smb.conf
[share]
  path = /home/user/share
  writable = yes
  browsable = yes
  valid users = user
  create mask = 0660
  directory mask = 0770
EOF
sudo systemctl restart smb
sudo mount -t cifs //localhost/share /mnt/share -o username=user,uid=user
```


# 2. Install R with dnf

```
sudo dnf install R
mkdir /mnt/share/R
ln -s /mnt/share/R ~/R
```
- start R and install a package with dependencies (e.g.
"install.packages('dplyr')")
- installation should fail (it does so on our side)


# 3. Compile R from sources

```
sudo dnf erase R
sudo dnf builddep R
sudo dnf install java-17-openjdk-devel
curl -Ls https://cran.r-project.org/src/base/R-4/R-4.3.0.tar.gz | tar xzf -
cd R-4.3.0
./configure
make
sudo make install
```
- installing a package with dependencies should succeed now (on our side at
least)


Many thanks, for having another look at this knot.
Best,
Alex

On Wed, 14 Jun 2023 at 10:50, Alexandre Courtiol <
alexandre.court...@gmail.com> wrote:

> Thanks again, unfortunately it still fails when mounting the drive on a
> windows machine (even using nolease) on our end.
> We will prepare a fully reproducible example using a virtual machine. This
> could take us a day or two.
> ++
>
> On Tue, 13 Jun 2023 at 11:05, Iñaki Ucar  wrote:
>
>> On Tue, 13 Jun 2023 at 10:35, Alexandre Courtiol
>>  wrote:
>> >
>> > Thanks a lot for persevering.
>> >
>> > Iñaki, that sounds very promising, could you please tell me what
>> software your SMB share is running on (i.e. what does the server side look
>> like?), and if it's Samba, then what version did you use?
>>
>> There was a Windows 10 machine around, so I created a test folder and
>> hit "share".
>>
>> > (and yes, I am aware of your excellent cran2copr project).
>> >
>> > Tom, yes it also created the same issue with older RPMs. Please also
>> find the configure log attached to this email.
>>
>> I see no significant differences, so this supports the hypothesis that
>> the issue is in the mount.
>>
>> Iñaki
>>
>> >
>> > Best,
>> >
>> > Alex
>> >
>> >
>> >
>> > On Mon, 12 Jun 2023 at 21:08, Iñaki Ucar 
>> wrote:
>> >>
>> >> Update:
>> >>
>> >> On Mon, 12 Jun 2023 at 17:40, Iñaki Ucar 
>> wrote:
>> >> >
>> >> > Unfortunately, I cannot reproduce the issue here. :( I mounted a smb
>> >> > share, created a symlink from ~/R, and installed dplyr without any
>> >> > issue (apart from the installation process taking ages). Fortunately,
>> >> > this rules out our binary R package as responsible for the issue you
>> >> > are experiencing, unless I'm missing something.
>> >>
>> >> The experiment above was done using kio-fuse to mount the folder. Now
>> >> I've been able to reproduce the error using a regular CIFS mount. I
>> >> reproduced this both with Fedora and Debian R binaries. Then I
>> >> executed the installation step by step, and I checked that, when the
>> >> mv command is invoked, manually running mv in the console does trigger
>> >> the error too. So again, I don't think there's any issue with R.
>> >>
>> >> However, I've also managed to fix the issue by adding the nolease
>> >> option to the mount command. Hope it helps.
>> >>
>> >> Iñaki
>> >>
>> >> >
>> >> > Issue aside, may I ask what is the purpose of putting the library in
>> a
>> >> > smb share? May I suggest [1]?
>> >> >
>> >> > [1] https://cran.r-project.org/bin/linux/fedora/#additional-packages
>> >> >
>> >> > Iñaki
>> >> >
>> >> > On Mon, 12 Jun 2023 at 16:48, Tom Callaway  wrote:
>> >> > >
>> >> > > The log of you running configure on your instance allows me to
>> compare it to the log of when we build it as a package (you don't need to
>> provide that one).
>> >> > >
>> >> > > Honestly, I have no idea right now _why_ pre-built R would fail to
>> move files to a cifs share when a non-root user can do it. I'm hoping maybe
>> something will jump out as to how it configures on your setup. We aren't
>> modifying R's source code at all, nor are we configuring it in a way that
>> would affect this as far as I know.
>> >> > >
>> >> > > Does this also happen with the older R binary RPMs? If you go back
>> to 4.2.3 or 4.2.2, does it happen?
>> >> > >
>> >> > > ~spot
>> >> > >
>> >> > >
>> >> > > On Mon, Jun 12, 2023 at 10:38 AM Alexandre Courtiol <
>> alexandre.court...@gmail.com> wrote:
>> >> > >>
>> >> > >> "is the staged installation enabled too in the 

Re: [R-sig-Fedora] Problem with R, staged installation for packages, and samba share

2023-06-14 Thread Alexandre Courtiol
Thanks again, unfortunately it still fails when mounting the drive on a
windows machine (even using nolease) on our end.
We will prepare a fully reproducible example using a virtual machine. This
could take us a day or two.
++

On Tue, 13 Jun 2023 at 11:05, Iñaki Ucar  wrote:

> On Tue, 13 Jun 2023 at 10:35, Alexandre Courtiol
>  wrote:
> >
> > Thanks a lot for persevering.
> >
> > Iñaki, that sounds very promising, could you please tell me what
> software your SMB share is running on (i.e. what does the server side look
> like?), and if it's Samba, then what version did you use?
>
> There was a Windows 10 machine around, so I created a test folder and
> hit "share".
>
> > (and yes, I am aware of your excellent cran2copr project).
> >
> > Tom, yes it also created the same issue with older RPMs. Please also
> find the configure log attached to this email.
>
> I see no significant differences, so this supports the hypothesis that
> the issue is in the mount.
>
> Iñaki
>
> >
> > Best,
> >
> > Alex
> >
> >
> >
> > On Mon, 12 Jun 2023 at 21:08, Iñaki Ucar 
> wrote:
> >>
> >> Update:
> >>
> >> On Mon, 12 Jun 2023 at 17:40, Iñaki Ucar 
> wrote:
> >> >
> >> > Unfortunately, I cannot reproduce the issue here. :( I mounted a smb
> >> > share, created a symlink from ~/R, and installed dplyr without any
> >> > issue (apart from the installation process taking ages). Fortunately,
> >> > this rules out our binary R package as responsible for the issue you
> >> > are experiencing, unless I'm missing something.
> >>
> >> The experiment above was done using kio-fuse to mount the folder. Now
> >> I've been able to reproduce the error using a regular CIFS mount. I
> >> reproduced this both with Fedora and Debian R binaries. Then I
> >> executed the installation step by step, and I checked that, when the
> >> mv command is invoked, manually running mv in the console does trigger
> >> the error too. So again, I don't think there's any issue with R.
> >>
> >> However, I've also managed to fix the issue by adding the nolease
> >> option to the mount command. Hope it helps.
> >>
> >> Iñaki
> >>
> >> >
> >> > Issue aside, may I ask what is the purpose of putting the library in a
> >> > smb share? May I suggest [1]?
> >> >
> >> > [1] https://cran.r-project.org/bin/linux/fedora/#additional-packages
> >> >
> >> > Iñaki
> >> >
> >> > On Mon, 12 Jun 2023 at 16:48, Tom Callaway  wrote:
> >> > >
> >> > > The log of you running configure on your instance allows me to
> compare it to the log of when we build it as a package (you don't need to
> provide that one).
> >> > >
> >> > > Honestly, I have no idea right now _why_ pre-built R would fail to
> move files to a cifs share when a non-root user can do it. I'm hoping maybe
> something will jump out as to how it configures on your setup. We aren't
> modifying R's source code at all, nor are we configuring it in a way that
> would affect this as far as I know.
> >> > >
> >> > > Does this also happen with the older R binary RPMs? If you go back
> to 4.2.3 or 4.2.2, does it happen?
> >> > >
> >> > > ~spot
> >> > >
> >> > >
> >> > > On Mon, Jun 12, 2023 at 10:38 AM Alexandre Courtiol <
> alexandre.court...@gmail.com> wrote:
> >> > >>
> >> > >> "is the staged installation enabled too in the cases you don't see
> this issue?"
> >> > >> -> Yes, it should since we stick to default config.
> >> > >>
> >> > >> "Can you provide a log of the output (including the commandline
> with any options passed) for configure?"
> >> > >> -> If we compile locally there is no issue despite not using any
> option, and if we install R from binary, there is no configure log AFAIK,
> so I am not sure how to meet this request.
> >> > >>
> >> > >> "can you provide the specific mount options for the cifs share?"
> >> > >> ->
> sec=krb5,multiuser,mfsymlinks,user=smbuser,domain=localdomain,_netdev,noauto,x-systemd.automount
> >> > >>
> >> > >> ++
> >> > >>
> >> > >> On Mon, 12 Jun 2023 at 16:11, Tom Callaway 
> wrote:
> >> > >>>
> >> > >>> Okay, so if it's not SELinux... perhaps something about how R is
> being configured is different?
> >> > >>>
> >> > >>> Can you provide a log of the output (including the commandline
> with any options passed) for configure?
> >> > >>>
> >> > >>> Also, can you provide the specific mount options for the cifs
> share?
> >> > >>>
> >> > >>> ~spot
> >> > >>>
> >> > >>> On Mon, Jun 12, 2023 at 9:12 AM Alexandre Courtiol <
> alexandre.court...@gmail.com> wrote:
> >> > 
> >> >  Thanks for the tip but nope: SELinux is off on that system...
> >> > 
> >> >  On Mon, 12 Jun 2023 at 13:24, Iñaki Ucar <
> iu...@fedoraproject.org> wrote:
> >> > >
> >> > > On Mon, 12 Jun 2023 at 13:19, Tom Callaway 
> wrote:
> >> > > >
> >> > > > Hmm, that's a weird one. Is SELinux on and enforcing on that
> setup?
> >> > >
> >> > > I was going to bet on the same thing. :) But let me add: if the
> answer
> >> > > is affirmative, and this doesn't happen with SELinux disabled,
>