Atlassian Fisheye Crucible - Init.d 服务 fisheye 不存在默认权限方案创建名称为 'defaultMentionParserListener' 的 bean 时出错

Atlassian Fisheye Crucible - Init.d service fisheye No default permission scheme exists Error creating bean with name 'defaultMentionParserListener'

Ubuntu 14.04(VirtualBox/Vagrant 机器)。

鱼眼神器zip version: 3.9.1

由于它没有附带 init.d 级别的启动脚本,我创建了以下脚本 /etc/init.d/fisheye:

#!/bin/bash

# FISHEYE_HOME: The path to the FishEye installation. It's recommended to create a symbolic link to the latest version so
# the process will still work after upgrades. Be sure to update the symlink itself when upgrading.
# Example: ln -s /usr/local/atlassian/applications/fisheye/4.2.0 /usr/local/atlassian/applications/fisheye/latest
FISHEYE_HOME="/mnt/fecru-3.9.1"

# FISHEYE_INST: The path to store Fisheye data.
# The 2 lines below should be uncommented only if you don't have the environment variables set in /etc/environment file.
#export FISHEYE_INST="/mnt/fecru-3.9.1_fisheye_data"
#mkdir -p $FISHEYE_INST || sudo mkdir -p $FISHEYE_INST

fisheyectl() {
    if [ ! -f "$FISHEYE_HOME/fisheyeboot.jar" ] ; then
       echo "Error: Could not find $FISHEYE_HOME/fisheyeboot.jar"  
       exit 1
    fi
    #exec "$FISHEYE_HOME/bin/fisheyectl.sh" ""
    "$FISHEYE_HOME/bin/fisheyectl.sh" ""
}

case "" in
        start)
                fisheyectl start
                ;;
        stop)
                fisheyectl stop
                ;;
        restart)
                fisheyectl stop
                sleep 10
                fisheyectl start
                ;;
        status)
                fecru_pid=$(ps -eAf|grep fecru|grep -v grep|sed "s/[ \t][ \t]*/ /g"|cut -d" " -f2|head -1)
                if [[ -n "${fecru_pid}" ]]; 
                then
                    echo "Process 'fecru' fisheye/crucible is running. PID (${fecru_pid})"
                else
                    echo "Process 'fecru' fisheye/crucible is NOT running."
                fi
                ;;

        *)
                echo "Usage: [=12=] {start|stop|status|restart}"
esac

echo "- Log files are available here:" 
if [[ -n "${FISHEYE_INST}" ]]; 
then
  echo "$(find "${FISHEYE_INST}/var/log" | sed "s/^/  /")"; 
else
  echo "$(find "${FISHEYE_HOME}/var/log" | sed "s/^/  /")"
fi
echo

exit 0

作为 root 用户,当我尝试 运行 service fisheye start 时,我看到它启动了进程,但最后失败并显示以下主要错误。

2017-03-03 19:59:30,586 ERROR - No default permission scheme exists
2017-03-03 19:59:30,743 ERROR - The Web context could not be started
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'defaultMentionParserListener' defined in URL 

完整日志: /mnt/fecru-3.9.1/var/log/fisheye.out file: download here

我怎样才能下定决心并开始使用鱼眼? 文件夹 /mnt/fecru-3.9.1 对用户 root.

具有有效的 775 权限(递归设置)

在 fisheyectl.sh 文件上打开调试 (shell / bash -x) 选项,显示:

+ CMD=/usr/bin/java  -Xmx1024m  -Dfisheye.library.path= -Dfisheye.inst=/mnt/fecru-3.9.1 -Djava.awt.headless=true -Djava.endorsed.dirs=/mnt/fecru-3.9.1/lib/endorsed -jar /mnt/fecru-3.9.1/fisheyeboot.jar start 
+ echo Starting FishEye/Crucible... Output redirected to /mnt/fecru-3.9.1/var/log/fisheye.out
Starting FishEye/Crucible... Output redirected to /mnt/fecru-3.9.1/var/log/fisheye.out
+ whoami
root
+ echo

+ echo

+ nohup sh -c exec /usr/bin/java  -Xmx1024m  -Dfisheye.library.path= -Dfisheye.inst=/mnt/fecru-3.9.1 -Djava.awt.headless=true -Djava.endorsed.dirs=/mnt/fecru-3.9.1/lib/endorsed -jar /mnt/fecru-3.9.1/fisheyeboot.jar start 

我不必 root。我求助于 root 用户,因为我遇到了那些奇怪的权限问题,即使两个 vagrant/root 用户都在 /mnt/fecru-3.9.1 文件夹上递归设置了 775(vag运行t:root as chown) .

