Skip to content
Immanuel Raj edited this page Mar 6, 2024 · 16 revisions

How to

Restart frappe dev server

  • Open frappe container shell fm shell <sitename>
  • Run bench restart.

Logs location

Here are the location you should check for logs.

CLI log

CLI logs can be found at /home/<user>/frappe/logs/fm.log

Frappe dev server logs

Frappe dev server log can be found at:

  • /home/<user>/frappe/sites/<sitename>/workspace/frappe-bench/logs/web.dev.log
  • /home/<user>/frappe/sites/<sitename>/workspace/logs/bench-start.log (will be deprecated)

Check frappe dev server logs

To check the logs you can tail the above files or use fm logs <sitename> --follow this will show the logs. All other Bench-related logs are in the ./logs directory relative to the Bench environment.

Install Frappeverse app

  • Run fm shell <sitename> to open the site shell.
  • Change directory to frappe-bench.
  • Install the app e.g erpnext
    bench get-app erpnext

Install custom app

  • Copy your custom app to /home/<user>/frappe/sites/<site>/workspace dir.
  • Run fm shell <sitename> to open the site shell.
  • Change directory to frappe-bench.
  • Install the app
    bench get-app /workspace/custom-app

Create custom app

  • To create a custom app, use the following command in the Frappe container shell within the Bench environment:
    bench new-app example_app

Run bench commands

  • Open site shell. fm shell <sitename>
  • cd to frappe-bench. cd frappe-bench
  • You can run your bench commands here.

Restart bench environment server

To restart the development server of Frappe which is started by using bench start, you can use the command bench restart in the frappe container.

VSCode Integration

The fm code <sitename> command opens VSCode and attaches it to the container. This enables full-featured IDE development. Default extensions are provided, and additional extensions can be installed using the --extension/-e flag.

Run bench commands in vscode

If you have used fm code <sitename>, make sure you are in the Bench environment directory. You can run Bench commands directly in the VSCode terminal.

Restart frappe dev server in vscode

Run bench restart in vscode terminal.

Develop apps utilizing Google API

  • Subdomains of localhost, like example.localhost, are not supported as a redirect URI in Google Cloud. To fix this issue:
    • Use localhost as the redirect URI in Google Cloud.
    • Run ln -sfn <replace-with-current-sitename.localhost> localhost in the sites directory relative to the root of the Bench environment.

fm create <sitename> command fails

  • First delete the site or it will not run. fm delete <sitename>
  • Now follow this checklist for error and solution.
Checklist
  • Error response from daemon: Get https://ghcr.io/v2/rtcamp/frappe-manager-mailhog/manifests/v0.8.3: denied: denied
    When you're logged into the Docker ghcr.io registry and your GitHub Personal Access Token (PAT) has expired, you'll encounter this issue. There are two solutions available, so choose the one that suits you best:
    • Log out of the Docker ghcr.io registry by executing this command: docker logout ghcr.io then rerun fm command.
      OR
    • Generate a new PAT, use it for re-login into ghcr.io, and then rerun fm command.

Does it work on WSL

  • Yes. We tested it locally on our WSL setup and it works fine.
    • After creating a site, add your site to the hosts file in your windows. Go to C:\Windows\System32\drivers\etc\hosts and add 127.0.0.1 <sitename>.localhost at the end of the file. This will allow you to access the site locally in your windows machine
    • You need to have admin access to edit this file. And also open the file editor [say notepad] in admin mode (Run as administrator).
Checklist
  • WSL version: 2.0.3.0 // This is WSL 2 preview version. Normal one should work fine as well
  • Kernel version: 5.15.123.1-1
  • WSLg version: 1.0.58
  • WinVer: Win 11 Pro 23H2 (OS Build 22631.3235)