Budibase / budibase

Low code platform for building business apps and workflows in minutes. Supports PostgreSQL, MySQL, MariaDB, MSSQL, MongoDB, Rest API, Docker, K8s, and more 🚀
https://budibase.com
Other
22.47k stars 1.55k forks source link

[BUDI-7585] Error on testing "SEND EMAIL (SMTP)" automation #11952

Closed ArthurLERAY closed 1 year ago

ArthurLERAY commented 1 year ago

Checklist

Hosting

Describe the bug After creating an automation to send email via SMTP, I get two errors when clicking "Finish and test automation".

The first one is Cannot read properties of undefined (reading 'primaryDisplay') on click and then a GET 404 on https://handipharm.budibase.app/api/.../rows with a message deleted. After clicking, I can't go to any other tab ("Data", "Design", ...) and nothing seems to work.

To Reproduce Steps to reproduce the behavior:

  1. Go to 'Automation'
  2. Create a trigger on row created
  3. Create a first step to send email via SMTP
  4. Fill fields "Send To" and "Send From" with an email address
  5. Fill email subject with some words
  6. Fill HTML Contents with some basic HTML or leave empty

Expected behavior Nothing will happen. Then, when looking into the developper console, 2 errors will appear as described earlier.

Screenshots

Capture d’écran 2023-10-02 à 17 57 05

Desktop (please complete the following information):

BUDI-7585

melohagan commented 1 year ago

Hi @ArthurLERAY

I am unable to recreate this. Could you please provide more information about the automation trigger please?

Is this Row Created trigger for an internal DB, or an external DB? What fields are involved, can you provide the schema?

Can you share an app export please, and/or a recording demonstrating the issue.

FGRibreau commented 1 year ago

Regarding the export to what email can we send it?

melohagan commented 1 year ago

@FGRibreau You can send the export to support@budibase.com

ArthurLERAY commented 1 year ago

@melohagan I've just sent the app export to the support email address. Let me know if you have any issue with the export

melohagan commented 1 year ago

@melohagan I've just sent the app export to the support email address. Let me know if you have any issue with the export

I wasn't able to import the the app, possibly because I'm on a Mac and the export was a zip.

I tried to reproduce as demonstrated by @FGRibreau screenshot, however I am seeing no issues. Can you make sure you are update to date with the latest 2.11.5.

Any recordings demonstrating the bug would also be useful.

ArthurLERAY commented 1 year ago

I just updated our app version from 2.11.3 to 2.11.5 but it's still not working.

Demonstration: https://github.com/Budibase/budibase/assets/56477022/439189f9-75ae-4c5f-bd72-b079f2a12b7f

melohagan commented 1 year ago

Hey @ArthurLERAY

I'm still unable to reproduce this. As I can't make use of your app export, could you please export your related table as a CSV, and provide screenshots of the column data types.

Also provide screenshots of how your relationships are configured, and I will try to replicate.

You could also try creating a new automation and see if the error occurs for it

ArthurLERAY commented 1 year ago

Hey @melohagan, I tried to delete and re-create the automation and it "worked" better but I'm still unable to test.

Demo: https://github.com/Budibase/budibase/assets/56477022/9871a5aa-ef93-4774-b091-f24d0bd5792b

We have 2 tables:

Requests id: Number Auto ID, (required) // Display column delivery_date: Date/Time, (required) delivery_type: Options, (required) lastname: Text, (required) firstname: Text, (required) agency: Relationship - Many rows in requests | To one row in agencies, (required)

Agencies name: Text, (required) // Display column requests: Relationship - Many rows in requests | To one row in agencies, (required) -> created by BudiBase

Is this enough informations for you to replicate ?

melohagan commented 1 year ago

Thanks @ArthurLERAY

I had a go at replicating, but had no luck. I did notice however at the end of your video, this error:

Screenshot 2023-10-04 at 10 34 23

It appears that the table within Budibase has been removed from couchdb somehow.

You could try recreating the tables (export data to a CSV first if needed and re-import).

ArthurLERAY commented 1 year ago

I tried to delete the requests table but I get an error on the DELETE request : Capture d’écran 2023-10-04 à 12 25 42

Could it be because I am using this table in a form ?

Also, I noticed that when importing JSON with schema, the boolean fields are marked as "null" type

melohagan commented 1 year ago

Could it be because I am using this table in a form ?

I don't think so.

Do you have any active extensions / plugins in your web browser?

ArthurLERAY commented 1 year ago

I tried in an Incognito window with no extension allowed and I still can't delete the table.

Here is a recording of the error on delete : https://github.com/Budibase/budibase/assets/56477022/6e94bb01-703b-42e1-acf9-5ff518ad642d

melohagan commented 1 year ago

I tried in an Incognito window with no extension allowed and I still can't delete the table.

Here is a recording of the error on delete : https://github.com/Budibase/budibase/assets/56477022/6e94bb01-703b-42e1-acf9-5ff518ad642d

Could you try deleting the relationship columns first, and then delete the table?

Otherwise the app itself may have got into a bad state, and you could try creating a new app.

ArthurLERAY commented 1 year ago

Hey, I tried deleting the relationship column but I get a 404 deleted: https://github.com/Budibase/budibase/assets/56477022/d9a2412c-530e-44cb-8503-90029a60c9c2

After refreshing, it appears that the column was deleted anyway. I still can't delete the requests table, so it must be the app that got into a bad state.

I'll try to create a new app, create the same tables architecture and see if the automation works. If it does, is there any way to copy design screens from an app to another ?

melohagan commented 1 year ago

is there any way to copy design screens from an app to another ?

@ArthurLERAY currently this isn't possible, however you could also try exporting the app, and importing it as a brand new app. When the app is imported, it should create new tables, which may help to fix the problem.

ArthurLERAY commented 1 year ago

Hi @melohagan, I just tried to export the app, create a new one and import the files but it does not work.

I removed the relationship column and the automation before the export. I have the exact same error when creating a new automation on the new app.

melohagan commented 1 year ago

Hey @ArthurLERAY Could you send an app export to support@budibase.com please?

melohagan commented 1 year ago

@ArthurLERAY I've pushed up a fix, as of version 2.11.14, that will allow you to delete relationship columns even in the rare event that the linked table is missing.

Could you try updating now and deleting the equipment_id column. I believe that will resolve the automation problems you were seeing.

ArthurLERAY commented 1 year ago

@melohagan Nice thank you !

Automation works well I can go further and test it completely.

But the "Send Mail" action does not work and I can't see why. Here is the error output I'm getting :

Capture d’écran 2023-10-06 à 17 14 38

Should I open another issue ?

melohagan commented 1 year ago

@ArthurLERAY That error message is certainly not very helpful, but it may be a configuration issue. Are the Send To and Send From fields definitely valid email addresses?

ArthurLERAY commented 1 year ago

@melohagan Yes both are valid email addresses :

Capture d’écran 2023-10-08 à 13 07 59

I tried with one of my own email address for the From field but without success

melohagan commented 1 year ago

Thanks @ArthurLERAY

If you publish the app and test the automation in your published app, is it also failing? Perhaps the SMTP settings are misconfigured?

ArthurLERAY commented 1 year ago

I just tried after publishing the app but it does not work.

Am I able to edit the app SMTP settings somewhere ?

melohagan commented 1 year ago

I just tried after publishing the app but it does not work.

Am I able to edit the app SMTP settings somewhere ?

Yep, there's an email in the portal: https://docs.budibase.com/docs/email

ArthurLERAY commented 1 year ago

Hi @melohagan, Works perfectly thanks a lot !