解决方案是: 1) 我更改了 init.d 关卡脚本以设置 FISHEYE_INST 文件夹(不同于 /mnt/fecru-3.9.1 文件夹。

#!/bin/bash

# FISHEYE_HOME: The path to the FishEye installation. It's recommended to create a symbolic link to the latest version so
# the process will still work after upgrades. Be sure to update the symlink itself when upgrading.
# Example: ln -s /usr/local/atlassian/applications/fisheye/4.2.0 /usr/local/atlassian/applications/fisheye/latest
FISHEYE_HOME="/mnt/fecru-3.9.1"

# FISHEYE_INST: The path to store Fisheye data.
# The 2 lines below should be uncommented only if you don't have the environment variables set in /etc/environment file.
export FISHEYE_INST="/mnt/fecru-3.9.1_fisheye_data"
mkdir -p $FISHEYE_INST || sudo mkdir -p $FISHEYE_INST

fisheyectl() {
    if [ ! -f "$FISHEYE_HOME/fisheyeboot.jar" ] ; then
       echo "Error: Could not find $FISHEYE_HOME/fisheyeboot.jar"  
       exit 1
    fi
    "$FISHEYE_HOME/bin/fisheyectl.sh" "" 
}

case "" in
        start)
                fisheyectl start
                ;;
        stop)
                fisheyectl stop
                ;;
        restart)
                fisheyectl stop
                sleep 10
                fisheyectl start
                ;;
        status)
        fecru_pid=$(ps -eAf|grep fecru|grep -v grep|sed "s/[ \t][ \t]*/ /g"|cut -d" " -f2|head -1)
                if [[ -n "${fecru_pid}" ]]; 
                then
                    echo "Process 'fecru' fisheye/crucible is running. PID (${fecru_pid})"
                else
                    echo "Process 'fecru' fisheye/crucible is NOT running."
                fi
                ;;

        *)
                echo "Usage: [=10=] {start|stop|status|restart}"
esac

echo "- Log files are available here:" 
if [[ -n "${FISHEYE_INST}" ]]; 
then
  echo "$(find "${FISHEYE_INST}/var/log" 2>/dev/null | sed "s/^/  /")"; 
else
  echo "$(find "${FISHEYE_HOME}/var/log" 2>/dev/null | sed "s/^/  /")"
fi
echo

exit 0

2) 注意:/mnt/fecru-3.9.1 文件夹是我通过解压我放在 /mnt 文件夹下的工件得到的。 3) 当我设置 FISHEYE_INST 变量时,进程将使用该文件夹(对于 运行 Fisheye/Crucible)进程并将其 data/log 存储在 /mnt/fecru-3.9.1_fisheye_data

4) 现在我可以是具有有效 sudo 访问权限的任何用户(不必是 root)。

5) 所以我 运行: sudo service fisheye start, sudo service fisheye status, 这个开始步骤在端口 8060(默认)上启动了鱼眼门户。

vagrant@myubuntuvagrant:~$ sudo service fisheye status
Process 'fecru' fisheye/crucible is running. PID (9080)
- Log files are available here:
  /mnt/fecru-3.9.1_fisheye_data/var/log
  /mnt/fecru-3.9.1_fisheye_data/var/log/atlassian-fisheye-2017-03-03.log
  /mnt/fecru-3.9.1_fisheye_data/var/log/fisheye.out

这次日志文件(根据新位置 FISHEYE_INST)是:/mnt/fecru-3.9.1_fisheye_data/var/log/fisheye.out 并且显示如下:

    17  2017-03-03 21:25:54,927 INFO  - =======================================================
    18  2017-03-03 21:25:54,927 INFO  - 
    19  2017-03-03 21:25:54,928 INFO  - Welcome to FishEye!
    20  2017-03-03 21:25:54,928 INFO  - 
    21  2017-03-03 21:25:54,928 INFO  - You need to configure an admin password and enter your
    22  2017-03-03 21:25:54,928 INFO  - license key. You can do this by accessing FishEye through
    23  2017-03-03 21:25:54,928 INFO  - a web browser, once the server has started:
    24  2017-03-03 21:25:54,928 INFO  - 
    25  2017-03-03 21:25:54,935 INFO  - http://myubuntuvagrant:8060
    26  2017-03-03 21:25:54,935 INFO  - 
    27  2017-03-03 21:25:54,936 INFO  - Refer to the FishEye administration guide
    28  2017-03-03 21:25:54,936 INFO  - for more information:
    29  2017-03-03 21:25:54,936 INFO  - 
    30  2017-03-03 21:25:54,937 INFO  - https://confluence.atlassian.com/display/FISHEYE/Starting+to+use+FishEye
    31  2017-03-03 21:25:54,937 INFO  - 
    32  2017-03-03 21:25:54,937 INFO  - =======================================================
    33  2017-03-03 21:25:54,937 INFO  - 
    34  2017-03-03 21:25:54,940 INFO  - Your Server ID is B0SX-F5FH-3753-40DM
    35  2017-03-03 21:25:55,251 INFO  - Adding secondary content dir of /mnt/fecru-3.9.1_fisheye_data/content
    36  2017-03-03 21:26:02,175 INFO  - Starting database...
    37  2017-03-03 21:26:03,233 INFO  - BoneCP - tracking statements enabled for pool [mainPool]
    38  2017-03-03 21:26:05,304 INFO  - BoneCP - tracking statements enabled for pool [retriablePool]
    39  2017-03-03 21:26:05,786 INFO  - Database started.
    40  2017-03-03 21:26:07,515 INFO  - Starting plugin system...
