Menu

problems creating repos

Help
2007-10-22
2013-05-01
  • Marijn Verkerk

    Marijn Verkerk - 2007-10-22

    I've been using the SVNManager since ver.0.38 without any problem, but
    lately when i tried installing and configuring SVNmanager-1.03, I'm
    having issue of creating empty repo via svnmanager; Whereas creating
    repo in command-line works perfect.

    The following is my config.php

    //Shell command's
    $htpassword_cmd             =       "/usr/local/apache2/bin/htpasswd";
    $svn_cmd                    =       "/usr/local/bin/svn";
    $svnadmin_cmd               =       "/usr/local/bin/svnadmin";

    //Subversion locations
    $svn_repos_loc              =       "/backup/repos";
    $svn_passwd_file            =       "/backup/repos/passwdfile";
    $svn_access_file            =       "/backup/repos/accessfile";

    Platform:
    CentOS4/5+Apache-2.2.6+PHP-5.2.4+MySQL-5.0+subversion-1.4.5(source)

    The rest of the options work fine, eg: users administration. I even
    tried with the previos release, but the same issue still persist.

    Please advice. And hope to hear from you soon. TQ.

     
    • Marijn Verkerk

      Marijn Verkerk - 2007-10-22

      (I have forwarded this message from email)

      Dear Sir, Madam,

      My guess would be a permission problem. Have permission or owner rights changed when it stopped working? Please make sure that the repos folder can be read and written by the user that runs the www server.

      Kind regards,
      Marijn Verkerk

       
      • Anonymous

        Anonymous - 2007-10-22

        Another permission-problem could be, that the apache-user can't execute /usr/local/bin/svnadmin.

         
    • PGS

      PGS - 2007-10-23

      Thanks for the reply...
      Let's summarize the problem with the following details,

      apache-user: svnmanager

      # ll /backup/
      drwxr-xr-x  5 svnmanager svnmanager 4096 Oct 23 10:17 repos

      # ll /usr/local/bin/|grep svn
      -rwxr-xr-x  1 root root   322426 Oct 23 14:48 svn
      -rwxr-xr-x  1 root root    49736 Oct 23 14:48 svnadmin

      When i create repo via svnmanager, an empty folder(instead of an working repo) will just created on /backup, so i guess permission is not an issue here.

      does svnmanager create repo with the command "/usr/local/bin/svnadmin create"? Because even i changed the config.php to
      $svn_cmd = "/usr/svn";
      $svnadmin_cmd = "/usr/svnadmin";
      or any un-exist command, it will just create an empty folder; ignoring the whole config script.

      At the meantime, i can only manually creating the repo in command-line and import into svnmanager. I really hope that's a solution for this trouble.

      Welcome for any reply as regards.

      cheers,
      W.L.Yap

       
      • Anonymous

        Anonymous - 2007-10-23

        Are you running the PHP in safe_mode or is "exec" contained in disable_functions?

         
    • PGS

      PGS - 2007-10-24

      safe_mode = Off

      ; This directive allows you to disable certain functions for security reasons.
      ; It receives a comma-delimited list of function names. This directive is
      ; *NOT* affected by whether Safe Mode is turned On or Off.
      disable_functions =

       
      • Anonymous

        Anonymous - 2007-10-24

        Insert
        error_log("[svnmanager#createRepository: dir=".$dir)
        error_log("[svnmanager#createRepository: svnadmin_cmd=".$svnadmin_cmd." create ".$a_dir)
        into the code of svnmanager/RepositoryModule/DataModule.php at the beginning of the else-branch of the function createRepository. It should look like this:
        } else {
           error_log("[svnmanager#createRepository: dir=".$dir)
           error_log("[svnmanager#createRepository: svnadmin_cmd=".$svnadmin_cmd." create ".$a_dir)
           //Create repository
           mkdir($dir);
        Now try to create a repository und look into your error.log. There should be this inserted stuff or the message that the server can't create the directory.

         
    • PGS

      PGS - 2007-10-25

      I've found the following error on my apache error log,

      PHP Parse error:  syntax error, unexpected T_STRING in /home/svnmanager/www/svnmanager/svnmanager/RepositoryModule/DataModule.php on line 60, referer: http://dino.intra.abamon.com/svnmanager/index.php?page=Main:StartPage

      47         public function createRepository($userid, $name, $description)
      48         {
      49                 require "config.php";
      50
      51                 $rname = strtolower($name);
      52                 $dir = $svn_repos_loc.DIRECTORY_SEPARATOR.$rname;
      53
      54                 if(file_exists($dir))
      55                 {
      56                         error_log("Can't make repository, $dir already exists.'");
      57                         return;
      58                 } else {
      59                         error_log("[svnmanager#createRepository: dir=".$dir)
      60                         error_log("[svnmanager#createRepository: svnadmin_cmd=".$svnadmin_cmd." create ".$a_dir)
      61                         //Create repository
      62                         mkdir($dir);
      63                         exec($svnadmin_cmd." create ".$dir);
      64
      65                         //Add repository into database
      66                         $result = $this->Database->Execute("INSERT INTO repositories (id, name, ownerid) VALUES (null, '$rname', '$userid')");

      is it been correctly inserted as what you've suggested?

       
      • Anonymous

        Anonymous - 2007-10-25

        Sorry... too much python the last days :)
        You have to finish the lines with ";".

        Could you please try to write your replies as followup to the post you refers to? It would be more easier for later readers to follow this thread :)

         
    • PGS

      PGS - 2007-10-25

      oops.. sorry...

      Alright, the lines have been corrected. And still the svnmanager is creating empty repo without any error captured.

       
      • Anonymous

        Anonymous - 2007-10-25

        No message in Apaches error-log? then it seems to be a more serious problem, because the whole createRepository-method isn't called.
        Please insert some more error_log's in CreatePage.php:

        at the beginning of CreatePage#onInit(...) right after "parent::onInit($param);" insert error_log("[svnmanager#onInit()]: Entered onInit");

        at the beginning of CreatePage.php#onConfirmBtn(...) before "if($this->IsValid)" insert error_log("[svnmanager#onConfirmBtn: Entered onConfirmBtn - ".$this->IsValid);

        before "$name = strtolower(trim($this->Name->Text));" insert error_log("[svnmanager#createRepository: Entered first then");

        before "$this->Module->createRepository(...);" insert error_log("[svnmanager#createRepository: before createRepository");

        after "$this->Module->createRepository(...);" insert error_log("[svnmanager#createRepository: after createRepository");

        after the closing bracket of the first if (the bracket after "//$this->Application->transfer("Repository:AdminPage");") insert
        else{
          error_log("[svnmanager#createRepository: Entered first else");
        }
        error_log("[svnmanager#createRepository: Leaving onConfirmBtn");"

        Please post the name of the repository you are trying to create, the relevant part of your error-log and a description, what happens when you are clicking the confirm-button to create a new repository.

         
    • Marijn Verkerk

      Marijn Verkerk - 2007-10-28

      Could you please also try the following:

      - Go to the backup/svnmanager directory
      - su svnmanager  <- change to svnmanager user, should be possible as root
      - try to create a repository manually:
        - mkdir testrepos
        - svnadmin testrepos

      Regards,
      Marijn

       
    • PGS

      PGS - 2007-10-29

      Quote: banzai99

      Create folder "manager"
      [Mon Oct 29 11:05:02 2007] [error] [client 10.10.10.59] [svnmanager#createRepository: dir=/data/repos/manager, referer: http://local.domain.com/svnmanager/index.php?page=Repository:CreatePage
      [Mon Oct 29 11:05:02 2007] [error] [client 10.10.10.59] [svnmanager#createRepository: svnadmin_cmd=/usr/local/bin/svnadmin create create /data/repos/manager, referer: http://local.domain.com/svnmanager/index.php?page=Repository:CreatePage

      So sorry, i've missed the error log previously. So these are the errors i got while creating the repo. The createRepository-method does work but it's still creating empty repo.

      Quote: mverkerk

      As suggested, i've no problem in manually creating repo either in "svnmanager" or "root".
      Im currently using this method to run svnmanager actually.
      - svnadmin create repo (manual)
      - import into svnmanager

      Though tedious at some point, but it works for me at this moment.

       
      • Anonymous

        Anonymous - 2007-10-29

        Does it create the directory when you ty to create the repository by SVNManager (but failing)?

        change the exec-line in DataModule to:
        exec($svnadmin_cmd." create ".$a_dir,$nul,$retval);
        error_log("[svnmanager] Return-value: ".$retval);

        The only way I could reproduce a similar behavior (success-message but nothing is created) is to do something strange with apaches user-rights. On my windows-box I disallowed creation of folders but the root-folder was created but not the stuff of svnadmin. I changed the rights again and now I can't reproduce it again.

        @mverkerk: You should check the return-code of exec and passthrou to throw an error if it fails.

         
      • Marijn Verkerk

        Marijn Verkerk - 2007-11-03

        The user that runs the httpd server is 'svnmanager', right?

        Have you tried to create a repository being this user?

        Marijn

         
    • PGS

      PGS - 2007-11-02

      Yes, it does creates the directory.

      I've append the following lines:
      exec($svnadmin_cmd." create ".$a_dir,$nul,$retval);
      error_log("[svnmanager] Return-value: ".$retval);
      in DataModule.php

      and here are the results:
      [Fri Nov 02 10:01:51 2007] [error] [client XX.XX.XX.XX] [svnmanager#createRepository: dir=/data/repos/myrepo, referer: http://local.domain.com/svnmanager/index.php?page=Repository:CreatePage
      [Fri Nov 02 10:01:51 2007] [error] [client XX.XX.XX.XX] [svnmanager#createRepository: svnadmin_cmd=/usr/local/bin/svnadmin create /data/repos/myrepo, referer: http://local.domain.com/svnmanager/index.php?page=Repository:CreatePage
      [Fri Nov 02 10:01:51 2007] [error] [client XX.XX.XX.XX] [svnmanager] Return-value: 1, referer: http://local.domain.com/svnmanager/index.php?page=Repository:CreatePage

      The repo created is still an empty directory.

       
      • Anonymous

        Anonymous - 2007-11-02

        That's very good... insert the following line:
        error_log("[svnmanager] Output: ".$nul);
        after the line reporting the return-value. Then we'll have the cause written in the error_log.

         

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.