processone / ejabberd

Robust, Ubiquitous and Massively Scalable Messaging Platform (XMPP, MQTT, SIP Server)
https://www.process-one.net/ejabberd/
Other
6.12k stars 1.51k forks source link

Not really a Bug. Building ejabberd with Elixir Distillery leads to some error #3642

Closed zemuldo closed 3 years ago

zemuldo commented 3 years ago

Hi Folks, FYI this is not a bug report. Just seeking help with this. I am using Ejabberd with Elixir.

Before creating a ticket, please consider if this should fit the discussion forum better: https://github.com/processone/ejabberd/discussions

I have ejabberd in an umbrella app . I am trying to deploy using distillery but I get the error below when I run MIX_ENV=prod mix distillery.release

Release packaging failed due to errors: ejabberd: Cannot add file _build/prod/rel/my_umbrella_project/lib/ejabberd-21.4.0/priv to tar file - _build/prod/rel/my_umbrella_project/lib/ejabberd-21.4.0/priv/sql: no such file or directory

I have no idea what the file being copied is. Any pointers will be appreciated.

Observations:

This error does not happen when using dev env with the same configuration as prod. I think its related to the env prod in ejabberd dependency but I can figure out what.

Environment

Configuration (only if needed): grep -Ev '^$|^\s*#' ejabberd.yml

ejabberd.yml:

