Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with Printing Sales Invoices and PDF Generation in BigCapital #770

Open
waqardevi554 opened this issue Dec 27, 2024 · 4 comments
Open

Comments

@waqardevi554
Copy link

I am experiencing an issue when trying to print a document, such as a sales invoice. A new popup appears and keeps loading indefinitely. Eventually, I receive an error message saying:
"Something went wrong, please try again."

Additionally, the system is not generating PDFs for invoices.

For context, I have installed BigCapital on Ubuntu 22.04 using Docker.

Could you please assist me in resolving these issues?

Thank you!
chrome-capture (88)

Copy link

linear bot commented Dec 27, 2024

@happnatious1
Copy link

I'm not having this issue so it would seem to be something specific with your setup. From my understanding bigcapital uses a Gotenberg container for generating pdf files. Make sure that container is running and you have permission to use it.

@waqardevi554
Copy link
Author

I checked, and the Gotenberg container is running. Please have a look at it. Additionally, I’ve provided the .env and docker-compose.prod.yml file below. Let me know if any edits are needed.

All CONTAINERS
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 8a41ab7295b7 envoyproxy/envoy:v1.30-latest "/docker-entrypoint.…" 2 days ago Up 2 days 10000/tcp, 0.0.0.0:8000->80/tcp, [::]:8000->80/tcp, 0.0.0.0:8443->443/tcp, [::]:8443->443/tcp bigcapital-proxy-1 47507f27b733 bigcapitalhq/server:latest "docker-entrypoint.s…" 2 days ago Up 2 days 3000/tcp bigcapital-server ee59fc6c53a1 bigcapital-database_migration "docker-entrypoint.s…" 2 days ago Exited (0) 2 days ago bigcapital-database-migration 5ce9ecb9eccb gotenberg/gotenberg:7 "/usr/bin/tini -- go…" 2 days ago Up 2 days 3000/tcp, 9000/tcp bigcapital-gotenberg-1 c4eac49e9f63 bigcapitalhq/webapp:latest "/docker-entrypoint.…" 2 days ago Up 2 days 80/tcp bigcapital-webapp f2aafe489d18 bigcapital-mysql "docker-entrypoint.s…" 2 days ago Up 2 days 3306/tcp bigcapital-mysql 11ee9ac7e49d bigcapital-redis "docker-entrypoint.s…" 2 days ago Up 2 days 6379/tcp bigcapital-redis 02bbebf01252 bigcapital-mongo "docker-entrypoint.s…" 2 days ago Up 2 days 27017/tcp bigcapital-mongo bca6308b16f6 chatwoot/chatwoot:latest "bundle exec sidekiq…" 3 days ago Up 3 days 3000/tcp chatwoot-sidekiq-1 58cf79d53af7 chatwoot/chatwoot:latest "docker/entrypoints/…" 3 days ago Up 3 days 0.0.0.0:3000->3000/tcp, :::3000->3000/tcp chatwoot-rails-1 44efb68b01be postgres:12 "docker-entrypoint.s…" 3 days ago Up 3 days 127.0.0.1:5432->5432/tcp chatwoot-postgres-1 45bcbcf8222e redis:alpine "docker-entrypoint.s…" 3 days ago Up 3 days 127.0.0.1:6379->6379/tcp chatwoot-redis-1 9b5c151763a8 chatwoot/chatwoot:latest "irb" 3 days ago Exited (0) 3 days ago chatwoot-base-1
.env
`# Mail
MAIL_HOST=smtppro.zoho.com
MAIL_USERNAME=[email protected]
MAIL_PASSWORD=password
MAIL_PORT=465
MAIL_SECURE=ssl
MAIL_FROM_NAME=Accounts
MAIL_FROM_ADDRESS=[email protected]

Database

DB_HOST=localhost
DB_USER=bigcapital
DB_PASSWORD=bigcapital
DB_ROOT_PASSWORD=root
DB_CHARSET=utf8

System database

SYSTEM_DB_NAME=bigcapital_system

SYSTEM_DB_USER=

SYSTEM_DB_PASSWORD=

SYSTEM_DB_NAME=

SYSTEM_DB_CHARSET=

Tenant databases

TENANT_DB_NAME_PERFIX=bigcapital_tenant_

TENANT_DB_HOST=

TENANT_DB_USER=

TENANT_DB_PASSWORD=

TENANT_DB_CHARSET=

Application

BASE_URL=http://45.10.160.160:8000
JWT_SECRET=b0JDZW56RnV6aEthb0RGPXVEcUI

Jobs MongoDB

MONGODB_DATABASE_URL=mongodb://localhost/bigcapital

App proxy

PUBLIC_PROXY_PORT=8000
PUBLIC_PROXY_SSL_PORT=8443

Agendash

AGENDASH_AUTH_USER=agendash
AGENDASH_AUTH_PASSWORD=123123

Sign-up restrictions

SIGNUP_DISABLED=false
SIGNUP_ALLOWED_DOMAINS=
SIGNUP_ALLOWED_EMAILS=

Sign-up Email Confirmation

SIGNUP_EMAIL_CONFIRMATION=false

API rate limit (points,duration,block duration).

API_RATE_LIMIT=120,60,600

Gotenberg API for PDF printing - (production).

GOTENBERG_URL=http://gotenberg:3000
GOTENBERG_DOCS_URL=http://server:3000/public/

Gotenberg API - (development)

GOTENBERG_URL=http://localhost:9000

GOTENBERG_DOCS_URL=http://host.docker.internal:3000/public/

Exchange Rate Service

EXCHANGE_RATE_SERVICE=open-exchange-rate

Open Exchange Rate

OPEN_EXCHANGE_RATE_APP_ID=

The Plaid environment to use ('sandbox' or 'development').

https://plaid.com/docs/#api-host

PLAID_ENV=sandbox

Your Plaid keys, which can be found in the Plaid Dashboard.

https://dashboard.plaid.com/account/keys

PLAID_CLIENT_ID=
PLAID_SECRET=
PLAID_LINK_WEBHOOK=

https://docs.lemonsqueezy.com/guides/developer-guide/getting-started#create-an-api-key

LEMONSQUEEZY_API_KEY=
LEMONSQUEEZY_STORE_ID=
LEMONSQUEEZY_WEBHOOK_SECRET=

S3 documents and attachments

S3_REGION=US
S3_ACCESS_KEY_ID=
S3_SECRET_ACCESS_KEY=
S3_ENDPOINT=
S3_BUCKET=
**docker-compose.prod.yml**# This is a production version of the Bigcapital docker-compose.yml file.

version: '3.3'

services:
proxy:
image: envoyproxy/envoy:v1.30-latest
depends_on:
- server
- webapp
ports:
- '${PUBLIC_PROXY_PORT:-80}:80'
- '${PUBLIC_PROXY_SSL_PORT:-443}:443'
tty: true
volumes:
- ./docker/envoy/envoy.yaml:/etc/envoy/envoy.yaml
restart: on-failure
networks:
- bigcapital_network

webapp:
container_name: bigcapital-webapp
image: bigcapitalhq/webapp:latest
restart: on-failure
networks:
- bigcapital_network

server:
container_name: bigcapital-server
image: bigcapitalhq/server:latest
expose:
- '3000'
links:
- mysql
- mongo
- redis
depends_on:
- mysql
- mongo
- redis
restart: on-failure
networks:
- bigcapital_network
environment:
# Mail
- MAIL_HOST=${MAIL_HOST}
- MAIL_USERNAME=${MAIL_USERNAME}
- MAIL_PASSWORD=${MAIL_PASSWORD}
- MAIL_PORT=${MAIL_PORT}
- MAIL_SECURE=${MAIL_SECURE}
- MAIL_FROM_NAME=${MAIL_FROM_NAME}
- MAIL_FROM_ADDRESS=${MAIL_FROM_ADDRESS}

  # Database
  - DB_HOST=mysql
  - DB_USER=${DB_USER}
  - DB_PASSWORD=${DB_PASSWORD}
  - DB_CHARSET=${DB_CHARSET}

  # System database
  - SYSTEM_DB_NAME=${SYSTEM_DB_NAME}

  # Tenants databases
  - TENANT_DB_NAME_PERFIX=${TENANT_DB_NAME_PERFIX}

  # Authentication
  - JWT_SECRET=${JWT_SECRET}

  # MongoDB
  - MONGODB_DATABASE_URL=mongodb://mongo/bigcapital

  # Application
  - BASE_URL=${BASE_URL}

  # Agendash
  - AGENDASH_AUTH_USER=${AGENDASH_AUTH_USER}
  - AGENDASH_AUTH_PASSWORD=${AGENDASH_AUTH_PASSWORD}

  # Sign-up restrictions
  - SIGNUP_DISABLED=${SIGNUP_DISABLED}
  - SIGNUP_ALLOWED_DOMAINS=${SIGNUP_ALLOWED_DOMAINS}
  - SIGNUP_ALLOWED_EMAILS=${SIGNUP_ALLOWED_EMAILS}

  # Sign-up email confirmation
  - SIGNUP_EMAIL_CONFIRMATION=${SIGNUP_EMAIL_CONFIRMATION}

  # Gotenberg (Pdf generator)
  - GOTENBERG_URL=${GOTENBERG_URL}
  - GOTENBERG_DOCS_URL=${GOTENBERG_DOCS_URL}

  # Exchange Rate
  - EXCHANGE_RATE_SERVICE=${EXCHANGE_RATE_SERVICE}
  - OPEN_EXCHANGE_RATE_APP_ID-${OPEN_EXCHANGE_RATE_APP_ID}

  # Bank Sync
  - BANKING_CONNECT=${BANKING_CONNECT}

  # Plaid
  - PLAID_ENV=${PLAID_ENV}
  - PLAID_CLIENT_ID=${PLAID_CLIENT_ID}
  - PLAID_SECRET=${PLAID_SECRET}
  - PLAID_LINK_WEBHOOK=${PLAID_LINK_WEBHOOK}

  # Lemon Squeez
  - LEMONSQUEEZY_API_KEY=${LEMONSQUEEZY_API_KEY}
  - LEMONSQUEEZY_STORE_ID=${LEMONSQUEEZY_STORE_ID}
  - LEMONSQUEEZY_WEBHOOK_SECRET=${LEMONSQUEEZY_WEBHOOK_SECRET}
  - HOSTED_ON_BIGCAPITAL_CLOUD=${HOSTED_ON_BIGCAPITAL_CLOUD}

  # New Relic matrics tracking.
  - NEW_RELIC_DISTRIBUTED_TRACING_ENABLED=${NEW_RELIC_DISTRIBUTED_TRACING_ENABLED}
  - NEW_RELIC_LOG=${NEW_RELIC_LOG}
  - NEW_RELIC_AI_MONITORING_ENABLED=${NEW_RELIC_AI_MONITORING_ENABLED}
  - NEW_RELIC_CUSTOM_INSIGHTS_EVENTS_MAX_SAMPLES_STORED=${NEW_RELIC_CUSTOM_INSIGHTS_EVENTS_MAX_SAMPLES_STORED}
  - NEW_RELIC_SPAN_EVENTS_MAX_SAMPLES_STORED=${NEW_RELIC_SPAN_EVENTS_MAX_SAMPLES_STORED}
  - NEW_RELIC_LICENSE_KEY=${NEW_RELIC_LICENSE_KEY}
  - NEW_RELIC_APP_NAME=${NEW_RELIC_APP_NAME}

  # S3
  - S3_REGION=${S3_REGION}
  - S3_ACCESS_KEY_ID=${S3_ACCESS_KEY_ID}
  - S3_SECRET_ACCESS_KEY=${S3_SECRET_ACCESS_KEY}
  - S3_ENDPOINT=${S3_ENDPOINT}
  - S3_BUCKET=${S3_BUCKET}

database_migration:
container_name: bigcapital-database-migration
build:
context: ./
dockerfile: docker/migration/Dockerfile
environment:
# Database
- DB_HOST=mysql
- DB_USER=${DB_USER}
- DB_PASSWORD=${DB_PASSWORD}
- DB_CHARSET=${DB_CHARSET}
- SYSTEM_DB_NAME=${SYSTEM_DB_NAME}
# Tenants databases
- TENANT_DB_NAME_PERFIX=${TENANT_DB_NAME_PERFIX}
depends_on:
- mysql
networks:
- bigcapital_network

mysql:
container_name: bigcapital-mysql
restart: on-failure
build:
context: ./docker/mariadb
environment:
- MYSQL_DATABASE=${SYSTEM_DB_NAME}
- MYSQL_USER=${DB_USER}
- MYSQL_PASSWORD=${DB_PASSWORD}
- MYSQL_ROOT_PASSWORD=${DB_ROOT_PASSWORD}
volumes:
- mysql:/var/lib/mysql
expose:
- '3306'
networks:
- bigcapital_network

mongo:
container_name: bigcapital-mongo
restart: on-failure
build: ./docker/mongo
expose:
- '27017'
volumes:
- mongo:/var/lib/mongodb
networks:
- bigcapital_network

redis:
container_name: bigcapital-redis
restart: on-failure
build:
context: ./docker/redis
expose:
- '6379'
volumes:
- redis:/data
networks:
- bigcapital_network

gotenberg:
image: gotenberg/gotenberg:7
expose:
- '9000'
networks:
- bigcapital_network

Volumes

volumes:
mysql:
name: bigcapital_prod_mysql
driver: local

mongo:
name: bigcapital_prod_mongo
driver: local

redis:
name: bigcapital_prod_redis
driver: local

Networks

networks:
bigcapital_network:
driver: bridge
`

@happnatious1
Copy link

I am new to docker so I might be wrong but I see two proxies running (envoyproxy and bigcapital proxy), that might be a problem. Also, the database migration container I believe should run once on startup then exit however, I see two database migration listings one of which looks to be stuck on gotenberg command and still running after two days.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants