Enable Byteman for additional logging in Fisheye and Crucible
Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.
Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.
*Except Fisheye and Crucible
Summary
While troubleshooting issues, the support team can request to enable Byteman so that additional logging is generated.
This page explains how to enable Byteman and covers the most common issues and how to address them.
Solution
Enable Byteman
On Linux:
Create a file called
byteman_rule.btm
on the server hosting FisheyeAdd the content provided by support to the file
Set the following Environment variables
1
2
3
4
# Enable Byteman
export FISHEYE_LOAD_BYTEMAN=1
# Specify the path to the byteman rule file
export FISHEYE_BYTEMAN_SCRIPT=</path/to/byteman rule file>
Stop Fisheye/Crucible
Start Fisheye/Crucible
From the command line on the server, run the following command to load the Byteman rule
1
2
cd <Fisheye installation directory>/tools/byteman
./load-rules.sh </path/to/byteman rule file>/byteman_rule.btm
Typically at this stage, it is required to reproduce the problem
On Windows (not running as a service):
Create a file called
byteman_rule.btm
on the server hosting FisheyeAdd the content provided by support to the file
Stop Fisheye/Crucible
Using the
start.bat
script from the bin directory of your Fisheye Installation Directory, start Fisheye with theSET FISHEYE_LOAD_BYTEMAN=1
flag before it. So it should look something like this in the terminal:1
CMD /C "SET FISHEYE_LOAD_BYTEMAN=1 && start.bat"
Allow Fisheye to complete its startup first and ensure that you're able to access the UI
When the UI is available, navigate to
<Fisheye installation directory>/tools/byteman
Execute the script
load-rules.bat \path\to\byteman_rules.
At this stage, reproduce the problem
On Windows (installed as Windows service by installer):
Stop Fisheye service
Edit the service:
1
<Fisheye installation directory>\bin\service.bat manage
Switch to Java tab
Append to the java options:
1
-javaagent:<Fisheye installation directory>\tools\byteman\lib\byteman.jar=listener:true,script:<path\to\script>
Save the changes and start the service
Disable Byteman / Load new rules
Once the issue has been reproduced or if new rules need to be loaded, the following command can be used to unload the current ones:
1
2
cd <Fisheye installation directory>/tools/byteman
./unload-rules.sh
In case of byteman has been set via javaagent, just remove that line from the service configuration.
Check if Byteman has been enabled
Logfiles
Once Byteman has been activated and the problem has been reproduced, the Fisheye logs will contain a reference to Byteman
1
2
# The line will be different depending on the Byteman rule but the "Byteman" reference will be available
INFO [main ] Byteman NativeMethodAccessorImpl-invoke0 - -> CrossRepLuceneIndex#removingRepoFromIndex(<repository name>)
Application.xml
The application.xml, a file generated when creating a Support Zip but not available on the server, will contain the following additional lines:
1
2
<FISHEYE_BYTEMAN_SCRIPT></path/to/byteman rule file>/byteman_rule.btm</FISHEYE_BYTEMAN_SCRIPT>
<FISHEYE_LOAD_BYTEMAN>1</FISHEYE_LOAD_BYTEMAN>
Common issues
Connection refused
One of the Byteman commands fails with Connection refused
:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
./load-rules.sh </path/to/byteman rule file>/byteman_rule.btm
Failed to process request: java.net.ConnectException: Connection refused
java.net.ConnectException: Connection refused
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:345)
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
at java.net.Socket.connect(Socket.java:589)
at java.net.Socket.connect(Socket.java:538)
at java.net.Socket.<init>(Socket.java:434)
at java.net.Socket.<init>(Socket.java:211)
at org.jboss.byteman.agent.submit.Submit$Comm.<init>(Submit.java:881)
at org.jboss.byteman.agent.submit.Submit.submitRequest(Submit.java:787)
at org.jboss.byteman.agent.submit.Submit.listAllRules(Submit.java:176)
at org.jboss.byteman.agent.submit.Submit.main(Submit.java:1121)
fisheyeuser@minntest3:/Atlassian/fecru/tools/byteman$ org.jboss.byteman.agent.submit.Submit
Resolution
Make sure that Fisheye is up and running
Make sure that the Environment variables have been correctly set before starting Fisheye
Was this helpful?