Database or site_config.json may be corrupted

@bahaou
“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 ?

@bahaou if i dont want these changes to commit? i dont want to push custom app to git. Then what should i do?

@Aditya_Vig , uninstall it if you don’t need it.

@bahaou these all problems started when i added erpnext and version 13. Before that i was to do update and everything. But now i am also not able to bench start. I am not able to open my site also.

@Aditya_Vig why you can’t use bench start ?

@bahaou when i do it, it is not running.

@Aditya_Vig omg. nothing is right . are you willing to install a brand new app ?

Hi @Aditya_Vig

The first thing you need to do is

Go to the apps folder and then kyc_customization folder

Once there type – git status

It will tell you the files that need to commit or discard.

try:
bench setup requirements

3 Likes

this is helping me

In frappe-bench/apps/frappe/frappe/utils/backups.py, I changed the delete_temp_backups() function as the following and it had solved my issue.

def delete_temp_backups(older_than=24):
    """
    Cleans up the backup_link_path directory by deleting older files and directories.
    """
    older_than = cint(frappe.conf.get('keep_backups_for_hours', older_than))
    backup_path = get_backup_path()

    if os.path.exists(backup_path):
        file_list = os.listdir(backup_path)

        for this_file in file_list:
            this_file_path = os.path.join(backup_path, this_file)

            try:
                # Check if the path is a file or directory and handle accordingly
                if os.path.isfile(this_file_path) and is_file_old(this_file_path, older_than):
                    os.remove(this_file_path)
                elif os.path.isdir(this_file_path):
                    # Use shutil.rmtree to remove directories
                    shutil.rmtree(this_file_path)
                    print(f"Removed directory: {this_file_path}")
            except Exception as e:
                print(f"Error removing {this_file_path}: {str(e)}")
2 Likes

Thank you, that worked for me also.

worked well for me, so you can rely on it with confidence.

this solved my issue