Database or site_config.json may be corrupted

Database or site_config.json may be corrupted
Facing this while taking backup and restrict us taking backup using crone job as well…
What the issue is it please look into it if any help around

Please share the traceback of the error to help you.
You can check the console tab from browser for error traceback.

Check site_config.json for any typos



What kind of setup do you have ??? production or development ??? Are you using supervisor or manually bench start ???

Most probably this error would crop up if Mariadb is not started.

Production and mariadb is already up

@Habibur_Rahman check the backup folder (sites/site_name/private/backups) and remove all files and repositories , including invisible ones (use ls -a) , if you initialized a git repository , delete it .

I had the same issue since 2020, and this resolved it for me. Thanks!

@bahaou please tell me how to delete git repository. I am facing the same issue. I am unable to update bench.
i have deleted backup files from backup folder.

@Aditya_Vig hello . you have to delete only if you initialized one . open the backup folder . use (ls -a) . if you find a .git folder , just delete it with (rm -r .git).

@bahaou okay. i didn’t have any git repo. But still i am not able to bench update.

@Aditya_Vig share the error please

WARN: shallow_clone is set in your bench config.
However without passing the --reset flag, your repositories will be unshallowed.
To avoid this, cancel this operation and run bench update --reset.

Consider the consequences of git reset --hard on your apps before you run that.
To avoid seeing this warning, set shallow_clone to false in your common_site_config.json

Backing up sites…
Backup failed for Site Database or site_config.json may be corrupted

@Aditya_Vig share you site_config file . are you sure there are no hidden files in the backup folder ?

“background_workers”: 1,
“file_watcher_port”: 6787,
“frappe_user”: “aditya”,
“gunicorn_workers”: 17,
“live_reload”: true,
“maintenance_mode”: 1,
“pause_scheduler”: 1,
“rebase_on_pull”: false,
“redis_cache”: “redis://localhost:13000”,
“redis_queue”: “redis://localhost:11000”,
“redis_socketio”: “redis://localhost:12000”,
“restart_supervisor_on_update”: false,
“restart_systemd_on_update”: false,
“serve_default_site”: true,
“shallow_clone”: false,
“socketio_port”: 9000,
“use_redis_auth”: false,
“webserver_port”: 8000

@Aditya_Vig ok listen , you can update your system without backing up . there is a risk the system fails to update . if you are willing to take it use (bench update --no-backup)
may I ask what is your erpnext version ?

Please have a look

@Aditya_Vig try update without backup as I said

@bahaou okay.

@bahaou It is showing this.

@Aditya_Vig . well , this is not an error . system can’t update if you have changes not committed . can you push the custom app to your git ?