RSConnect Quickstart Issue - Mail Report

I'm able to login to localhost:5000/webmail, but sending mail from RSConnect platform gives Unable to send mail... error.

Digging into the Admin > Settings to Send Test Mail, it gives Error: Cannot connect to SMTP host: localhost:0: dial tcp [::1]:0: connect: connection refused.

Is there a RStudio guide to set up Sendmail config in QuickStart VM?

Uh oh! That's no good!

It looks like it may not be using the right port... Connect should be using SMTP, as well as localhost and port 25 in the Admin > Settings panel. Is that what you see? Can you share a screen-shot?

You can test in a terminal if the smtp service is working by executing sudo netstat -lntp. You can share the output here, if you want! Basically, there should be a service listening on port 25 and port 111 (if I remember correctly).

There is some dirty hackery going on to get the SMTP "demo" working :smile: It usually just works, so I'm not sure why it is broken for you!

@cole: you're very prompt, as always!

Indeed, ports 25 and 111 seems to be open.

rstudio@rstudio-quickstart:~$  sudo netstat -lntp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 0.0.0.0:5000            0.0.0.0:*               LISTEN      553/nginx: master p
tcp        0      0 0.0.0.0:111             0.0.0.0:*               LISTEN      381/rpcbind
tcp        0      0 127.0.0.53:53           0.0.0.0:*               LISTEN      380/systemd-resolve
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      540/sshd
tcp        0      0 0.0.0.0:25              0.0.0.0:*               LISTEN      510/smtp-sink
tcp        0      0 127.0.0.1:6010          0.0.0.0:*               LISTEN      623/sshd: rstudio@p
tcp6       0      0 :::5000                 :::*                    LISTEN      553/nginx: master p
tcp6       0      0 :::143                  :::*                    LISTEN      560/couriertcpd
tcp6       0      0 :::111                  :::*                    LISTEN      381/rpcbind
tcp6       0      0 :::8080                 :::*                    LISTEN      562/apache2
tcp6       0      0 :::22                   :::*                    LISTEN      540/sshd
tcp6       0      0 ::1:6010                :::*                    LISTEN      623/sshd: rstudio@p
tcp6       0      0 :::3939                 :::*                    LISTEN      25433/connect

In Admin > Settings, port is blank and greyed out, but other fields do point to correct value, as you noted.

From the Email Setup guide, it seems we need to add the port value in a config file; are there any pointers :pray:

Haha yes! We try! :smile: Convenient timing, really :smile: Ohh strange! Did you update RStudio Connect, per chance? I think the version I built last was missing some of the new SMTP goodies in a config file. I'm wondering if there is a bug in the upgrade / migration process.

Check out these files:

cat /etc/rstudio-connect/rstudio-connect.gcfg
cat /etc/rstudio-connect/rstudio-connect-migration.gcfg

There should be an SMTP block there that you can edit. Then you will need to either restart or reload Connect. (sudo systemctl restart rstudio-connect).

Ultimately, you will want lines that look like this in the rstudio-connect.gcfg file, preferably. The migration file is just a temporary holdover when migrating versions that have a breaking config change.

[Server]
EmailProvier = SMTP

[SMTP]
Host = localhost
Port = 25

Hopefully that will get you running! Apologies in advance if you're unfamiliar with text editing on a linux computer, as it can be a bit of work :slight_smile: nano or vim are the usual culprits, and sudo nano /etc/rstudio-connect/rstudio-connect.gcfg may be necessary.

1 Like

Indeed port was missing.

rstudio@rstudio-quickstart:~$ cat /etc/rstudio-connect/rstudio-connect.gcfg
; RStudio Connect Quickstart configuration file

[Server]
SenderEmail = rstudio-connect@example.com

Address = http://localhost:5000/rsconnect/
PublicWarning = <b>WARNING: This is a Quickstart Server and using it in production is not supported</b>
LoggedInWarning = <b>WARNING: This is a Quickstart Server and using it in production is not supported</b>

ExpandedViewUI = true
DefaultContentListView = "expanded"

[HTTP]
Listen = :3939
NoWarning = true

[Authentication]
Provider = pam
Notice = "WARNING: This is a Quickstart Server and using it in production is not supported. Login with user/password rstudio/rstudio"

