Troubleshooting
Instructions on how to troubleshoot issues
First Steps
Please first try the following if you are encountering some issue, as typically these will resolve most common problems.
If your issue is a frontend issue
Make sure you have all packages built using either
npm run packages:buildfrom the root to build all packages ornpm run buildinside the folder of the package to build
If your issue is related to the backend
Rebuilt the backend Docker image using
npm run docker:buildFlush and reseed the backend database using
npm run docker:flush
If your issue is related to Shopify checkout
Make sure your Ngrok tunnel is working properly
You may visit localhost:4040 to see if Ngrok is received webhooks from Shopify
If Ngrok is not received webhooks, then something is wrong with Shopify's end, so check the Shopify admin dashboard to see if there is a webhook pointing the Ngrok URL
Otherwise, if Ngrok is receiving webhooks, the backend must not be processing the webhooks correctly
Common Issues
Quick fix to try if something on the backend works on other people's laptop but not mine
Rebuild the backend Docker containers and rerun the backend
How do I enable built in Loopback debugging?
See Setting debug strings from the Loopback documentation. For example, to debug ACL issues, set DEBUG=loopback:security:*
How do I rename the database?
If you are using MySQL 8.0 with InnoDB, do the following:
Exec into the MySQL database using the
mysqlcommand line utilityRun
CREATE DATABASE new_db_name;(Optional, to create new user)
CREATE USER 'edrop_db_user'@'%' IDENTIFIED BY 'password_goes_here';(Optional, to grant user privileges)
GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, PROCESS, REFERENCES, INDEX, ALTER, SHOW DATABASES, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER ON *.* TO 'edrop_db_user'@'%' WITH GRANT OPTION;(Bash script to rename tables):
mysql -u dbUsername -p"dbPassword" old_db_name -Ne 'SHOW TABLES' | while read table; do mysql -u dbUsername -p"dbPassword" -Ne "RENAME TABLE old_db_name.$table TO new_db_name.$table"; doneFor the above command, I recommend executing everything before the pipe first to see all the tables that will be affected
This uses the fact that we can "transfer" a table from one database to another with the following command:
RENAME TABLE old_db_name.table_name TO new_db_name.table_name;
Source: https://chartio.com/resources/tutorials/how-to-rename-a-database-in-mysql/
I set the environment variables for connecting to the database but it doesn't work (permission denied error)
Make sure you set the environment variables in the same shell window that you run the server in. To verify the value was set correctly, use $ echo %ENV_VAR_NAME% for Windows and $ echo $ENV_VAR_NAME for Linux/MacOS.
Running the dev server results in an error
Check to see if you have all packages installed with npm install. Additionally, check if there are any issues with dependencies.
Note that MacOS 12.3 removes Python 2 binaries so any packages that depend on Python 2 will likely not work (e.g. node-sass and sass-loader). You may remove dependencies if they are not necessary. Future updates to eDrops will remove deprecated dependencies and upgrade existing dependencies.
The frontend is not synced with backend
If you made changes to the backend and are encountering errors, make sure you do the following:
Log out of the account if you were logged in
Clear cookies (for localhost)
Often there will be an issue where the user ID stored in a cookie does not correctly reflect a user ID in the backend
This will likely happen if you are running the frontend, then reset the database in the backend.
Restart backend
Port binding issue of Docker container on Windows 10
Error message:
Error invoking remote method ‘docker-start-container’: error: (HTTP code 500) server error — Ports are not available: listen tcp 0.0.0.0:xxxx: bind: An attempt was made to access a socket in a way forbidden by access permissions.
Solution: reset the “TCP Dynamic Port Range” to 49152–65535 by running the following command with administrator privileges, but you can also change it to a smaller range if you think it is too large.
netsh int ipv4 set dynamic tcp start=49152 num=16384Then just reboot the computer.
Blank cart page after placing an order
Check the Shopify Setup to make sure the mode and environment variables are set correctly. Then delete all the local Docker images and rebuild all the Docker images and rerun the backend
Last updated