Traceback (most recent call last):
File "/www/server/panel/tools.py", line 20, in <module>
import public,time,json
File "/www/server/panel/class/public/init.py", line 14, in <module>
from .common import *
File "/www/server/panel/class/public/common.py", line 26, in <module>
settings = json.loads(file.read())
^^^^^^^^^^^^^^^^^^^^^^^
File "/www/server/panel/pyenv/lib/python3.12/json/init.py", line 346, in loads
return default_decoder.decode(s)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/www/server/panel/pyenv/lib/python3.12/json/decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=w(s, 0).end())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/www/server/panel/pyenv/lib/python3.12/json/decoder.py", line 355, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
can not open the panel ,plz....
Hello, is it possible to fix it by upgrading to the latest version?
rm -f /tmp/update_to7.pl && curl -k https://node.aapanel.com/install/update_7.x_en.sh | bash
aaPanel_Kern Yes, i have done it . still the same problem occurs .
Hi, can you give us your aapanel information? The server makes a snapshot backup first, if possible, please send it to kern@aapanel.com.
It is recommended to fill in the following
Post link:
SSH IP address, account password and port:
aapanel login link address and account password:
Detailed problem description:
No post link will not be able to know which user's information is, and the problem will not be processed
Try this solution on nginx v1.27
- Edit file /www/server/panel/plugin/freww_waf/free_waf_main.py
- Change function def get_config(self, get): with this:
`def get_config(self, get):
try:Membaca file config.json
config_data = public.readFile(self.__path + 'config.json')
if not config_data: # Jika file kosong atau None
raise FileNotFoundError("Config file is missing or empty.")
# Memuat JSON dari file config = json.loads(config_data)
except FileNotFoundError:
print("Config file not found or empty. Creating default configuration.")
config = {}
except json.JSONDecodeError as e:
print(f"Error decoding JSON: {e}. Creating default configuration.")
config = {}
# Tambahkan kunci default jika tidak ada
if 'from_data' not in config:
config['from_data'] = True
if 'retry_cycle' not in config:
config['retry_cycle'] = 60
if 'start_time' not in config or config['start_time'] == 0:
config['start_time'] = time.time()
if 'open' not in config:
config['open'] = False # Atur nilai default untuk 'open'
# Tulis ulang konfigurasi jika ada perubahan
self.__write_config(config)
return config
`
change function def get_total_all(self, get): with this code:
`def get_total_all(self, get):
self.__check_cjson()
nginxconf = '/www/server/nginx/conf/nginx.conf'
if not os.path.exists(nginxconf):
return public.returnMsg(False, 'Only support nginx server')
if public.readFile(nginxconf).find('luawaf.conf') == -1:
return public.returnMsg(False, 'Currently nginx does not support firewall, please reinstall nginx')
data = {}
data['total'] = self.get_total(None)
del(data['total']['sites'])
data['drop_ip'] = []
Periksa kunci 'open' di konfigurasi
conf = self.get_config(None)
data['open'] = conf.get('open', False) # Ambil nilai default jika tidak ada
data['safe_day'] = 0
if 'start_time' in conf:
if conf['start_time'] != 0:
data['safe_day'] = int((time.time() - conf['start_time']) / 86400)
self.__write_site_domains()
return data
`