[Applications]
RConfigActive = quickstart

[Python]
Enabled = true
Executable = /opt/Python/3.7.1/bin/python3
rstudio@rstudio-quickstart:~$ cat /etc/rstudio-connect/rstudio-connect-migration.gcfg
cat: /etc/rstudio-connect/rstudio-connect-migration.gcfg: Permission denied
rstudio@rstudio-quickstart:~$ sudo cat /etc/rstudio-connect/rstudio-connect-migration.gcfg

; This is an automatically generated file and it should not be
; modified. Use the command `rscadmin configure --append-migration` to
; move any settings declared here to your main configuration file.
;
; The Configuration Migration section in the Configuration Appendix
; of the Admin Guide explains how to work with the migration file.
;
[Server]
EmailProvider = "smtp"

[SMTP]
Host = "localhost"
StartTLS = "never"


; End of the migration

Edited

rstudio@rstudio-quickstart:~$ sudo cat /etc/rstudio-connect/rstudio-connect-migration.gcfg

; This is an automatically generated file and it should not be
; modified. Use the command `rscadmin configure --append-migration` to
; move any settings declared here to your main configuration file.
;
; The Configuration Migration section in the Configuration Appendix
; of the Admin Guide explains how to work with the migration file.
;
[Server]
EmailProvider = "smtp"

[SMTP]
Host = "localhost"
Port = 25
StartTLS = "never"

; End of the migration

Had to keep StartTLS = "never" for it to work.

Indeed, original config file was missing port info.

rstudio@rstudio-quickstart:~$ cat /etc/rstudio-connect/rstudio-connect.gcfg
; RStudio Connect Quickstart configuration file

[Server]
SenderEmail = rstudio-connect@example.com

Address = http://localhost:5000/rsconnect/
PublicWarning = <b>WARNING: This is a Quickstart Server and using it in production is not supported</b>
LoggedInWarning = <b>WARNING: This is a Quickstart Server and using it in production is not supported</b>

ExpandedViewUI = true
DefaultContentListView = "expanded"

[HTTP]
Listen = :3939
NoWarning = true

[Authentication]
Provider = pam
Notice = "WARNING: This is a Quickstart Server and using it in production is not supported. Login with user/password rstudio/rstudio"

[Applications]
RConfigActive = quickstart

[Python]
Enabled = true
Executable = /opt/Python/3.7.1/bin/python3
rstudio@rstudio-quickstart:~$ cat /etc/rstudio-connect/rstudio-connect-migration.gcfg
cat: /etc/rstudio-connect/rstudio-connect-migration.gcfg: Permission denied
rstudio@rstudio-quickstart:~$ sudo cat /etc/rstudio-connect/rstudio-connect-migration.gcfg

; This is an automatically generated file and it should not be
; modified. Use the command `rscadmin configure --append-migration` to
; move any settings declared here to your main configuration file.
;
; The Configuration Migration section in the Configuration Appendix
; of the Admin Guide explains how to work with the migration file.
;
[Server]
EmailProvider = "smtp"

[SMTP]
Host = "localhost"
StartTLS = "never"


; End of the migration

Edited

rstudio@rstudio-quickstart:~$ sudo cat /etc/rstudio-connect/rstudio-connect-migration.gcfg

; This is an automatically generated file and it should not be
; modified. Use the command `rscadmin configure --append-migration` to
; move any settings declared here to your main configuration file.
;
; The Configuration Migration section in the Configuration Appendix
; of the Admin Guide explains how to work with the migration file.
;
[Server]
EmailProvider = "smtp"

[SMTP]
Host = "localhost"
Port = 25
StartTLS = "never"

; End of the migration

I left the /etc/rstudio-connect/rstudio-connect.gcfg as is.

Had to keep the StartTLS = "never" setting for this to work :slight_smile:

Interesting!! Well done, and thanks so much for sharing! I'm now a bit concerned that this is a bug in the product's upgrade process, so I will do some sleuthing to find out if that is the case. :smile:

Definitely let us know if you run into any more issues! I'm glad to hear that the email demo is working!

2 Likes

All thanks to your detailed instructions!

Just posted another issue related to connecting RSConnect with desktop RStudio for publishing functionality; guess you'll be the one answering it too :sweat_smile:!

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.