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

Instance already exists but never created #121

Closed
mdestafadilah opened this issue Apr 24, 2024 · 10 comments
Closed

Instance already exists but never created #121

mdestafadilah opened this issue Apr 24, 2024 · 10 comments

Comments

@mdestafadilah
Copy link

I have check folder, but no one instance has ready created.

@jrCleber
Copy link
Contributor

Good morning!
Is redis enabled?
Did it generate an error in the console?
Did you return an error when creating an instance?

@mdestafadilah
Copy link
Author

Good morning! Is redis enabled? Did it generate an error in the console? Did you return an error when creating an instance?

Good morning,

aha, i'm enabled a redis, and by default my server has enabled redis.

this my config for .env file

#  ┌──────────────────────────────────────────────────────────────────────────────┐
#  │ @author jrCleber                                                             |
#  │ @filename dev-env.yml                                                        │
#  │ Developed by: Cleber Wilson                                                  │
#  │ File name: dev-env.yml                                                       │
#  │ Creation date: Dez 03, 2023                                                  │
#  │ Contact: [email protected]
#  ├──────────────────────────────────────────────────────────────────────────────┤
#  │ @copyright © Cleber Wilson 2022. All rights reserved.                        │
#  │ Licensed under the Apache License, Version 2.0                               │
#  │                                                                              │
#  │  @license "https://github.com/code-chat-br/whatsapp-api/blob/main/LICENSE"   │
#  │                                                                              │
#  │ You may not use this file except in compliance with the License.             │
#  │ You may obtain a copy of the License at                                      │
#  │                                                                              │
#  │    http://www.apache.org/licenses/LICENSE-2.0                                │
#  │                                                                              │
#  │ Unless required by applicable law or agreed to in writing, software          │
#  │ distributed under the License is distributed on an "AS IS" BASIS,            │
#  │ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.     │
#  │                                                                              │
#  │ See the License for the specific language governing permissions and          │
#  │ limitations under the License.                                               │
#  ├──────────────────────────────────────────────────────────────────────────────┤
#  │ @important                                                                   │
#  │ For any future changes to the code in this file, it is recommended to        │
#  │ contain, together with the modification, the information of the developer    │
#  │ who changed it and the date of modification.                                 │
#  └──────────────────────────────────────────────────────────────────────────────┘

# ⚠️
# ⚠️ ALL SETTINGS DEFINED IN THIS FILE ARE APPLIED TO ALL INSTANCES.
# ⚠️

# ⚠️ COPY THIS FILE TO .env

SERVER_PORT=41373
SESSION_HTTP_SECRET=W0NvZGVDaGF0XTpbU2Vzc

LOG_LEVEL=ERROR|WARN|INFO|DEBUG|LOG
LOG_COLOR=true

# Permanente data storage
DATABASE_ENABLED=true
DATABASE_URL=postgres://apiwa4:[email protected]:5432/apiwa4
DATABASE_SYNC_MESSAGES=true
DATABASE_SAVE_DATA_NEW_MESSAGE=true
DATABASE_SAVE_MESSAGE_UPDATE=true
DATABASE_SAVE_DATA_CONTACTS=true
DATABASE_SAVE_DATA_CHATS=true
DATABASE_SAVE_LOGS=true

# Global Webhook
# It will notify all events of all businesses and instances.
WEBHOOK_GLOBAL_URL=url
WEBHOOK_GLOBAL_ENABLED=false

# Determine how long the instance should be deleted from memory in case of no connection.
# Default time: 5 minutes
# If you don't even want an expiration, enter the value false
INSTANCE_EXPIRATION_TIME=false

# Name that will be displayed on smartphone connection
CONFIG_SESSION_PHONE_CLIENT=CodeChat_V1
CONFIG_SESSION_PHONE_NAME=Edge

# Set qrcode display limit
QRCODE_LIMIT=10
QRCODE_EXPIRATION_TIME=60 # seconds

# Maximun time to connect to whatsapp
CONNECTION_TIMEOUT=300 # seconds

AUTHENTICATION_GLOBAL_AUTH_TOKEN=zYzP7ocstxh3Sscefew4FZTCu4ehnM8v4hu

# 0 = never expires | 3600 = 1 hour | 86400 = 1 day | 604800 = 1 week
AUTHENTICATION_JWT_EXPIRES_IN=0
AUTHENTICATION_JWT_SECRET=3RFYwe-fwf4fw4w8e-BrLZzx

REDIS_ENABLED=true
REDIS_URI=redis://:Y5HZk8u07*[email protected]:6379/2 # redis://:password@ipaddress:6379/0
REDIS_PREFIX=codechat

# https://min.io/docs/minio/linux/index.html
S3_ENABLED=false
S3_ACCESS_KEY=access_key_id
S3_SECRET_KEY=secret_access_key
S3_BUCKET=bucket_name
S3_PORT=9000
S3_ENDPOINT=127.0.0.1
S3_USE_SSL=false

# AMAZON S3 - Environment variables
# S3_ENABLED=true
# S3_BUCKET=bucket_name
# S3_ACCESS_KEY=access_key_id
# S3_SECRET_KEY=secret_access_key
# S3_ENDPOINT=s3.amazonaws.com # region: s3.eu-west-3.amazonaws.com

# MINIO Use SSL - Environment variables
# S3_ENABLED=true
# S3_ACCESS_KEY=access_key_id
# S3_SECRET_KEY=secret_access_key
# S3_BUCKET=bucket_name
# S3_PORT=443
# S3_ENDPOINT=s3.domain.com
# S3_USE_SSL=true

here the log of error
25-04-2024 02-18-15

sholud disable redis ?

@jrCleber
Copy link
Contributor

With redis enabled, it means that instances are being saved in it.

@mdestafadilah
Copy link
Author

With redis enabled, it means that instances are being saved in it.

i thought like that, but, my redis not created, i'm saved it to redis number 2 , but nothing data created.

i thinks it's for cache, cz i see Permanente data storage is by default. i will try tomorrow, i will rest now, thanks brother .

@mdestafadilah
Copy link
Author

Hi, i just testing, and disable redis and use only postgress. but still not created.

25-04-2024 11-29-48

25-04-2024 11-25-47

any clue how to solve this?

@jrCleber
Copy link
Contributor

Redo the entire installation. Disable redis and delete, if any, all files from the instances folder.

If possible, clone the repository to another location and do the entire installation with a different database name.

Test and compare the two.

@mdestafadilah
Copy link
Author

When i reinstalation with fresh clone, i have error log when yarn start:prod

26-04-2024 09-50-50

no idea why so different.

Info

  • server: ubuntu 20.04
  • node: v18.13.0
  • postgess: 14.2
  • redis: disable

@jrCleber
Copy link
Contributor

The MinIO dependency has been updated to fix this.

Update the api with the git pull command, reinstall the dependencies and try again.

@jrCleber
Copy link
Contributor

For new requests reopen your issue here.

@mdestafadilah
Copy link
Author

For new requests reopen your issue here.

Thanks, but i can't scan barcode, 403 status code, i will post new issue.

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