Instructions for System Dump of .log Files, Debug Info, & Crash Reports

Anytype System Dump

:ambulance: This instruction provides steps to make a dump of the Anytype application. Information contained in the dump will help support engineers to figure out the root cause of Anytype being stuck or some other incorrect behavior.

Testers should follow the steps outlined under the relevant OS. They may appear intimidating at first glance, but if followed step by step, the process is quite apparent.


Run Anytype Application with Debug Environment Variables

Mac OS / Linux

To run the Anytype application with custom environment variables provided we need to run it in a shell.

Firstly, we need to find a path to executive file of a program. Usually, it is unified for a particular operating system. Default path where Anytype executive file is installed to is:

  • Mac OS: /Applications/Anytype.app/Contents/MacOS/Anytype
  • Linux: /opt/Anytype/anytype

To pass debug environment variables to Anytype, we should run it in a shell. Run Terminal app to access shell. Or use your favorite shell directly: sh, bash, zsh or other.

Run following commands in opened shell:

ANYTYPE_LOG_LEVEL="*=DEBUG" ANYPROF=:6060 <anytype_executive_file>

The first environment variable is for the level of logs displayed in the shell, while the second is for the address where the list of all processes could be accessed to.

After you hit Enter application starts and window appears on the screen.

Windows

To run Anytype application with custom environment variables provided we need to specify them in System Properties.

  1. Press Windows + R to open the Windows Run prompt.

  2. Type in sysdm.cpl and click OK.
    image

  3. Open the Advanced tab and click on the Environment Variables button in the System Properties window.
    image(1)

  4. The Environment Variables window is divided into two sections. The sections display user-specific and system-wide environment variables. To add a variable, click the New… button under User variables section.

  5. Create 2 New User Variables:

Variable name: ANYTYPE_LOG_LEVEL
Variable value: "*=DEBUG"

and

Variable name: ANYPROF
Variable value: :6060

  1. Press OK and apply all changes.
  2. Press Windows + R to open the Windows Run prompt the same way as stated in step 1.
  3. Type in cmd and click OK. This way you will open Command prompt, so you can run Anytype and see all debug logs.
  4. Then we need to find a path to executive file of a program. (You can confirm by navigating there manually, but under View, you’ll need hidden items enabled to see it).

In Windows 10 or above, it is usually located:
C:\Users\<username>\Appdata\Local\Programs\anytype2\Anytype.exe
username stands for the name of your user aka working directory. Please note: this command is case-sensitive and the location of this file may differ.
10. Run this command in your Command prompt:


11. After you hit Enter you will see logs appearing in Command prompt and the window of the Anytype application, that you can work with as usual.

Making Anytype Dump

If the application is stuck or appears in an incorrect state, you can easily make a dump of Anytype application by accessing http://127.0.0.1:6060/debug/pprof/goroutine?debug=4 in a browser.

Please provide:

  • List of all processes displayed on a page opened in a browser.
  • All logs printed in a shell or the Command Prompt from the very start of application.

The above information will help us to understand the cause of an issue and fix it faster.


After all the logs and files are collected, you can upload them to your original topic:

7 Likes