As an experienced website operations expert, I have been dealing with AnQiCMS (AnQi Content Management System) in my daily work for several years, and I am well aware of its efficiency and simplicity.However, even the most powerful system is bound to encounter situations where it does not fit well with its environment, and the most troublesome of these is probably the sudden “**” during the startup process.When AnQiCMS fails to start on time, causing the website to go offline, how can we remain calm and composed to analyze its shutdown state or error logs, quickly locate the problem and resolve it?

This article will combine my in-depth understanding and practical experience of AnQiCMS to provide you with a set of effective troubleshooting ideas and methods.

Understanding the startup mechanism of AnQiCMS

Before delving into the troubleshooting, we first need to have a basic understanding of the startup process of AnQiCMS. AnQiCMS is developed based on the Go language, and its core is a compiled executable file (usually namedanqicms)。In a Linux environment, to ensure the stable operation and automatic recovery of programs, we usually work with shell scripts (such asstart.shandstop.shAnd schedule tasks (cron job) to manage it.

start.shOne of the main responsibilities of the script is to check.anqicmsIs the process running, if not, it will start it in the background and redirect the program's standard output and error output to the log file.Therefore, these log files will be our treasure map for troubleshooting.

The first step in troubleshooting: confirm whether AnQiCMS has really stopped.

When your website is inaccessible, the first thing to confirm is whether the AnQiCMS program has really stopped running, or it is just a front-end access path or network issue.

  1. Check website access:Try to access your website directly. If it returns 502 Bad Gateway, 504 Gateway Timeout, or simply a connection timeout, it is very likely that AnQiCMS is not working normally.
  2. Check process status:In the server command line interface, use the following command to check if the AnQiCMS process is still running:
    
    ps -ef | grep anqicms
    
    If you see a similaranqicms 7621 ...output, where7621Is the process ID (PID), indicating that the program may still be running, but there is a problem with external access. If there is no output, then AnQiCMS has indeed stopped.
  3. Check port occupancy:AnQiCMS runs on port 8001 by default (configurable).Even if the process does not exist, it may be that the port is occupied by another program, causing AnQiCMS to fail to start. Uselsof -i:{端口号}for examplelsof -i:8001You can check the port occupancy. If the port is occupied, you will see a PID indicating that another program is using the port.

Core: Error Log, your 'investigation clue'

Once confirmed that AnQiCMS fails to start normally, or although the process exists but the service is abnormal, then the error log is our most important "crime scene" clue. According to the AnQiCMS startup script convention, there will usually be several key log files:

  1. running.log:This is the runtime log of the AnQiCMS application itself. All program standard output and error information, including the reasons for startup failure, will be recorded here.
  2. check.log:This isstart.shThe log of script execution process checks, records the execution status of the script, such as when AnQiCMS was found not running and attempted to start.

How to view the log file?

These log files are usually located in the AnQiCMS installation directory. You can usetailcommand to view the latest log output in real time, or usecat/lesscommand to view the full content:

  • Real-time trackingrunning.log: tail -f /path/to/anqicms/running.log(Replace/path/to/anqicmsReplace with your AnQiCMS installation path)
  • Checkcheck.log: cat /path/to/anqicms/check.log

What to look for in the log?

When you view the log, please pay attention to the following keywords and phenomena:

  • error/failed:These are obvious error messages that usually point directly to the problem.
  • panic:Common serious errors in Go language programs that can cause program crashes.
  • connection refused/access denied:A common prompt for failed database connection, usually related to database configuration, account password, or database service status.
  • permission denied:Insufficient file or directory permissions, the program cannot read or write the required resources.
  • address already in use:The port is already occupied, the program cannot bind to the specified port.
  • no such file or directory:It may be that a configuration file, template file, or executable file path is incorrect or missing.

Common startup failure scenarios and solutions

Combine the clues from the logs, and we can solve the problem specifically.

  1. Port conflict (address already in use)
    • Symptoms: running.logAn error occurred such as "address already in use" or similar.
    • Analysis:The default 8001 port may be occupied by another program.install.mdandstart.mdThis issue was mentioned in all of them.
    • Solution:
      • Uselsof -i:8001Find the PID of the process occupying port 8001, and then usekill -9 PIDTerminate the process.
      • Modify the configuration items of AnQiCMS'sconfig.jsonFile, containing theportChange the configuration item to an unused one