Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to connect to FTP server after latest update #721

Closed
andjones132 opened this issue Oct 22, 2021 · 8 comments · Fixed by #730
Closed

Unable to connect to FTP server after latest update #721

andjones132 opened this issue Oct 22, 2021 · 8 comments · Fixed by #730
Assignees

Comments

@andjones132
Copy link

I just downloaded the latest version of allsky and installed it on a fresh intall of RasbianOS. I also installed the Web Gui. I updated the ftp-settings.sh file usin the Editor in the web gui and input the exact same setting that I used with a previous install of allsky, but now I cannot get the files to write to my Synology NAS.

If I I look at the upload_log.txt in the allsky/tmp directory, I am seeing the following error message"

put: image.jpg: Fatal error: Certificate verification: Not trusted (93:3C:6D:DE:E9:5C:9C:41:A4:0F:9F:50:49:3D:82:BE:03:AD:87:BF)
put of image.jpg failed!
mv: Fatal error: Certificate verification: Not trusted (93:3C:6D:DE:E9:5C:9C:41:A4:0F:9F:50:49:3D:82:BE:03:AD:87:BF)
mv of SaveImageDay-1118 to image.jpg in /remote/observatory/allskycam/images/ failed!

I am not sure why this is happening as I have not changed anything on the nas since I last and allsky installed and it worked without any issues. Has any one else experience issues with the ftp working? I tried to run the upload.sh script, but I don't know the arguments that it expects for ftp. I would welcome any advice on how to debug this issue.

@andjones132
Copy link
Author

I tried running the following commands from the /tmp/lftp_cmds.txt file, but when I try to execute the 'open' command I get error: -bash: open: command not found

set ssl:check-hostname false
open --user 'username' --password 'secret' 'ftp://192.168.1.5'
set net:max-retries 2
set net:timeout 20
rm -f '/remote/observatory/allskycam/images/SaveImageDay-13954'
put 'image.jpg' -o '/remote/observatory/allskycam/images/SaveImageDay-13954' || (echo 'put of image.jpg failed!'; exit $rm -f '/remote/observatory/allskycam/images/image.jpg'
mv '/remote/observatory/allskycam/images/SaveImageDay-13954' '/remote/observatory/allskycam/images/image.jpg' || ( echo$exit 0

@EricClaeys
Copy link
Collaborator

@andjones132, the Wiki has a page on troubleshooting uploads. It should allow you to solve your certificate issue.

The last line of the Wiki page should solve your "open" issue:
To see lftp messages line-by-line, enter lftp followed by enter, then copy each line from the lftp_cmds.txt and paste into the terminal window.

You probably did enter "lftp" first.

@andjones132
Copy link
Author

@EricClaeys thanks for the info. I finally figured out after going through the upload.sh file that i had to enter lfpt first. I was then able to execute the lines in the lftp_cmds.txt file. I think I found the problem. On my synology I had Enable FTP SSL/TLS encryption service check in my FTP settings. When I unchecked this option and re-ran the "put" command, then it copied the image to the Synology FTP directory. I don't remember making any changes recently to my FTP settings on my Synology so not sure exactly what changed and why it worked previously. I will leave SSL off for now.

I see from one of the scripts that they are working on SFTP, so maybe I will be able to use SSL in the future.

Question: to use FTP uploads, do I need to have UPLOAD_* all set to True? It says for website, but not sure if this applies to FTP as well.

@EricClaeys
Copy link
Collaborator

@andjones132, Would you please look at the Wiki page on troubleshooting uploads and let me know if it needs rewording so other people don't have the same issue you did? I'm trying to make the pages really useful.

Is it possible you had something in the LFTP_COMMANDS variable in ftp-settings.sh? Or in the ~/.lftprc file?

SFTP should work - all the code is there. I don't think my web server provider supports it so I haven't tested it. You can try and let me know.

Each of the file types (images, keograms, startrails, and videos) has its own UPLOAD variable in config.sh that determines if it should be uploaded. The upload.sh script doesn't know what it's uploading, and is only called by another script if the appropriate UPLOAD variable is true. For example, in endOfNight.sh and saveImageDay.sh/saveImageNight.sh.

Does this answer your (good) questions?

@andjones132
Copy link
Author

I think I figured out the issue.

In the ftp-settings.sh file in the web gui Editor, it says to use:

	# If you need special commands executed when connecting to the FTP server enter them here.
	# For example, to allow lftp to work with unknown certificates, use:
	#	LFTP_COMMANDS="set ssl:check-hostname false"
	# If you have more than one command to enter, separate them with semicolons (;).

So I had set LFTP_COMMANDS="set ssl:check-hostname false. When I read through the troubleshooting uploads wiki, I notice it said to use LFTP_COMMANDS="set ssl:verify-certificate no". Once I change my LFTP_COMMANDS in ftp-settings.sh to use LFTP_COMMANDS="set ssl:verify-certificate no", then it started working even with FTP SSL/TSL enabled on my NAS.

It might be helpful to update the comment in the ftp-settings.sh file to reflect this change.

Thanks @EricClaeys for your help.

@EricClaeys
Copy link
Collaborator

@andjones132,
Glad you got it working, and thanks for the feedback. I can see why you would have set it per the example in ftp-settings.sh. Would it help if I removed the example, and instead said "See the Wiki for example commands to enter into LFTP_COMMANDS"?

@EricClaeys EricClaeys reopened this Oct 23, 2021
@mil-cha
Copy link

mil-cha commented Oct 23, 2021

Hello,
I added this line on the End of file /etc/lftp.conf
set ssl:verify-certificate no

@andjones132
Copy link
Author

andjones132 commented Oct 24, 2021 via email

EricClaeys added a commit that referenced this issue Oct 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants