1Panel-dev/1Panel · error

error `%s` find in %s

Error message

error `%s` find in %s

What it means

Error "error `%s` find in %s" thrown in 1Panel-dev/1Panel.

Source

Thrown at core/utils/ctl_conf/ctl_conf.go:17

package ctl_conf

import (
	"fmt"
	"os"
	"strings"
)

const defaultFile = "/usr/local/bin/1pctl"

func Load(key string) string {
	info, err := LoadFromFile(defaultFile, key)
	if err != nil {
		panic(err)
	}
	if len(info) == 0 || info == `""` {
		panic(fmt.Sprintf("error `%s` find in %s", key, defaultFile))
	}
	return info
}

func LoadWithoutPanic(key string) string {
	info, err := LoadFromFile(defaultFile, key)
	if err != nil {
		return ""
	}
	return info
}

func LoadFromFile(filePath, key string) (string, error) {
	data, err := os.ReadFile(filePath)
	if err != nil {
		return "", err
	}
	prefix := key + "="

View on GitHub (pinned to 5ac7c80881)

Solutions

  1. Open /usr/local/bin/1pctl and confirm the reported key is defined in `KEY=value` form (no spaces around `=`).
  2. If the key is missing or empty (`""`), add or set it, e.g. `BASE_DIR=/opt`, then rerun the command.
  3. If /usr/local/bin/1pctl is missing or corrupted, reinstall or repair 1Panel to regenerate the 1pctl script.
  4. Ensure values in 1pctl are not accidentally commented out or duplicated with an empty later entry.

Example fix

grep -n 'BASE_DIR' /usr/local/bin/1pctl  # if absent, add: echo 'BASE_DIR=/opt' >> /usr/local/bin/1pctl

When it happens

Trigger: Thrown at core/utils/ctl_conf/ctl_conf.go:17 when the library encounters an invalid state.

Common situations: Occurs when ctl_conf.Load reads the install config file (e.g. /usr/local/bin/1pctl install.conf or equivalent default file) and the requested key is missing or empty. The process panics with this message naming the key and file. Defense: keep the install config file intact and non-empty for all required keys (BASE_DIR, ORIGINAL_PORT, ORIGINAL_USERNAME, etc.); use LoadWithoutPanic where a missing key is tolerable; treat this panic as a sign of a corrupted or incomplete installation.


AI-assisted analysis of 1Panel-dev/1Panel@5ac7c80881 (2026-08-15). Data as JSON: /api/errors/0004df2f1839b8c7. Report an issue: GitHub.