YunoHost-Apps / castopod_ynh

Castopod package for YunoHost
https://podlibre.org/
GNU General Public License v3.0
23 stars 7 forks source link

Can't add user because castopod can't send email #100

Open clawfire opened 1 year ago

clawfire commented 1 year ago

Describe the bug

After a fresh install, I wanted to add my first podcast producer user. Got

Désolé, il y a eu un problème lors de l'envoi de l'email. Nous ne pouvons pas envoyer un email à "[EMAIL REDACTED FOR CONFIDENTIALITY]"

(yes with those unescaped char ^^)

Context

Steps to reproduce

Expected behavior

User is created and an email is sent to that user

ericgaspar commented 11 months ago

Upgrading to the last version 1.6.5 should fix email and can be tested:

sudo yunohost app upgrade castopod -u https://github.com/YunoHost-Apps/castopod_ynh/tree/testing
clawfire commented 11 months ago

I would love to but I have an error packaging.version.InvalidVersion: Invalid version: '1.1.2~ynh2'. Can't get my catalog listing either since the last os package update.

Fixed it 😁. I ran the command for the upgrade 👍🏼 waiting for it to be completed.

clawfire commented 11 months ago

hum ... I ran the command and the upgrade went well but then there's a LOT of errors in the server happening. I gonna try to restart the webserver.

My castopod instance is here https://podcast.djs.lu/

orhtej2 commented 11 months ago

Updated 1.6.5 released, mail support is in progress.

clawfire commented 8 months ago

Upgrading to the last version 1.6.5 should fix email and can be tested:

sudo yunohost app upgrade castopod -u https://github.com/YunoHost-Apps/castopod_ynh/tree/testing

Now I used this, can't upgrade using YNH web interface. Any tips on how to return to some state that can be managed by YNH ?

orhtej2 commented 8 months ago

Why can't you? Can you please share logs if the upgrade is failing?

clawfire commented 8 months ago

Sure thing. Full log can be found here

My guess is this cause the issue:

2024-01-02 21:32:46,265: DEBUG - [mysqli_sql_exception]
2024-01-02 21:32:46,265: DEBUG - 
2024-01-02 21:32:46,265: DEBUG - Table 'cp_media' already exists
2024-01-02 21:32:46,266: DEBUG - 
2024-01-02 21:32:46,266: DEBUG - at SYSTEMPATH/Database/MySQLi/Connection.php:306

I gonna make a backup and try to reinstall castopod, then apply the backup. We'll see.

orhtej2 commented 8 months ago

What you're describing is not how backups work unfortunately (backup actually reinstalls the app, so it's impossible to apply backup on top of existing app), I'll try to repro the issue and work around it.

orhtej2 commented 8 months ago

Can you try running as root:

sudo -u postgres psql --dbname=castopod --command="UPDATE cp_migrations SET class='Media\\\\Database\\\\Migrations\\\\AddMedia', namespace='Media' where class='App\\\\Database\\\\Migrations\\\\AddMedia'"

Does this report smth along the lines of '1 row updated'? If so, can you try running upgrade from web admin again?

clawfire commented 8 months ago

The backup didn't restore the postgres database :( so got a "no database nammed castopod" 😢

I gonna reinstall it all

orhtej2 commented 8 months ago

I'm sorry to hear that :/

You didn't create a backup prior to uninstalling, did you?

On Wed, Jan 3, 2024 at 2:22 PM Thibault Milan @.***> wrote:

Closed #100 https://github.com/YunoHost-Apps/castopod_ynh/issues/100 as completed.

— Reply to this email directly, view it on GitHub https://github.com/YunoHost-Apps/castopod_ynh/issues/100#event-11379140665, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAV5D5SDKFKNXM3BHWVTWJDYMVLRTAVCNFSM6AAAAAA2UNPX2OVHI2DSMVQWIX3LMV45UABCJFZXG5LFIV3GK3TUJZXXI2LGNFRWC5DJN5XDWMJRGM3TSMJUGA3DMNI . You are receiving this because you commented.Message ID: @.***>

clawfire commented 8 months ago

I did. If I reinstall, can't apply the backup because there's already the app install. If I restore the backup, pgsql database seems missing / isn't restored 😢

clawfire commented 8 months ago