```yaml default_db: sql certfiles: - ".certificates/fullchain.pem" - ".certificates/privkey.pem" define_macro: # TLS options for client not being able to use modern ciphers (Windows XP+, Android 3.0+) CIPHERS_INTERMEDIATE: "ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA:ECDHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-RSA-AES256-SHA256:DHE-RSA-AES256-SHA:ECDHE-ECDSA-DES-CBC3-SHA:ECDHE-RSA-DES-CBC3-SHA:EDH-RSA-DES-CBC3-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:DES-CBC3-SHA:!DSS" PROTOCOL_OPTIONS_INTERMEDIATE: - "no_sslv2" - "no_sslv3" # TLS options for client able to use modern ciphers (Windows 7+, Android 5.0+) CIPHERS_MODERN: "ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256" PROTOCOL_OPTIONS_MODERN: - "no_sslv2" - "no_sslv3" - "no_tlsv1" - "no_tlsv1_1" c2s_ciphers: CIPHERS_INTERMEDIATE c2s_protocol_options: PROTOCOL_OPTIONS_INTERMEDIATE listen: - port: 5222 ip: "::" module: ejabberd_c2s max_stanza_size: 262144 shaper: c2s_shaper access: c2s starttls_required: true - port: 5269 ip: "::" module: ejabberd_s2s_in max_stanza_size: 524288 - port: 5443 ip: "::" module: ejabberd_http request_handlers: "/api": mod_http_api "/bosh": mod_bosh "/upload": mod_http_upload "/ws": ejabberd_http_ws # web_admin: true # captcha: true ciphers: CIPHERS_INTERMEDIATE protocol_options: PROTOCOL_OPTIONS_INTERMEDIATE # tls: true - ip: "127.0.0.1" port: 5280 module: ejabberd_http request_handlers: /admin: ejabberd_web_admin "/.well-known/acme-challenge": ejabberd_acme - port: 1883 ip: "::" module: mod_mqtt backlog: 1000 s2s_use_starttls: optional acl: local: user_regexp: "" loopback: ip: - "127.0.0.0/8" - "::1/128" admin: user: - "admin@localhost" ip: - ACL_ADMIN_IP_ADDRESS access_rules: local: - allow: local c2s: - deny: blocked - allow announce: - allow: admin configure: - allow: admin muc_create: - allow: local pubsub_createnode: - allow: local register: - allow trusted_network: - allow: loopback api_permissions: "console commands": from: - ejabberd_ctl who: all what: "*" "admin access": who: - access: - allow: - acl: loopback - acl: admin - oauth: - scope: "ejabberd:admin" - access: - allow: - acl: loopback - acl: admin what: - "*" - "!stop" - "!start" "public commands": who: - ip: "127.0.0.1/8" what: - "status" - "connected_users_number" shaper: normal: 1000 fast: 50000 shaper_rules: max_user_sessions: 10 max_user_offline_messages: - 5000: admin - 100 c2s_shaper: - none: admin - normal s2s_shaper: fast modules: mod_adhoc: {} mod_admin_extra: {} mod_announce: access: announce mod_avatar: {} mod_blocking: {} mod_bosh: {} mod_caps: {} mod_carboncopy: {} mod_client_state: {} mod_configure: {} mod_disco: server_info: - modules: all name: "abuse-addresses" urls: ["mailto:abuse@$HOSTNAME"] - modules: - mod_disco - mod_vcard name: admin-addresses urls: - https://$HOSTNAME - mailto:admin@$HOSTNAME - xmpp:admin@$HOSTNAME mod_fail2ban: {} mod_http_api: {} mod_http_upload: put_url: https://@HOST@:5443/upload docroot: /var/www/upload custom_headers: "Access-Control-Allow-Origin": "https://@HOST@" "Access-Control-Allow-Methods": "GET,HEAD,PUT,OPTIONS" "Access-Control-Allow-Headers": "Content-Type" mod_last: {} mod_mam: ## Mnesia is limited to 2GB, better to use an SQL backend ## For small servers SQLite is a good fit and is very easy ## to configure. Uncomment this when you have SQL configured: db_type: sql assume_mam_usage: true default: always mod_mqtt: {} mod_muc: hosts: - conference.@HOST@ db_type: sql access: - allow access_admin: - allow: admin access_create: muc_create access_persistent: muc_create access_mam: - allow default_room_options: persistent: true allow_subscription: true mam: true mod_muc_admin: {} mod_offline: access_max_user_messages: max_user_offline_messages store_empty_body: false mod_ping: ping_ack_timeout: 10 secs ping_interval: 1 min timeout_action: kill mod_privacy: {} mod_private: {} mod_proxy65: host: MOD_PROXY_65_HOST name: "File Transfer Proxy" ip: SERVER_IP_ADDRESS port: 7778 max_connections: 5 access: proxy65_access shaper: proxy65_shaper recbuf: 10240 sndbuf: 10240 mod_pubsub: access_createnode: pubsub_createnode plugins: - "flat" - "pep" force_node_config: ## Change from "whitelist" to "open" to enable OMEMO support ## See https://github.com/processone/ejabberd/issues/2425 "eu.siacs.conversations.axolotl.*": access_model: whitelist ## Avoid buggy clients to make their bookmarks public "storage:bookmarks": access_model: whitelist mod_push: {} mod_push_keepalive: {} mod_register: ## Only accept registration requests from the "trusted" ## network (see access_rules section above). ## Think twice before enabling registration from any ## address. See the Jabber SPAM Manifesto for details: ## https://github.com/ge0rg/jabber-spam-fighting-manifesto ip_access: trusted_network mod_roster: db_type: sql versioning: true mod_shared_roster: {} mod_s2s_dialback: {} mod_stream_mgmt: resend_on_timeout: if_offline mod_stun_disco: credentials_lifetime: 12h services: - host: 0.0.0.0 port: 3478 type: stun transport: udp restricted: false - host: 0.0.0.0 port: 3478 type: turn transport: udp restricted: true - host: HOSTNAME port: 5349 type: stuns transport: tcp restricted: false - host: HOSTNAME port: 5349 type: turns transport: tcp restricted: true mod_vcard: {} mod_vcard_xupdate: {} mod_version: show_os: false ### Custom acme: auto: false auth_method: sql auth_password_format: scram # Websocket websocket_ping_interval: 30 websocket_timeout: 60 # SQL sql_type: pgsql # Custom configs include_config_file: # Database credentials config/ejabberd/database.yml: allow_only: [sql_server, sql_database, sql_username, sql_password, sql_port] # Hosts configured in env config/ejabberd/hosts.yml: allow_only: [hosts] config/ejabberd/macros.yml: {} # Logging loglevel: LOG_LEVEL_NUMBER log_rotate_size: 10485760 ... ```

Errors from error.log/crash.log

No errors

Bug description

Not a bug

Please, give us a precise description (what does not work, what is expected, etc.)

zemuldo commented 3 years ago

This helped https://github.com/processone/ejabberd/issues/3251 But the fix should go to hex.

badlop commented 3 years ago

Hi! I'm starting to learn about Elixir right now. Just for reference, here are minimal steps to reproduce it:

mix new example --umbrella
cd example
vim mix.exs

And set something like:

  defp deps do
    [{:ejabberd, ">= 21.4.0"}]
  end

Then continue:

mix deps.get
ls -l deps/ejabberd/priv
css
img
js
lua
msgs
sql -> ../sql

So sql links to ../sql, but that directory is not available.

badlop commented 3 years ago

"sql" should be included in the next ejabberd release, thanks to https://github.com/processone/ejabberd/commit/df8b0cb1a51a977622c109ff37364a9b7e2f959c