Bug 846455 - Report Non-Ready State If A Read-Only Filesystem Is Detected
Report Non-Ready State If A Read-Only Filesystem Is Detected
Status: CLOSED WONTFIX
Product: Fedora
Classification: Fedora
Component: koji (Show other bugs)
17
All All
unspecified Severity medium
: ---
: ---
Assigned To: Dennis Gilmore
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-08-07 16:39 EDT by Jon Chiappetta
Modified: 2013-07-31 19:48 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-07-31 19:48:01 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Jon Chiappetta 2012-08-07 16:39:19 EDT
--- Description of problem:

Koji should perform a quick check of the booted filesystem to make sure it's readable and writable before taking on new tasks. 

--- Version-Release number of selected component (if applicable):

All

--- How reproducible:

Remount the root filesystem as read-only and watch it take on tasks?

--- Example patch:

$ diff -u ~/tmp/koji-1.6.0/koji/daemon.py ~/Desktop/temp/koji-1.6.0/koji/daemon.py 
--- /home/jchiappetta/tmp/koji-1.6.0/koji/daemon.py	2010-12-16 16:13:17.000000000 -0500
+++ /home/jchiappetta/Desktop/temp/koji-1.6.0/koji/daemon.py	2012-08-07 16:26:06.311797605 -0400
@@ -976,6 +976,31 @@
             self.status = "Insufficient disk space: %i MB, %i MB required" % (availableMB, self.options.minspace)
             self.logger.warn(self.status)
             return False
+        try:
+            f = open("/proc/mounts", "r")
+        except:
+            pass
+        while (1):
+            try:
+                l = f.readline()
+            except:
+                break
+            if (not l):
+                break
+            l = l.strip()
+            m = l.split(" ")
+            if (len(m) < 4):
+                continue
+            if (m[0][0:1] != "/"):
+                continue
+            o = m[3].split(",")
+            if (o[0] != "rw"):
+                self.logger.warn("Possible read-only fs : [%s %s %s %s]" % (m[0], m[1], m[2], o[0]))
+                return False
+        try:
+            f.close()
+        except:
+            pass
         return True
 
     def readyForTask(self):
Comment 1 Mike McLean 2012-08-08 15:24:01 EDT
I do not think it is a good idea to assert that all mounts be rw. In fact, the normal configuration for most builders is to have /mnt/koji as ro.

We can probably improve the sanity checks a bit, but this is way too specific to problems encountered in an esoteric setup.

Koji simply cannot be expected to exhaustively validate the host it is running on. Would you subject any other service daemon to this standard?
Comment 2 Jon Chiappetta 2012-08-08 16:03:30 EDT
I admit my example patch is a little over-assuming as not all mounts need to be rw, however, all I'm saying is that Koji will accept and fail new tasks when the parts it needs are mounted as ro. I think it should quickly check/touch the filesystem first before accepting a new task at least or else it's just a massively misbehaving builder that is constantly failing tasks... Just my opinion I guess.
Comment 3 Mike McLean 2012-08-09 15:01:26 EDT
This is one particular type of server misconfiguration that can cause builds to fail without causing kojid to die. There are many others. We cannot possibly check for them all, or even a significant fraction.

As I said, I am open to beefing up the sanity checks. Checking that /var/lib/mock is writable is certainly reasonable (we already check that it exists and has sufficient space). I suppose we could check for the existence of key utilities (e.g. mock) before we run them.
Comment 4 Fedora End Of Life 2013-07-03 18:08:36 EDT
This message is a reminder that Fedora 17 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 17. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '17'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 17's end of life.

Bug Reporter:  Thank you for reporting this issue and we are sorry that 
we may not be able to fix it before Fedora 17 is end of life. If you 
would still like  to see this bug fixed and are able to reproduce it 
against a later version  of Fedora, you are encouraged  change the 
'version' to a later Fedora version prior to Fedora 17's end of life.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.
Comment 5 Fedora End Of Life 2013-07-31 19:48:04 EDT
Fedora 17 changed to end-of-life (EOL) status on 2013-07-30. Fedora 17 is 
no longer maintained, which means that it will not receive any further 
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of 
Fedora please feel free to reopen this bug against that version.

Thank you for reporting this bug and we are sorry it could not be fixed.

Note You need to log in before you can comment on or make changes to this bug.