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

Issues

Issue #464 resolved

scmserver login page fails to render (javascript error)

Bartosz Luczynski
created an issue

Hello,

After running for about a week the main login page fails to render correctly. The error is apparently Javascript:

ReferenceError: Ext is not defined Ext.ns("Sonia.svn");

I'm attaching a screenshot just so you get an idea of what it looks like.

Last time merely restarting the server fixed the issue, but I'm OK with leaving it running if there's some sort of debug info you need to grab. Looking at the logs, there's nothing. Do let me know what else you want me to look at.

Thanks.

Comments (10)

  1. Sebastian Sebastian repo owner
    • changed status to open

    SCM-Manager loads to javascript files and it looks like that your instance loads only one of them. Could you please check this with the net tab of firebug? Do you use a reverse proxy?

  2. Bartosz Luczynski reporter

    Yes, I can confirm it with firebug. It looks like only one of them loads. The other javascript file, css file and the jpg of the scm logo all return a 404:

    GET /scm/ HTTP/1.1
    HTTP/1.1 200 OK
    GET /scm/resources/958dd4be2e9ad45cee960de7c6b4d8d11c849068.css HTTP/1.1
    HTTP/1.1 404 Not Found
    GET /scm/resources/315ef7691de7191987b9b0f9742e669a3ca11c60.js HTTP/1.1
    HTTP/1.1 404 Not Found
    GET /scm/plugins/resources/js/b7699b268d2c6dba9cc116cd45ad6456edda09f1.js HTTP/1.1
    HTTP/1.1 200 OK
    GET /scm/resources/images/scm-logo.jpg HTTP/1.1
    HTTP/1.1 404 Not Found
    

    That's a no to the reverse proxy.

  3. Sebastian Sebastian repo owner

    Do you use the standalone version of scm-manager? Which os do you use?

    The standalone version prints a log line, like the following during startup:

    2013-10-22 17:20:00.371:INFO:oejw.WebInfConfiguration:Extract jar:file:/usr/local/Cellar/scm-manager/1.34/libexec/var/webapp/scm-webapp.war!/ to /private/var/folders/r3/njgrr7n52x78v4lpc_5fh99h0000gn/T/jetty-0.0.0.0-8181-scm-webapp.war-_scm-any-/webapp
    

    These line contains the location of the expanded webapp. I think the problem is that scm-manager uses the temp directory for this by default and your os clears this directory after a certain time.

    A simple workaround is to create a work directory in the application directory. Your application directory should look like the following, after the creation of the work directory:

    + bin/
    + conf/
    + lib/
    + libexec/
    + tools/
    + var/
    + work/
    - README.txt  
    

    This forces scm-manager to expand the webapp to the work directory instead of the temp directory.

  4. Bartosz Luczynski reporter

    It is the standalone version of the scm-manager sitting in a user directory dedicated for that single purpose. However, I did wrap it with a very minimalist script so it runs as a RHEL service. So yeah, the OS is Red Hat.

    I'm noticing that neither of the work or tools directories exist. I guess I'll try creating them, restarting the service, and seeing if the issue comes back? Any particular reasons why you wouldn't include those dummy directories by default?

    I do see a bunch of scm-related folders in /tmp (including jetty-0.0.0.0*) so I'm assuming that is the issue unless you have a better idea.

  5. Bartosz Luczynski reporter

    As additional info, the system is configured to have tmpwatch running daily, which is what would be wiping /tmp.

    I've manually created the tools and work directories and restarted scm-server. I'm noticing that those directories are empty however and that the startup script is still using /tmp for jetty. Any other ideas?

  6. Sebastian Sebastian repo owner

    Is the work directory writeable for the owner of the scm-server process?

    Could you please try to force the temp directory for the web applications. Please edit the conf/server-config.xml and replace the following lines:

      <New id="scm-webapp" class="org.eclipse.jetty.webapp.WebAppContext">
        <Set name="contextPath">/scm</Set>
        <Set name="war"><SystemProperty name="basedir" default="."/>/var/webapp/scm-webapp.war</Set>
        <!-- disable directory listings -->
        <Call name="setInitParameter">
          <Arg>org.eclipse.jetty.servlet.Default.dirAllowed</Arg>
          <Arg>false</Arg>
        </Call>
      </New>
    
      <New id="docroot" class="org.eclipse.jetty.webapp.WebAppContext">
        <Set name="contextPath">/</Set>
        <Set name="baseResource">
          <New class="org.eclipse.jetty.util.resource.ResourceCollection">
            <Arg>
              <Array type="java.lang.String">
                <Item><SystemProperty name="basedir" default="."/>/var/webapp/docroot</Item>
              </Array>
            </Arg>
          </New>
        </Set>
      </New>
    

    with the following line:

      <New id="scm-webapp" class="org.eclipse.jetty.webapp.WebAppContext">
        <Set name="contextPath">/scm</Set>
        <Set name="war"><SystemProperty name="basedir" default="."/>/var/webapp/scm-webapp.war</Set>
        <!-- disable directory listings -->
        <Call name="setInitParameter">
          <Arg>org.eclipse.jetty.servlet.Default.dirAllowed</Arg>
          <Arg>false</Arg>
        </Call>
        <Set name="tempDirectory">
          <SystemProperty name="basedir" default="."/>/work
        </Set>
      </New>
    
      <New id="docroot" class="org.eclipse.jetty.webapp.WebAppContext">
        <Set name="contextPath">/</Set>
        <Set name="baseResource">
          <New class="org.eclipse.jetty.util.resource.ResourceCollection">
            <Arg>
              <Array type="java.lang.String">
                <Item><SystemProperty name="basedir" default="."/>/var/webapp/docroot</Item>
              </Array>
            </Arg>
          </New>
        </Set>
        <Set name="tempDirectory">
          <SystemProperty name="basedir" default="."/>/work
        </Set>
      </New>
    
  7. Bartosz Luczynski reporter

    Yes, the directory was owned and writeable by scmmanager for both user and group.

    Forcing the temp directories seems to have worked. I now see the webapp folder being created in the work directory and no jetty directories in /tmp.

  8. Log in to comment