logto icon indicating copy to clipboard operation
logto copied to clipboard

bug: Some official connectors do not work and are skipped

Open family-cpa opened this issue 1 year ago β€’ 9 comments

Describe the bug

Some official connectors do not work and are skipped

Expected behavior

How to reproduce?

docker-compose.yml logto: image: svhd/logto:1.20.0 container_name: logto entrypoint: ["sh", "-c", "npm run cli db seed -- --swe && npm run cli connector add -- --official && npm start"] restart: unless-stopped ports: - 3001:3001 - 3002:3002 environment: - TRUST_PROXY_HEADER=1 - DB_URL=...

Context

  • [ ] Logto Cloud
  • [x] Self-hosted, Logto version = v1.20.0
    • [x] Container (Docker image)
    • [ ] Raw Node.js

Screenshots

output

family-cpa avatar Sep 17 '24 12:09 family-cpa

Hi, could you please share the full docker compose file? It looks like you are customizing something by npm run cli connector add -- --official, normally you don't need this, you can find the recommended compose file here: https://docs.logto.io/docs/get-started/#local

wangsijie avatar Oct 09 '24 12:10 wangsijie

This issue is stale because it has been open for 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

github-actions[bot] avatar Oct 24 '24 02:10 github-actions[bot]

We have this same problem and i believe its being talked about in this discord as well:

https://discord.com/channels/965845662535147551/1299720777154822214

2024-11-04T11:33:49.643746834Z (node:44) ExperimentalWarning: Importing JSON modules is an experimental feature and might change at any time
2024-11-04T11:33:49.643801045Z (Use `node --trace-warnings ...` to show where the warning was created)
2024-11-04T11:33:55.161106316Z cache    warn No Redis client initialized, skipping
2024-11-04T11:33:56.107234761Z error [load-connector] skip @logto/connector-alipay-native due to error: Cannot find package 'dayjs' imported from /etc/logto/packages/core/connectors/@logto-connector-alipay-native/lib/index.js
2024-11-04T11:33:56.139162745Z error [load-connector] skip @logto/connector-alipay-web due to error: Cannot find package 'dayjs' imported from /etc/logto/packages/core/connectors/@logto-connector-alipay-web/lib/index.js
2024-11-04T11:33:56.158678065Z error [load-connector] skip @logto/connector-aws-ses due to error: Cannot find package '@aws-sdk/client-sesv2' imported from /etc/logto/packages/core/connectors/@logto-connector-aws-ses/lib/index.js
2024-11-04T11:33:56.165047794Z error [load-connector] skip @logto/connector-azuread due to error: Cannot find package '@azure/msal-node' imported from /etc/logto/packages/core/connectors/@logto-connector-azuread/lib/index.js
2024-11-04T11:33:56.249279943Z error [load-connector] skip @logto/connector-gitlab due to error: Cannot find package '@logto/connector-oauth' imported from /etc/logto/packages/core/connectors/@logto-connector-gitlab/lib/index.js
2024-11-04T11:33:56.280260338Z error [load-connector] skip @logto/connector-huggingface due to error: Cannot find package '@logto/connector-oauth' imported from /etc/logto/packages/core/connectors/@logto-connector-huggingface/lib/index.js
2024-11-04T11:33:56.329362965Z error [load-connector] skip @logto/connector-kook due to error: Cannot find package '@logto/connector-oauth' imported from /etc/logto/packages/core/connectors/@logto-connector-kook/lib/index.js
2024-11-04T11:33:56.337029124Z error [load-connector] skip @logto/connector-oauth due to error: Cannot find package 'query-string' imported from /etc/logto/packages/core/connectors/@logto-connector-oauth/lib/index.js
2024-11-04T11:33:56.343991788Z error [load-connector] skip @logto/connector-postmark due to error: Cannot find package 'postmark' imported from /etc/logto/packages/core/connectors/@logto-connector-postmark/lib/index.js
2024-11-04T11:33:56.351444284Z error [load-connector] skip @logto/connector-patreon due to error: Cannot find package '@logto/connector-oauth' imported from /etc/logto/packages/core/connectors/@logto-connector-patreon/lib/index.js
2024-11-04T11:33:56.357357633Z error [load-connector] skip @logto/connector-oidc due to error: Cannot find package '@logto/connector-oauth' imported from /etc/logto/packages/core/connectors/@logto-connector-oidc/lib/index.js
2024-11-04T11:33:56.416816306Z error [load-connector] skip @logto/connector-smtp due to error: Cannot find package 'nodemailer' imported from /etc/logto/packages/core/connectors/@logto-connector-smtp/lib/index.js

However they are in the folder....

image

jameshiscott avatar Nov 04 '24 20:11 jameshiscott

Any thoughts on why this is happening and how it might be addressed? It sounded like one of the developers had a lead on the problem when it was being discussed in discord several months ago.

bpow avatar Jan 12 '25 03:01 bpow

I ran into this recently when following the guide to deploy on Kubernetes with the shared folder configuration documented here - https://docs.logto.io/logto-oss/deployment-and-configuration#shared-connectors-folder

I created a Batch Job which creates the connectors and there were no errors/warnings. When my app instances use the volume, I saw the following in the logs

skip @logto/connector-oauth due to error: Cannot find package 'query-string' imported from /etc/logto/packages/core/connectors/@logto-connector-oauth/lib/index.js

This was for version v1.23.1

Prior to this, I was using a single instance of logto on AWS ECS so I never ran the connector setup command.

Is there anything I could do to help diagnose and resolve this issue ?

Shiti avatar Feb 05 '25 19:02 Shiti

I had this problem, and from what I understand, it is related to addConnectorsToPath in the CLI, specifically in packages/cli/src/commands/connectors/utils.ts. This happens because the connector files are extracted, but their dependencies are not installed.

I solved this problem by adding a shell script that installs the connector dependencies one by one

tevass avatar Feb 06 '25 18:02 tevass

Will update the dockerfile

wangsijie avatar Feb 19 '25 02:02 wangsijie

Hi, was wondering if there are any updates on this issue, and if there are plans to address it in the next release? Thanks.

tz379 avatar May 28 '25 00:05 tz379

Hi, was wondering if there are any updates on this issue, and if there are plans to address it in the next release? Thanks.

Yes, plan to fix this in June release.

wangsijie avatar May 28 '25 01:05 wangsijie

With the latest version of the official svhd/logto images, there’s no need to install connectors manually. You can simply run the image directly and have immediate access to all official connectors.

wangsijie avatar Jun 13 '25 08:06 wangsijie