You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Ubuntu 14.04下Jenkins无法识别Mercurial仓库求助

Hey there, let's tackle this Jenkins + Mercurial issue on Ubuntu 14.04 step by step—since you had it working smoothly on Windows, we just need to iron out the Ubuntu-specific kinks.

1. First: Verify Jenkins Mercurial Plugin & System Hg Version Compatibility
  • First, check your system's Mercurial version in the terminal:
    hg --version
    
  • Head to Jenkins > Manage Jenkins > Global Tool Configuration, find the Mercurial section:
    • If you're using "System Mercurial", ensure the path matches the output of which hg (usually /usr/bin/hg for Ubuntu 14.04).
    • If you're using "Install automatically", double-check that the plugin supports the Hg version your Ubuntu system can install. Ubuntu 14.04 ships with an older Hg build, so you might need to manually install a compatible version if the plugin requires a newer release.
2. Fix NAS Repository Access & Permissions

Jenkins runs as the jenkins user by default—this is likely where the permission gap is:

  • Switch to the jenkins user to test access directly:
    sudo -u jenkins bash
    
  • Try cloning the NAS repository from this shell:
    hg clone <your-NAS-repo-path>
    
    • If your NAS is mounted locally (e.g., /mnt/nas-hg-repo), check that the jenkins user has read/write access:
      ls -l /mnt/nas-hg-repo
      # Adjust permissions if needed
      sudo chmod -R 755 /mnt/nas-hg-repo
      sudo usermod -aG <nas-mount-group> jenkins
      
    • If using a network path (HTTP/SSH/SMB):
      • For SSH: Ensure the jenkins user's SSH key is added to the NAS's authorized keys.
      • For HTTP/SMB: Verify the credentials in Jenkins' SCM config match what the NAS expects, and that the jenkins user can resolve the NAS's IP address.
3. Correct Jenkins Project Repository Paths
  • In your Jenkins project's SCM config (Mercurial section):
    • If using your local TortoiseHG-managed repo, use the absolute path (e.g., /home/your-username/hg-local-repo), not a relative path.
    • Note: Your user home directory (/home/your-username) is usually set to 700 permissions by default, which blocks the jenkins user from accessing it. Fix this with:
      chmod 755 /home/your-username
      
      Or move the repo to a more accessible location like /var/lib/jenkins/repos.
4. Align TortoiseHG & System Hg Versions
  • Check if your TortoiseHG instance is using a custom Hg version (not the system-wide one). Open TortoiseHG's settings and confirm the Hg path matches what you configured in Jenkins. Version mismatches can cause unexpected repository recognition failures.
5. Dig Into Jenkins Logs for Specific Errors
  • When a build fails, check the project's build logs or go to Manage Jenkins > System Log for detailed error messages. For example:
    • "abort: HTTP Error 403: Forbidden" = NAS permissions are blocking Jenkins
    • "abort: repository not found" = Incorrect repo path in Jenkins config
    • "permission denied" = jenkins user can't access the local repo or NAS mount

内容的提问来源于stack exchange,提问作者Will

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.11 08:37:35