Bug 55962 - spadmin: no printers can be installed, because the file system is read-only.
Summary: spadmin: no printers can be installed, because the file system is read-only.
Status: RESOLVED WONTFIX
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Printing and PDF export (show other bugs)
Version:
(earliest affected)
3.6.2.2 release
Hardware: x86-64 (AMD64) All
: medium major
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-10-14 03:15 UTC by Jonathan Dlouhy
Modified: 2014-03-27 21:05 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
strace log (200.04 KB, application/x-gzip)
2013-02-04 07:13 UTC, mervinb
Details
truss of the same problem on FreeBSD with 3.6.5.2 (2.12 MB, text/plain)
2013-02-19 09:19 UTC, somebody
Details
Trace of spadmin failure on Archlinux 64bit (168.29 KB, application/gzip)
2013-03-05 18:30 UTC, Vincent Van Houtte
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jonathan Dlouhy 2012-10-14 03:15:05 UTC
This is on Arch Linux, x86_64 and LibreOffice 3.6.2.2. Running ./spadmin as user or as root produces the following error: "No printers can be installed, because the file system is read-only." Since LO won't save printer properties through the program I can't change PDF to Postscript and have it honored on restart of program.
Comment 1 Julien Nabet 2012-12-12 21:36:12 UTC
On pc Debian x86-64 with 3.6 sources updated some days ago, I don't reproduce this.

Jonathan: could you give a try to a newer version?
If possible, don't hesitate to retrieve a package from Lo website (see http://www.libreoffice.org/download/) to be sure it's not packaging bug.
Comment 2 Jonathan Dlouhy 2012-12-12 22:17:57 UTC
Julien, I'm already using the latest version. 3.6.4.3 and there is no change. This only occurs with Arch Linux, all other distributions work as expected.
Comment 3 Julien Nabet 2012-12-13 06:27:54 UTC
Jonathan: thank you for your feedback.

- Does printing work on other applications?
- did you upgrade CUPS?
- what printer do you have?
- could you give a look to this tracker:
https://bugs.freedesktop.org/show_bug.cgi?id=51583 to
  - retrieve logs from CUPS program?
  - check your CUPS config?
