# smt-mirror "Cannot read the local base path"

**URL:** <https://forums.suse.com/t/smt-mirror-cannot-read-the-local-base-path/27116>\
**Category:** SLES Updates\
**Created:** [June 5, 2015, 6:52am UTC](https://forums.suse.com/t/smt-mirror-cannot-read-the-local-base-path/27116 "2015-06-05T06:52:38Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![markcasey](https://avatars.discourse-cdn.com/v4/letter/m/e480ec/32.png) [@markcasey](https://forums.suse.com/u/markcasey)\
**Post date:** [June 5, 2015, 6:52am UTC](https://forums.suse.com/t/smt-mirror-cannot-read-the-local-base-path/27116/1 "2015-06-05T06:52:38Z")

</div>

Hi  
I have some problems with my Apache system and now my SMT is not mirroring.

When I run smt-mirror I get the above error

my SMT.conf has the entry  
MirrorTo = /srv/www/vhosts/sles.pegasustech.com.au/smt

I made a backup copy of smt-mirror and changed the relevant section as follows

if(!defined $LocalBasePath || $LocalBasePath eq “” )  
{  
$LocalBasePath = $cfg-\>val(“LOCAL”, “MirrorTo”);  
print "\

> $LocalBasePath\<   
> ";  
> if(!-d $LocalBasePath)  
> {  
> SMT::Utils::printLog($LOG, $vblevel, LOG\_ERROR, \_\_(“Cannot read the local base path \>$LocalBasePath\<”));  
> SMT::Utils::unLockAndExit( “smt-mirror”, 1, $LOG, $vblevel );  
> }  
> }

When I run the altered file i get

> /srv/www/vhosts/sles.pegasustech.com.au/smt\<  
> Cannot read the local base path \>/srv/www/vhosts/sles.pegasustech.com.au/smt\<

So I created a test program  
#!/usr/bin/perl -w

# 

use strict;  
my $aaa=“/srv/www/vhosts/sles.pegasustech.com.au/smt”;

print "\>$aaa\<   
";

if ( !-d $aaa) {  
print "NotFound   
";  
}  
else {  
print "Found   
";  
}

Running the Test Program returns:

> /srv/www/vhosts/sles.pegasustech.com.au/smt\<  
> Found

Oh, the directory does exist owner smt:www

Why is the result different between these two ??

Thanks in advance

Mark

---

<div class="post-metadata">

**Author:** ![Jens-U](https://avatars.discourse-cdn.com/v4/letter/j/d78d45/32.png) [@Jens-U](https://forums.suse.com/u/Jens-U)\
**Post date:** [June 5, 2015, 5:54pm UTC](https://forums.suse.com/t/smt-mirror-cannot-read-the-local-base-path/27116/2 "2015-06-05T17:54:44Z")

</div>

Hi Mark,

I couldn’t spot any functional difference between the two programs, so I have only left a shot into the dark: what does “ls -ld /srv/www/vhosts/sles.pegasustech.com.au/smt; df /srv/www/vhosts/sles.pegasustech.com.au/smt” give and as which user(s) are you running smt-mirror / your test program?

You did mention the directory ownership, but neither the actual permissions that are set nor if the directory is i.e. mounted via NFS (and the target server has root\_squash activated), hence above commands.

Regards,  
Jens

---

<div class="post-metadata">

**Author:** ![markcasey](https://avatars.discourse-cdn.com/v4/letter/m/e480ec/32.png) [@markcasey](https://forums.suse.com/u/markcasey)\
**Post date:** [June 7, 2015, 4:18am UTC](https://forums.suse.com/t/smt-mirror-cannot-read-the-local-base-path/27116/3 "2015-06-07T04:18:35Z")

</div>

[QUOTE=jmozdzen;28239]Hi Mark,

I couldn’t spot any functional difference between the two programs, so I have only left a shot into the dark: what does “ls -ld /srv/www/vhosts/sles.pegasustech.com.au/smt; df /srv/www/vhosts/sles.pegasustech.com.au/smt” give and as which user(s) are you running smt-mirror / your test program?

You did mention the directory ownership, but neither the actual permissions that are set nor if the directory is i.e. mounted via NFS (and the target server has root\_squash activated), hence above commands.

Regards,  
Jens[/QUOTE]

Hi Jens

Thanks for the help

Yes it is an NFS mount, so I ran the commands against the unmounted diretcory and the mounted one - Same result  
As its only checking for the existance of smt, the directory, it should work in the unmounted state.

See unmounted test and mounted test below

Mark

umount /srv/www/vhosts/sles.pegasustech.com.au/smt  
pegasus-apache-01:/srv/www/vhosts/sles.pegasustech.com.au # df /srv/www/vhosts/sles.pegasustech.com.au/smt  
Filesystem 1K-blocks Used Available Use% Mounted on  
/dev/sdb1 20125340 1156296 17946736 7% /srv/www  
pegasus-apache-01:/srv/www/vhosts/sles.pegasustech.com.au # ls -ld /srv/www/vhosts/sles.pegasustech.com.au/smt  
drwxr-xr-x 3 wwwrun www 4096 May 25 14:16 /srv/www/vhosts/sles.pegasustech.com.au/smt  
pegasus-apache-01:/srv/www/vhosts/sles.pegasustech.com.au # smt-mirror1

> /srv/www/vhosts/sles.pegasustech.com.au/smt\<  
> Cannot read the local base path \>/srv/www/vhosts/sles.pegasustech.com.au/smt\<

pegasus-apache-01:/srv/www/vhosts/sles.pegasustech.com.au # mount -a  
pegasus-apache-01:/srv/www/vhosts/sles.pegasustech.com.au # df /srv/www/vhosts/sles.pegasustech.com.au/smt  
Filesystem 1K-blocks Used Available Use% Mounted on  
10.242.200.248:/vol/slesSMT 838860800 410776256 428084544 49% /srv/www/vhosts/sles.pegasustech.com.au/smt  
pegasus-apache-01:/srv/www/vhosts/sles.pegasustech.com.au # ls -ld

---

<div class="post-metadata">

**Author:** ![markcasey](https://avatars.discourse-cdn.com/v4/letter/m/e480ec/32.png) [@markcasey](https://forums.suse.com/u/markcasey)\
**Post date:** [June 7, 2015, 4:56am UTC](https://forums.suse.com/t/smt-mirror-cannot-read-the-local-base-path/27116/4 "2015-06-07T04:56:40Z")

</div>

Hi Jens

Got it  
I put  
system("/usr/bin/id");  
system("/bin/ls -l $LocalBasePath");  
in my test program and fount it returned smt and www as the executing user and group, and failed on the ls

The parent diretcory had ownership of wwwrun and www, but only user access rights. adding access to the parent directory for group solved the problem

Thanks for your help

Mark

---

<div class="post-metadata">

**Author:** ![Jens-U](https://avatars.discourse-cdn.com/v4/letter/j/d78d45/32.png) [@Jens-U](https://forums.suse.com/u/Jens-U)\
**Post date:** [June 9, 2015, 4:02pm UTC](https://forums.suse.com/t/smt-mirror-cannot-read-the-local-base-path/27116/5 "2015-06-09T16:02:32Z")

</div>

Hi Mark,

good to hear you got it working, and thank you for reporting how!

Regards,  
Jens
