MBS CURL failing with New Server

Is there any obvious reason why my Windows app can no longer connect via MBS CURL (sftp) to my webapp that has been moved from an old xojo cloud server to a new xojo cloud server? I have updated the IP and SFTP password in the Windows app, and cannot figure out what else could be going wrong.

The error message indicates: Can not resolve host (error code 6).

I’m assuming that if you have a domain, moved that too?

DNS fails?
Invalid domain name?

[quote=317066:@Christian Schmitz]DNS fails?
Invalid domain name?[/quote]
Yes, domain moved as well, and I verified it points to the correct IP (including with an SFTP client I use).
I just tried again first thing this morning - forgot to update the password (which I did correctly yesterday), and CURL responded with correct “Wrong Password” error. So then I corrected the password, tried again, and now getting the “Cannot resolve host” error again. This is similar to what happened yesterday.
Silly theory: something gets “stuck” after the bad password attempt. Going to reboot/restart and try again with good password and see what happens.

Nope - that didn’t fix it. I also tried adding uCURL.OptionFreshConnect=True to the code - but that didn’t work.

I can’t wait to figure out what silly thing I am doing wrong - but very much appreciate all help I can get.

On my DNS server, I only have an “ftp” record; I assume I don’t need a separate “sftp” record - right? I don’t recall ever having an “sftp” record before.

In case this helps - I am also using these statements:

uCURL.OptionFTPSSL = uCURL.kFTPSSL_CONTROL // Require SSL for the control connection or fail with CURLE_USE_SSL_FAILED.
uCURL.OptionSSLVerifyPeer=0 // don't verify peer
uCURL.OptionSSLVerifyHost=0 // ignore host name in verify

Does the new host know that he has a new domain too? I’ve had similiar issues but with SSH logins on a webserver. My DNS was updated but the DNS at my ISP not.

Not sure I get the question - but I have actually moved an existing domain to a new server. Both servers are Xojo Cloud managed.

For OptionUseSSL you better use 3 to encrypt data and control streams.
SFTP (with SSH) can’t be unencrypted.

OptionSSLVerifyPeer and OptionSSLVerifyHost are set to zero automagically by the plugin if you don’t specify the certificates.

for Mark, we can only help you if you give us the debug messages (e.g. from debugData property)

Here is what I get from the CURL…

From the DebugMessage event on the Class
UploadCURL DebugMessage: 0, Could not resolve host: mysftppassword@mydomainname
UploadCURL DebugMessage: 0, Closing connection 0

From the handler that captures the CURL response error in my code
uCURL DebugData:
uCURL error code = 6

The way I am setting up the CURL is as follows (I am starting to think this is the wrong way, but my code used to work this way):

uCURL.OptionURL="sftp://mysftpusername:mysftppassword@mydomainname/datadirectory/filename"

It turns out that the sftp password has all sorts of special characters in it, including @ & $
I don’t know if any of those characters are causing an issue?

OK - rereading my post I think I am seeing something embarrassing. I see that “@” is a character in my sftp password. Isn’t that a “Duh”. I guess I should somehow encode this???

…post edit
And after further analysis - I see that the unresolved address is everything after the “@” in my sftp password. That pretty much confirms where the error is coming from. Doh!

Please put password and username into OptionPassword and OptionUserName and not in the URL!

I was going to look for those commands - assumed you had something like that available. Thanks.

OK - got passed the credentials, now the process is properly crawling to the destination data directory - as evidenced by debug messages indicating "Creating directory ‘/maindatadir/userdatadir’ "
But then it gets to writing the file, and I get this message: “Creating the dir/file failed: No such file or directory

The way I am writing the file via CURL is as follows:

b=f.OpenAsBinaryFile(false) uCURL.stream=b uCURL.OptionInFileSize=b.Length uCURL.OptionURL="sftp://mydomainnam/maindatadir/userdatadir/"+f.name

In the documentation I have, there is a reference to “OptionFTPAppend as Boolean” - but that does not seem to be an active option (not recognized in the IDE). Is there some file overwrite option I should be setting.

FYI: the file does exist on the server - so I am trying to overwrite it.

I think OptionFTPAppend was renamed OptionAppend.

Thanks. Set that to both true and false - no difference. Paths all look good. Tried different literal file name - still no success.
When I get a chance I am going to just try to write some text (not in a file) and see if I can do that.