It may bring you some hints
Comment 4 Jonathan Dlouhy 2012-12-13 07:04:45 UTC
Julien, with all due respect, I don't see how CUPS has anything to do with this. Yes, I can print from all apps.  I can print from LibreOffice, but I can't permanently set the printer options because of the read-only file system error.
The problem is ./spadmin error.
I have a Brother HL-2140, which is fully supported.
Comment 5 Julien Nabet 2012-12-13 07:25:28 UTC
Michael: any idea for this one?
Comment 6 Julien Nabet 2012-12-13 19:01:17 UTC
(In reply to comment #4)
> Julien, with all due respect, I don't see how CUPS has anything to do with
> this. Yes, I can print from all apps.  I can print from LibreOffice, but I
> can't permanently set the printer options because of the read-only file
> system error.
> The problem is ./spadmin error.
> I have a Brother HL-2140, which is fully supported.
Jonathan: Sorry by rereading the comments, I thought you couldn't print at all.
Did you try to run spadmin as root? (just for the test)

It seems the code is in vcl/unx/generic/printer/printerinfomanager.cxx
    685 bool PrinterInfoManager::writePrinterConfig()
    686 {
...
    692     for( ::std::list< WatchFile >::const_iterator wit = m_aWatchFiles.begin(); wit != m_aWatchFiles.end(); ++wit )
    693     {
    694         if( checkWriteability( wit->m_aFilePath ) )
    695         {
    696             files[ wit->m_aFilePath ] = new Config( wit->m_aFilePath );
    697             break;
    698         }
    699     }
    700 
    701     if( files.empty() )
    702         return false;

But then I don't know to investigate more since I've got no printer to display wit->m_aFilePath values.
Comment 7 Jonathan Dlouhy 2012-12-13 19:04:32 UTC
Julien, I have tried as root and with sudo (see first comment); makes no difference.
Comment 8 Julien Nabet 2012-12-13 19:08:29 UTC
(In reply to comment #7)
> Julien, I have tried as root and with sudo (see first comment); makes no
> difference.

You right

I added some logs, here are the files:
file:///home/julien/compile-libreoffice/libo/install/program/../share/psprint/psprint.conf
file:///home/julien/compile-libreoffice/libo/install/program/../share/psprint/psprint.conf
file:///home/julien/compile-libreoffice/libo/install/program/../share/psprint/psprint.conf
I don't know why it uses 3 times the same path but now we know what file it tries to update
Comment 9 Julien Nabet 2012-12-13 19:41:22 UTC
a psprint.conf is present at different locations (without taking into account locations from sources compiled:

-rw-r--r-- 1 root root 4322 May 19  2011 /etc/libreoffice/psprint.conf

lrwxrwxrwx 1 root root 29 Nov 21 04:15 /usr/lib/libreoffice/share/psprint/psprint.conf -> /etc/libreoffice/psprint.conf

-rw-r--r-- 1 julien julien 569 Dec 13 20:28 ~/.config/libreoffice/3/user/psprint/psprint.conf

(drwxr-xr-x 2 julien julien 4096 Dec 13 20:17 ~/.config/libreoffice/3/user/psprint)

Jonathan: could you rename your LO directory profile (see http://wiki.documentfoundation.org/UserProfile) and try again?
If you still reproduce this, could you check:
- if ~/.config/libreoffice/3/user/psprint exist and tell the rights of it?
- if ~/.config/libreoffice/3/user/psprint/psprint.conf exist and tell the rights?
Comment 10 Jonathan Dlouhy 2012-12-13 20:02:58 UTC
OK, renamed my "user" dir, no change. Permissions on the dir in question, dlouhy:users. I have no psprint.conf in that dir.
Comment 11 Julien Nabet 2012-12-13 20:07:14 UTC
Jonathan: 
do you have ~/.config/libreoffice/3/user/psprint directory?
If yes could you give precise line to know the rights?
(eg: drwxr-xr-x 2 julien julien 4096 Dec 13 20:17 ~/.config/libreoffice/3/user/psprint)
Comment 12 Michael Meeks 2012-12-14 10:24:14 UTC
We have another report of this on FreeBSD IIRC - can we get an strace of spadmin ? I imagine it's a pointlessly unhelpful exception message for some other un-related problem :-)

An:

strace -f -s 256 -o /tmp/slog spadmin
gzip /tmp/slog

and attach it would be really helpful.

Thanks ! :-)
Comment 13 mervinb 2013-02-04 07:13:17 UTC
Created attachment 74162 [details]
strace log
Comment 14 mervinb 2013-02-04 07:17:22 UTC
Hi. I use Arch, and have the same printing issue on two laptops. I have resorted to export to PDF, then printing the PDF file, but that's obviously quiet troublesome.

I've run strace on spadmin, and attach the log. I hope it's useful.
Comment 15 somebody 2013-02-19 09:19:24 UTC
Created attachment 75099 [details]
truss of the same problem on FreeBSD with 3.6.5.2
Comment 16 somebody 2013-02-19 17:42:56 UTC
(In reply to comment #15)
> Created attachment 75099 [details]
> truss of the same problem on FreeBSD with 3.6.5.2

On FreeBSD the solution is to configure --with-ppds and --enable-cups even if you don't use CUPS at all.
Comment 17 Vincent Van Houtte 2013-03-05 18:30:07 UTC
Created attachment 75980 [details]
Trace of spadmin failure on Archlinux 64bit

Libreoffice 3.6.5.2 (Build-id: 3.6.5.2 Arch Linux build-1) - This has been happening for some time now on Archlinux
Comment 18 Julien Nabet 2013-03-05 18:44:16 UTC
Comment on attachment 75980 [details]
Trace of spadmin failure on Archlinux 64bit

Mimetype fixed
Comment 19 Andreas Radke 2013-03-10 07:48:19 UTC
Removing the --without-ppds switch make it work for Arch people. It adds 2 files here:

/usr/lib/libreoffice/share/psprint/driver/SGENPRT.PS
/usr/lib/libreoffice/share/psprint/driver/SGENT42.PS

I guess removing the switch is only a workaround and doesn't cause the real issue.
Comment 20 Michael Meeks 2013-03-11 11:06:04 UTC
Julien - your code pointer is rather interesting; if indeed this is where it fails in printerinfomanager.cxx:

initialize does:
    psp::getPrinterPathList( aDirList, NULL );
    ...
    for( print_dir_it = aDirList.begin(); print_dir_it != aDirList.end(); ++print_dir_it )
    ...
    // now collect all available printers
    for( print_dir_it = aDirList.begin(); print_dir_it != aDirList.end(); ++print_dir_it )
    ... add each of aDirList to m_aWatchFiles ...

Then later when it comes to write we do:

writePrinterConfig: does -
    for( ::std::list< WatchFile >::const_iterator wit = m_aWatchFiles.begin(); wit != m_aWatchFiles.end(); ++wit )
    {
        if( checkWriteability( wit->m_aFilePath ) )
        {
            files[ wit->m_aFilePath ] = new Config( wit->m_aFilePath );
            break;

...

I never see m_aWatchFiles extended after init - but - this should point to eg.

1604  openat(AT_FDCWD, "/home/mervin/.config/libreoffice/3/user/psprint/driver", O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC) = 20

which seems to succeed just fine. Most odd.
Comment 21 Michael Meeks 2013-03-11 11:12:43 UTC
And of course Julien is quite right - the spadmin code does:

    // at this point no actual changes will be  written
    // but the write will have checked whether any writeable config exists
    if( ! m_rPIManager.writePrinterConfig() )
    {
...
        ErrorBox aBox( GetParent(), WB_OK | WB_DEF_OK, String( PaResId( RID_ERR_NOWRITE ) ) );

Which is the expected error message; so - the question is why is none of the config write-able ? :-) Compiling and running with:

diff --git a/vcl/unx/generic/printer/printerinfomanager.cxx b/vcl/unx/generic/printer/printerinfomanager.cxx
index 6db4904..d6727c5 100644
--- a/vcl/unx/generic/printer/printerinfomanager.cxx
+++ b/vcl/unx/generic/printer/printerinfomanager.cxx
@@ -679,6 +679,8 @@ static bool checkWriteability( const OUString& rUniPath )
     SvFileStream aStream( aSysPath, STREAM_READ | STREAM_WRITE );
     if( aStream.IsOpen() && aStream.IsWritable() )
         bRet = true;
+    fprintf( stderr, "Is '%s' writeable? %d\n",
+             rtl::OUStringToOString( rUniPath, RTL_TEXTENCODING_UTF8 ).getStr(), bRet );
     return bRet;
 }
 
Would at least list the paths we check - it'd be good to get some results from that; it's not reproducible here. Thanks ! :-)
Comment 22 mervinb 2013-03-19 00:55:34 UTC
Hi,

Without any notification, libreoffice on my Arch systems (Arch LibreOffice 4.0.1-2) is now printing without issue. spadmin also appears to be working. There was a -2 update on LO, so perhaps something changed in this update.

Thanks to whoever in the Arch or LO commmunity who has fixed this!

Mervin
Comment 23 Michael Meeks 2013-03-19 09:48:39 UTC
Wow - well, scary in part since little changed there.

anyone else with a miraculous cure for their LibreOffice ? if so - I'd like to get this closed.

Thanks.
Comment 24 Francois Tigeot 2013-04-04 16:35:53 UTC
I also encountered this very same error, on DragonFly this time.

It turned out the copy of LibreOffice I was using had no CUPS support, due to some mistake at configure time.

Parts of the print subsystem still consider CUPS support as optional and return insane error messages when it's not present.
Comment 25 Julien Nabet 2013-04-19 09:16:21 UTC
François: what was the LO version you encountered this problem?
Comment 26 Mikhail T. 2013-05-02 02:59:18 UTC
Using a freshly-built 4.0.2 on FreeBSD I'm still seeing this problem.

LO is built with cups support (because the cups-library was installed at build-time), but cupsd is not running -- my sole printer is managed by the good old lpd.

Running spadmin as root, I am seeing a good Ukrainian translation of the same message others have reported. There are no read-only mounted filesystems and running under ktrace confirms, that in no case is the errno value of 30 (EROFS) being returned from any system call -- so the message itself is bogus and misleading.
Comment 27 Hernan Cuevas 2013-05-06 15:36:13 UTC
In FreeBSD 8.3, LO 4.0.2 built from ports, with only:

CUPS SUPPORT
SDK

(via "make config"), spadmin works with LPRng. Previously (without CUPS SUPPORT), it failed with the "read-only fs" message. I don't have/use CUPS. I agree, the message is misleading (as is the workaround -_-").
Comment 28 QA Administrators 2014-02-02 02:06:29 UTC
Dear Bug Submitter,

Please read the entire message before proceeding.

This bug has been in NEEDINFO status with no change for at least 6 months. Please provide the requested information as soon as possible and mark the bug as UNCONFIRMED. Due to regular bug tracker maintenance, if the bug is still in NEEDINFO status with no change in 30 days the QA team will close the bug as INVALID due to lack of needed information.

For more information about our NEEDINFO policy please read the wiki located here: 
https://wiki.documentfoundation.org/QA/FDO/NEEDINFO

If you have already provided the requested information, please mark the bug as UNCONFIRMED so that the QA team knows that the bug is ready to be confirmed.


Thank you for helping us make LibreOffice even better for everyone!


Warm Regards,
QA Team
Comment 29 Francois Tigeot 2014-02-03 18:58:15 UTC
spadmin from LibreOffice-4.0.6 still shows a bogus "No printers can't be installed, because the file system is read-only." error message.

It then proceeds to show a different dialog box with the list of cups printers configured on this machine.

LibreOffice itself prints documents without any issue.
Comment 30 Julien Nabet 2014-02-05 19:20:29 UTC
François: is it better with stable version 4.2.0.4?
Comment 31 Francois Tigeot 2014-02-05 21:19:00 UTC
LibreOffice 4.2 is not yet packaged for my operating system; I hope to be able to build it locally and confirm the issue is still present soon.
Comment 32 Julien Nabet 2014-02-05 21:30:24 UTC
Perhaps a 4.1.X?
Comment 33 Francois Tigeot 2014-02-06 09:52:41 UTC
I'm sorry but it seems development has been abandoned on FreeBSD.
Neither 4.2.x nor 4.1.x build out of the box and the latest package is 4.0.6.
Comment 34 Francois Tigeot 2014-03-02 14:02:37 UTC
The FreeBSD LibreOffice port has now been updated to the 4.1 branch.

spadmin doesn't complain anymore, but this is most likely because of changed configure options.

LibreOffice was previously built with the --without-ppds option and it appears it was what caused the bogus spadmin error message to appear.

FreeBSD bug reports which caused the --without-ppds option to be removed:
http://www.freebsd.org/cgi/query-pr.cgi?pr=167309&cat=
http://www.freebsd.org/cgi/query-pr.cgi?pr=167441&cat=
Comment 35 Michael Meeks 2014-03-03 10:48:24 UTC
Francois - thanks so much for the update ! I guess that would help anyone wanting to reproduce the problem too - to test the PPD-less code-path =)

I guess we should leave this open for now though; it'd be nice to have a fix for that corner-case I guess.

Really glad it's working for you now though !