1. Sebastian Sebastian
  2. scm-manager
  3. Issues

Issues

Issue #97 resolved

jira-plugin prevents mercurial commits being visible

dutch_gecko
created an issue

Hi

I'm using jira-plugin version 1.3 in combination with a mercurial repository. The plugin is being used purely to provide links to JIRA items, it has not been configured to alter the JIRA item. Sometimes (but not every time) when a user pushes any number of commits, the repository on disk will be updated (the changes can be pulled by other users) but SCM Manager is apparently unaware of the change. Clicking on the Commits link shows an older version of the commit log.

The problem can be fixed by removing the JIRA configuration for the repository. SCM Manager's view of the repository then updates immediately.

I have been unable to find any errors in SCM Manager's log files. However, the line sonia.scm.repository.xml.XmlRepositoryManager - modify repository <repo> of type hg does not appear when the commit is made, instead appearing when the JIRA configuration has been removed.

I have temporarily disabled the plugin, but it would be nice to get the links working again.

Comments (44)

  1. dutch_gecko reporter

    This is the log when I remove the JIRA settings from the repository.

    A bit more info on the setup: SCM Manager is running on linux using its own webserver, but behind an Apache reverse proxy. Up to now this setup hasn't produced any problems. The machine has Mercurial 1.9.2 and Java OpenJDK 1.6.0_17 installed.

  2. Sebastian Sebastian repo owner

    It think mercurial hooks does not run and there is one mercurial hook which clears the cache .But that would mean even without the jira plugin it does not work. Could you test the following without configured jira plugin:

    • Look at the first commit page of a repository
    • Push some commits to that repository
    • Look at the first commit page again

    Did you see a fresh commit page or did you see the old commits?

  3. dutch_gecko reporter
    • changed status to new

    You are correct, without the JIRA plugin configured I am not seeing an update either. I have a few CacheClearHook entries but not one around the time that I pushed.

    I am going to try disabling the jira-plugin altogether since that's the last thing that changed and the setup seemed to work in the past.

  4. dutch_gecko reporter
    • changed status to new

    $ cat hgrc [paths] default = /home/repository/ouderepos/helloworld

    [web] push_ssl = false allow_read = * allow_push = *

    wget downloads scm-manager's index.html page as expected.

  5. Sebastian Sebastian repo owner

    The hook section of your hgrc is missing. Your hgrc should look like this:

    [web]
    push_ssl = false
    allow_read = *
    allow_push = *
    
    [hooks]
    changegroup.scm = python:scmhooks.callback
    pretxnchangegroup.scm = python:scmhooks.callback
    

    How did you create this repository?

  6. dutch_gecko reporter
    • changed status to new

    As far as I can tell all permissions are correct. The jsvc.exec process that scm-manager runs under is using the correct user, and as I said executing the hg command manually as that user succeeds.

  7. Sebastian Sebastian repo owner

    I'm very confused your log shows that your repositories are configured for the /home/repository/.scm/repositories/hg, but mercurial tries to read something of /root. Have the user which is owning the scm-manager process a configured home and is the account privileged to read this directory?

  8. dutch_gecko reporter
    • changed status to open

    This is the relevant line out of /etc/passwd:

    repositoryx507:508::/home/repository:/bin/bash

    The lines out of ps -A u:

    507 46882 0.0 0.0 12380 376 ? Ss 13:03 0:00 jsvc.exec -cp :/home/repository/scm-server/conf:/home/repository/scm-server/lib

    507 46883 113 0.7 5525284 124800 ? Sl 13:03 0:03 jsvc.exec -cp :/home/repository/scm-server/conf:/home/repository/scm-server/lib

    Permissions on /home/repository

    1. ls -ld /home/repository

    drwx------ 6 repository repository 4096 Feb 23 14:03 /home/repository

    Permissions on the repository directory

    $ ls -ld

    drwxr-xr-x 5 repository repository 4096 Feb 7 16:12 .

    $ ls -l

    total 12

    drwxr-xr-x 3 repository repository 4096 Feb 21 10:22 git

    drwxr-xr-x 4 repository repository 4096 Feb 23 12:47 hg

    drwxr-xr-x 2 repository repository 4096 Feb 7 16:12 svn

    As far as I can reasonably tell, this is totally correct

  9. Sebastian Sebastian repo owner

    This looks good, but i do not understand your log:

    12:37:40.042 [qtp1352461710-16] DEBUG sonia.scm.io.SimpleCommand - start external process 'hg init /home/repository/.scm/repositories/hg/mercurialtest '
    12:37:40.074 [qtp1352461710-16] DEBUG sonia.scm.io.SimpleCommand - command returned with exitcode 255
    12:37:40.074 [qtp1352461710-16] TRACE sonia.scm.io.SimpleCommand - command content:
    abort: Permission denied: /root
    

    As you can see the "hg init" process aborts with a permission denied error for the directory /root.

    Have you started scm-manager from the /root directory? Is /root the working directory of scm-manager (ls -l /proc/scm-manager processid/)?

  10. dutch_gecko reporter
    • changed status to new

    lrwxrwxrwx 1 repository repository 0 Feb 23 14:56 cwd -> /root

    You're correct, the cwd is set to /root. I'll try and work around this but I wouldn't normally expect it to be a problem since Mercurial should just be operating in the directory it's been asked to work in, right?

  11. dutch_gecko reporter
    • changed status to open

    I got the new repository feature working. The new hgrc contains the same hook lines you mentioned, and pushing works just fine. Pushing to the first repository still returns the same error.

  12. dutch_gecko reporter
    • changed status to new

    {noformat} $ hg verify checking changesets checking manifests crosschecking files in changesets and manifests checking files 12 files, 67 changesets, 49 total revisions {noformat}

  13. dutch_gecko reporter
    • changed status to open

    % hg --repository D:\testrepo push --debug http://user@server/scm/hg/helloworld pushing to http://user@server/scm/hg/helloworld using http://server/scm/hg/helloworld http auth: user user, password not set sending between command sending capabilities command capabilities: stream changegroupsubset unbundlehash batch httpheader=1024 lookup pushkey known unbundle=HG10GZ,HG10BZ,HG10UN branchmap getbundle sending heads command searching for changes common changesets up to 2db91ae02ee9 51d32b7ca31c cb81e189dbc2 d6fafb5932a4 d8a71cfe6279 sending branchmap command 1 changesets found list of changesets: 43bf18bd0b5bd507c9b23df5aa38c300ad9ba0b5 sending unbundle command sending 328 bytes need more than 1 value to unpack [command returned code 255 Thu Feb 23 15:34:43 2012]

    P.S. how do I create blocks without formatting in these comments? It would make life easier for both of us I'm sure :)

  14. Sebastian Sebastian repo owner

    Error code 255 means permission denied to a file. Could you check the owner for each file of the scm-manager base directory, by using find:

    find /home/repository/.scm -not -user repository
    
  15. dutch_gecko reporter
    • changed status to new
            <repository>
                <properties>
                    <item>
                        <key>jira.url</key>
                        <value></value>
                    </item>
                    <item>
                        <key>jira.project-keys</key>
                        <value></value>
                    </item>
                    <item>
                        <key>jira.auto-close-username-transformer</key>
                        <value>{0}</value>
                    </item>
                    <item>
                        <key>jira.auto-close</key>
                        <value>false</value>
                    </item>
                    <item>
                        <key>jira.update-issues</key>
                        <value>false</value>
                    </item>
                    <item>
                        <key>jira.auto-close-words</key>
                        <value>fixed, fix, closed, close, resolved, resolve</value>
                    </item>
                </properties>
                <contact></contact>
                <creationDate>1328706236371</creationDate>
                <description>Test repository. Hier kan je spelen!</description>
                <id>febdf4f6-3e00-4810-9c2e-8ba6630d32a5</id>
                <lastModified>1329924551222</lastModified>
                <name>helloworld</name>
                <permissions>
                    <groupPermission>false</groupPermission>
                    <name>anonymous</name>
                    <type>WRITE</type>
                </permissions>
                <public>true</public>
                <type>hg</type>
                <url>http://server/scm/hg/helloworld</url>
            </repository>
            <repository>
                <properties/>
                <contact></contact>
                <creationDate>1330005745063</creationDate>
                <description>test repository</description>
                <id>2cac694b-159b-472e-8da5-5f05e46e21a1</id>
                <name>mercurialtest</name>
                <public>false</public>
                <type>hg</type>
            </repository>
    
  16. Log in to comment