App folder missing after bench get-app

I was trying to install biometric-attendance-sync-tool with this command

bench get-app GitHub - frappe/biometric-attendance-sync-tool: A simple tool for syncing Biometric Attendance data with your ERPNext server

Then I got this error and my apps folder is missing.

After this,

I got important customization and files. I had made back up of my site with files just before running the bench get-app. Is there a way to solve this ?

should be bench get-app https://github.com/frappe/biometric-attendance-sync-tool.git

the extra / at the end caused it to replace the app directory I suspect.

Looks like you have copied the web address

You should be able to just create the app directory manually and git clone everything back into place.

It did not work. I already had cloned the files in apps directory with :

git clone GitHub - frappe/frappe: Low code web framework for real world applications, in Python and Javascript
git clone GitHub - frappe/erpnext: Free and Open Source Enterprise Resource Planning (ERP)

Now I get Internal Server Error in the web browser.

I just checked it. Turns out you are right.

What are my options now ? How can I restore the apps folder ?

Are you cloning the right branch? What is the Internal Server Error?

I am not sure about the branch. I just ran :

I was running erpnext production v13.26

How do I make sure of the right branch ?

Internal server error:

I believe that frappe/erpnext both clone the develop branch by default, which would lead to server errors if you’re database is on version 13. To check, go to apps/frappe or apps/erpnext and type git status. You can switch over to the correct branch in each app with git checkout version-13.

Rather than a screenshot, your error logs are more likely to contain useful info. They’re probably at /var/log/nginx/error.log

Here’s the error log:

2022/04/20 06:13:13 [error] 682447#682447: *57793 connect() failed (111: Connection refused) while connecting to upstream, client: 172.69.183.70, server: erp.example.com, request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:8000/", host: "bm.example.com" 
2022/04/20 06:13:18 [error] 682447#682447: *57795 connect() failed (111: Connection refused) while connecting to upstream, client: 172.69.183.70, server: erp.example.com, request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:8000/", host: "bm.example.com" 
2022/04/20 06:13:21 [error] 682447#682447: *57797 connect() failed (111: Connection refused) while connecting to upstream, client: 172.69.183.70, server: erp.example.com, request: "GET /login HTTP/1.1", upstream: "http://127.0.0.1:8000/login", host: "erp.example.com" 
2022/04/20 06:44:20 [error] 682447#682447: *57935 connect() failed (111: Connection refused) while connecting to upstream, client: 172.69.183.70, server: erp.example.com, request: "GET /socket.io/?EIO=3&transport=polling&t=O15jlNh HTTP/1.1", upstream:"http://127.0.0.1:9000/socket.io/?EIO=3&transport=polling&t=O15jlNh", host: "erp.example.com", referrer: "https://erp.example.com/app"

As requested:

Yes, I was on develop branch and I successfully switched to v13 as per your suggestions.

And you’re still getting errors? Any interesting errors in your bench logs folder?

Yes. The webpage doesnot load. It still says Internal server error.

There are a lot of error logs in ~/frappe-bench/logs
Which ones should I be looking at ?

Look at anything with a recent timestamp, I’d say. I think request errors might be logged at web.log, but I can’t remember for certain off hand.

There is web.log and web.error.log but each of them have more than 5000 lines and I don’t know what might be of any interest.

Should I paste them as well ?

What is the status of mariadb and redis server?

No, of course not, not all 5000 lines. We’re not interested in things that happened a week ago. Just make a request and look at the most recent entries that get created as a consequence of the server error.

@Touseef

I have already clean wiped my VPS and installed a fresh new system Ubuntu 20.04.

I have installed frappe successfully with:

bench init /home/sammy/frappe-bench --frappe-path GitHub - frappe/frappe: Low code web framework for real world applications, in Python and Javascript --frappe-branch version-13 --python python3

Now my next step (if I wanted a fresh ERPNext) would be:

bench get-app erpnext GitHub - frappe/erpnext: Free and Open Source Enterprise Resource Planning (ERP) --branch version-13

and then

bench new-site your_domain --admin-password ‘erpnext_admin_password’ --mariadb-root-username sammy --mariadb-root-password ‘mariadb_password’

followed by:

bench --site your_domain install-app erpnext
bench start

But since I need the older instance, ( I have downloaded a backup of older instance. Backup was generated by bench backup --with-files)

How can I successfully restore my old installation with files, sql, database keeping in mind the database name, pwd, etc into the new installation ?

Is it safe to follow example 1 of this link ?