2017-03-03 21:25:54,937 INFO  - 
2017-03-03 21:25:54,937 INFO  - =======================================================
2017-03-03 21:25:54,937 INFO  - 
2017-03-03 21:25:54,940 INFO  - Your Server ID is B0SX-F5FH-3753-40DM
2017-03-03 21:25:55,251 INFO  - Adding secondary content dir of /mnt/fecru-3.9.1_fisheye_data/content
2017-03-03 21:26:02,175 INFO  - Starting database...
2017-03-03 21:26:03,233 INFO  - BoneCP - tracking statements enabled for pool [mainPool]
2017-03-03 21:26:05,304 INFO  - BoneCP - tracking statements enabled for pool [retriablePool]
2017-03-03 21:26:05,786 INFO  - Database started.
2017-03-03 21:26:07,515 INFO  - Starting plugin system...
2017-03-03 21:26:11,119 INFO  - Mail system not configured.
2017-03-03 21:26:55,616 INFO  - Plugin system started.
2017-03-03 21:26:57,088 INFO  - Server started on :8060 (http) (control port on 127.0.0.1:8059)

注意:由于我使用的是 Vag运行t 机器,在我的 vag运行t 文件的配置 Vagrantfile 中,我的来宾虚拟机上有以下端口映射(ubuntu) 和我的主机 (Mac OS).

  # Create a forwarded port mapping which allows access to a specific port
  # within the machine from a port on the host machine. In the example below,
  # accessing "localhost:8080" will access port 80 on the guest machine.
  config.vm.network "forwarded_port", guest: 80, host: 8180
  config.vm.network "forwarded_port", guest: 8060, host: 8160

这意味着,我可以在主机 Mac 机器上的端口 8060 上访问访客虚拟机中的 application/portal 运行 作为端口 8160。

因此,执行 http://localhost:8160 -OR- http://10.20.30.40:8160(我的 Mac 机器的 IP)将显示我可以轻松配置的鱼眼门户 运行。

我不知道为什么默认安装文件夹是 /mnt/fecru-3.9.1,因为我已经注释掉了 FISHEYE_INST 变量,然后即使设置了 user/owner 和组,我仍然收到这些错误到 vagrant/root 并在整个路径中具有 775 权限。

设置FISHEYE_INST解决了这个问题。

这个 init.d 脚本还可以通过添加一点逻辑来创建 PID 文件来增强。

操作 startstoprestartstatus 都按预期工作。

vagrant@myubuntuvagrant:~$ sudo service fisheye status
Process 'fecru' fisheye/crucible is running. PID (9080)
- Log files are available here:
  /mnt/fecru-3.9.1_fisheye_data/var/log
  /mnt/fecru-3.9.1_fisheye_data/var/log/atlassian-fisheye-2017-03-03.log
  /mnt/fecru-3.9.1_fisheye_data/var/log/fisheye.out

vagrant@myubuntuvagrant:~$ sudo service fisheye stop
INFO  - Using log4j configuration file: /mnt/fecru-3.9.1/log4j-client.xml
INFO  - FishEye arguments: []
FishEye Shutdown successfully
Problem connecting to 127.0.0.1:8059
java.net.SocketException: Connection reset
    at java.net.SocketInputStream.read(SocketInputStream.java:210)
    at java.net.SocketInputStream.read(SocketInputStream.java:141)
    at sun.nio.cs.StreamDecoder.readBytes(StreamDecoder.java:284)
    at sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:326)
    at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:178)
    at java.io.InputStreamReader.read(InputStreamReader.java:184)
    at java.io.BufferedReader.fill(BufferedReader.java:161)
    at java.io.BufferedReader.readLine(BufferedReader.java:324)
    at java.io.BufferedReader.readLine(BufferedReader.java:389)
    at com.cenqua.fisheye.ctl.BaseRemoteCommand.sendCommand(BaseRemoteCommand.java:96)
    at com.cenqua.fisheye.ctl.BaseRemoteCommand.mainImpl(BaseRemoteCommand.java:57)
    at com.cenqua.fisheye.ctl.Stop.main(Stop.java:11)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at com.cenqua.fisheye.FishEyeCtl.mainImpl(FishEyeCtl.java:101)
    at com.cenqua.fisheye.FishEyeCtl.main(FishEyeCtl.java:44)