Reopening because the latest version has broken email sending again so I cannot add user on my fresh install >.>

I configured an external SMTP service in the .env file to check. Same issue.

orhtej2 commented 8 months ago

That is strange, local mail setup was always broken, but why is it with external vendor? Any logs? What conf (roughly) are you using?

clawfire commented 8 months ago

Here's my config file

.env file ``` #-------------------------------------------------------------------- # Example Environment Configuration file # # This file can be used as a starting point for # your castopod instance settings. # # For manual configuration: # - copy this file's contents to a file named `.env` # - replace all the default settings with your values # - go to `/cp-install` to complete installation #-------------------------------------------------------------------- #-------------------------------------------------------------------- # Instance configuration #-------------------------------------------------------------------- app.baseURL="https://podcast.djs.lu/" media.baseURL="https://podcast.djs.lu/" admin.gateway="admin" auth.gateway="auth" media.root="media" media.storage="/home/yunohost.app/castopod" #-------------------------------------------------------------------- # Database configuration #-------------------------------------------------------------------- database.default.hostname="localhost" database.default.database="castopod" database.default.username="castopod" database.default.password="[PASSWORD]" database.default.DBPrefix="cp_" #-------------------------------------------------------------------- # Email configuration #-------------------------------------------------------------------- email.fromEmail="no-reply@podcast.djs.lu" email.fromName="DJs.lu podcast" email.SMTPHost="smtp.postmarkapp.com" email.SMTPPort="25" email.SMTPUser="[USER]" email.SMTPPass="[PASSWORD]" email.SMTPCrypto="tls" #-------------------------------------------------------------------- # Cache configuration (advanced) # # Keep as is if you don't know what this means #-------------------------------------------------------------------- cache.handler="file" #-------------------------------------------------------------------- # Redis configuration #-------------------------------------------------------------------- cache.handler="redis" cache.redis.host="127.0.0.1" cache.redis.password=null cache.redis.port=6379 cache.redis.database=1 #-------------------------------------------------------------------- # S3 configuration #-------------------------------------------------------------------- media.fileManager="s3" media.s3.endpoint="podcastdjslu" media.s3.key="[KEY]" media.s3.secret="[SECRET]" media.s3.region="eu-central-1" #-------------------------------------------------------------------- # REST API configuration #-------------------------------------------------------------------- # restapi.enabled=true # restapi.basicAuthUsername=castopod # restapi.basicAuthPassword=password # restapi.basicAuth=true ```

Nothing arrive on my SMTP at all. The issue is even before this. Don't know where I could check logs though.

orhtej2 commented 8 months ago

The e-mail config seems OK. Are you sure the credentials you're passing are valid? Are you able to use these successfully with 'normal' e-mail client?

clawfire commented 8 months ago

They are the one I used before reinstalling castopod so yes :/

Milan Thibault 📝 clawfire.net ( http://clawfire.net/ ) • 🐦 @clawfire ( https://twitter.com/clawfire ) • 🗣 he/him 🧘🏻  Not urgent? consider writing me a ponymail ( https://ponymessenger.com/invite/RGVVFQ ) then

📱 I made a web app that lets you store your EU Covid Digital Certificate into your phone wallets. It’s free, ad-free, tracking-free, open-source. Try it now ( https://covid19passbook.netlify.app/ ) !

On Fri, Jan 05, 2024 at 11:32:18, Mateusz < @.*** > wrote:

The e-mail config seems OK. Are you sure the credentials you're passing are valid? Are you able to use these successfully with 'normal' e-mail client?

— Reply to this email directly, view it on GitHub ( https://github.com/YunoHost-Apps/castopod_ynh/issues/100#issuecomment-1878453680 ) , or unsubscribe ( https://github.com/notifications/unsubscribe-auth/AAAAJGRL5YTGDVL4VZQUYFTYM7JDFAVCNFSM6AAAAAA2UNPX2OVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNZYGQ2TGNRYGA ). You are receiving this because you modified the open/close state. Message ID: <YunoHost-Apps/castopod_ynh/issues/100/1878453680 @ github. com>

maxlinux2000 commented 3 months ago

Hi, this bug still occurs on 1.11.0~ynh1 version just installed.

The installation is the one that comes by default with yunohost, on a private commercial domain with a letsencrypt certificate. Nothing else.

tnx MaX