Commit fa03e04b authored by Cristiano Urban's avatar Cristiano Urban
Browse files

Trying to fix issues related to broken symlinks. It's getting very painful :(.

parent 525e4209
Loading
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -84,5 +84,8 @@ class Checksum(object):
                    else:
                        for file in files:
                            filePath = os.path.abspath(folder) + '/' + file
                            if not os.path.islink(filePath):
                                md5file.write(self.md5sum(filePath) + "  ./" + file + '\n')
                        md5file.close()
                        if os.path.exists(md5FilePath) and os.path.getsize(md5FilePath) == 0:
                            os.remove(md5FilePath)
+6 −3
Original line number Diff line number Diff line
@@ -259,9 +259,12 @@ class DataRPCServer(RedisRPCServer):
        #path = "/home/" + username + "/store"
        path = self.storageStorePath.replace("{username}", username)
        for el in os.listdir(path):
            try:
                absPath = path + '/' + el
                os.chown(absPath, 0, 0)
                os.chmod(absPath, 0o444)
            except OSError:
                self.logger.error(f"Unable to set permissions for '{absPath}', skip.")

    def run(self):
        self.logger.info(f"Starting RPC server of type {self.type}...")
+7 −3
Original line number Diff line number Diff line
@@ -145,8 +145,12 @@ class ImportExecutor(TaskExecutor):
                        dnode.setLocationId(locationId)
                        dnode.setJobId(self.jobId)
                        dnode.setCreatorId(self.userId)
                        if not os.path.islink(file):
                            dnode.setContentLength(os.path.getsize(file))
                            dnode.setContentMD5(self.md5calc.getMD5(file))
                        else:
                            dnode.setContentLength(0)
                            dnode.setContentMD5(None)
                        dnode.setAsyncTrans(True)
                        dnode.setSticky(True)
                        try:
@@ -250,7 +254,7 @@ class ImportExecutor(TaskExecutor):
        
        """
                msg += info
                m.setMessage("VOSpace data storage notification: Job ERROR", msg)
                m.setMessage("VOSpace import notification: Job ERROR", msg)
            # Send e-mail notification
            m.send()
        except Exception:
+1 −1
Original line number Diff line number Diff line
@@ -268,7 +268,7 @@ class RetrieveExecutor(TaskExecutor):
                        osRelParentPath += "/"
                    destDirPath = self.storageRetrievePath.replace("{username}", username) + osRelParentPath
                    os.makedirs(destDirPath, exist_ok = True)
                    sp = subprocess.run(["rsync", "-av", srcPath, destDirPath], capture_output = True)
                    sp = subprocess.run(["rsync", "-av", "--no-links", srcPath, destDirPath], capture_output = True)
                    if(sp.returncode or sp.stderr):
                        self.logger.error(f"FATAL: error during the copy process, returnCode = {sp.returncode}, stderr: {sp.stderr}")
                        return False
+1 −1
Original line number Diff line number Diff line
@@ -116,7 +116,7 @@ class StoreExecutor(TaskExecutor):
                return False
            destPathPrefix = storageBasePath + '/' + self.username
            self.logger.info("Starting data copy...")
            sp = subprocess.run(["rsync", "-av", srcPathPrefix + '/', destPathPrefix + '/'], capture_output = True)
            sp = subprocess.run(["rsync", "-av", "--no-links", srcPathPrefix + '/', destPathPrefix + '/'], capture_output = True)
            if(sp.returncode or sp.stderr):
                self.logger.error("FATAL: an error occurred while copying the data.")
                return False
Loading