- Log files are available here:
  /mnt/fecru-3.9.1_fisheye_data/var/log
  /mnt/fecru-3.9.1_fisheye_data/var/log/atlassian-fisheye-2017-03-03.log
  /mnt/fecru-3.9.1_fisheye_data/var/log/fisheye.out
  /mnt/fecru-3.9.1_fisheye_data/var/log/atlassian-fisheyectl-2017-03-03.log

vagrant@myubuntuvagrant:~$ sudo service fisheye status
Process 'fecru' fisheye/crucible is NOT running.
- Log files are available here:
  /mnt/fecru-3.9.1_fisheye_data/var/log
  /mnt/fecru-3.9.1_fisheye_data/var/log/atlassian-fisheye-2017-03-03.log
  /mnt/fecru-3.9.1_fisheye_data/var/log/fisheye.out
  /mnt/fecru-3.9.1_fisheye_data/var/log/atlassian-fisheyectl-2017-03-03.log

vagrant@myubuntuvagrant:~$ sudo service fisheye start
Starting FishEye/Crucible... Output redirected to /mnt/fecru-3.9.1_fisheye_data/var/log/fisheye.out
- Log files are available here:
  /mnt/fecru-3.9.1_fisheye_data/var/log
  /mnt/fecru-3.9.1_fisheye_data/var/log/atlassian-fisheye-2017-03-03.log
  /mnt/fecru-3.9.1_fisheye_data/var/log/fisheye.out
  /mnt/fecru-3.9.1_fisheye_data/var/log/atlassian-fisheyectl-2017-03-03.log

vagrant@myubuntuvagrant:~$ sudo service fisheye status
Process 'fecru' fisheye/crucible is running. PID (9657)
- Log files are available here:
  /mnt/fecru-3.9.1_fisheye_data/var/log
  /mnt/fecru-3.9.1_fisheye_data/var/log/atlassian-fisheye-2017-03-03.log
  /mnt/fecru-3.9.1_fisheye_data/var/log/fisheye.out
  /mnt/fecru-3.9.1_fisheye_data/var/log/atlassian-fisheyectl-2017-03-03.log

vagrant@myubuntuvagrant:~$ 

6) 门户(根据映射端口 8160)就像:

注意:对于在 reboot/boot 时间自动启动 fisheye service/process 的机器,我 运行 以下内容: sudo update-rc.d fisheye defaults 并确保 /etc/init.d/fisheye 文件具有有效的 755 可执行权限。

为了测试这一点,在我完成上述操作后,我退出了我的 Ubuntu vag运行t 机器,转到了我的 Vagrantfile 所在的文件夹,和 运行 以下命令:vagrant halt; vagrant up; vagrant ssh。我又一次登录到我的 vag运行t 机器,我在其中 运行 以下内容以确保 Fisheye/Crucible service/process 是由 运行 运行 :

vagrant@myubuntuvagrant:~$ ps -eAf|grep fecru
root      1119     1 65 21:55 ?        00:00:21 /usr/bin/java -Xmx1024m -Dfisheye.library.path= -Dfisheye.inst=/mnt/fecru-3.9.1_fisheye_data -Djava.awt.headless=true -Djava.endorsed.dirs=/mnt/fecru-3.9.1/lib/endorsed -jar /mnt/fecru-3.9.1/fisheyeboot.jar start
vagrant   2023  1924  0 21:55 pts/0    00:00:00 grep --color=auto fecru
vagrant@myubuntuvagrant:~$ date
Fri Mar  3 21:55:39 UTC 2017
vagrant@myubuntuvagrant:~$ sudo service fisheye status
Process 'fecru' fisheye/crucible is running. PID (1119)
- Log files are available here:
  /mnt/fecru-3.9.1_fisheye_data/var/log
  /mnt/fecru-3.9.1_fisheye_data/var/log/atlassian-fisheye-2017-03-03.log
  /mnt/fecru-3.9.1_fisheye_data/var/log/fisheye.out
  /mnt/fecru-3.9.1_fisheye_data/var/log/atlassian-fisheyectl-2017-03-03.log