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

can't add community repo - "invalid location" error - problem solved #4897

Closed
SlalomJohn opened this issue Oct 5, 2021 · 39 comments
Closed
Labels

Comments

@SlalomJohn
Copy link

Synlogy RS815RP+ (2 node in cluster mode)

Adding repo as https://packages.synocommunity.com/
But got error
image

if i open this link in browser - got
Bad Request The browser (or proxy) sent a request that this server could not understand.

image

@BenjV
Copy link

BenjV commented Oct 5, 2021

That link can only be used as package source and cannot be opened in a browser.
That said you most likely have a netwerk issue on your side so the package source cannot be reached by DSM.
My Nas does not have any problem to reached the SynCommunity packages.

@SlalomJohn
Copy link
Author

That link can only be used as package source and cannot be opened in a browser. That said you most likely have a netwerk issue on your side so the package source cannot be reached by DSM. My Nas does not have any problem to reached the SynCommunity packages.

bash-4.3# ping packages.synocommunity.com
PING d.sni.global.fastly.net (151.101.246.133) 56(84) bytes of data.
64 bytes from 151.101.246.133 (151.101.246.133): icmp_seq=1 ttl=51 time=21.1 ms
64 bytes from 151.101.246.133 (151.101.246.133): icmp_seq=2 ttl=51 time=23.1 ms
64 bytes from 151.101.246.133 (151.101.246.133): icmp_seq=3 ttl=51 time=21.7 ms
64 bytes from 151.101.246.133 (151.101.246.133): icmp_seq=4 ttl=51 time=22.3 ms
64 bytes from 151.101.246.133 (151.101.246.133): icmp_seq=5 ttl=51 time=21.2 ms
^C
--- d.sni.global.fastly.net ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 4004ms
rtt min/avg/max/mdev = 21.126/21.915/23.156/0.752 ms
bash-4.3#

All internet sites opening. Ping work....
Previously worked at http://packages.synocommunity.com/
But at some point, it stopped downloading data from the community repository
It might be related to the old version DSM ?

@SlalomJohn
Copy link
Author

2021-10-05T14:19:03+03:00 rs815rpplus synoscgi_SYNO.Core.Package.Feed_1_add[30612]: pkgcurltool.cpp:280 Failed to curl perform, code=60, err=Error
2021-10-05T14:19:03+03:00 rs815rpplus synoscgi_SYNO.Core.Package.Feed_1_add[30612]: pkgcurltool.cpp:453 Failed to download http://packages.synocommunity.com, code=60, err=Error

This in log's

@waspsoton
Copy link

I am having the same problem

@jedisamui
Copy link

jedisamui commented Oct 5, 2021

I also get the "invalid location" error when trying to add the repo. Indeed, it was working before. I thought by removing/readding would resolve the issue, but alas, it does not. And now.... I cannot add back.

From an SSH Session into my NAS (DS1816+), I performed the following:

`$ curl -k https://packages.synocommunity.com

<title>400 Bad Request</title>

Bad Request

The browser (or proxy) sent a request that this server could not understand.

`

`curl http://packages.synocommunity.com

<title>400 Bad Request</title>

Bad Request

The browser (or proxy) sent a request that this server could not understand.

`

sudo ping packages.synocommunity.com Password: PING d.sni.global.fastly.net (146.75.46.133) 56(84) bytes of data. 64 bytes from 146.75.46.133 (146.75.46.133): icmp_seq=1 ttl=55 time=10.2 ms 64 bytes from 146.75.46.133 (146.75.46.133): icmp_seq=2 ttl=55 time=10.0 ms 64 bytes from 146.75.46.133 (146.75.46.133): icmp_seq=3 ttl=55 time=9.60 ms ^C --- d.sni.global.fastly.net ping statistics --- 3 packets transmitted, 3 received, 0% packet loss, time 2002ms rtt min/avg/max/mdev = 9.602/9.986/10.274/0.305 ms

`sudo nslookup packages.synocommunity.com
Server: 192.168.50.24
Address: 192.168.50.24#53

Non-authoritative answer:
packages.synocommunity.com canonical name = d.sni.global.fastly.net.
Name: d.sni.global.fastly.net
Address: 146.75.46.133`

It appears that I can not only reach you, but I can resolve your DNS name as well. However, attempts to curl the URL fail - whether http or https.

I've read that this has happened in the past, and it was a change in your html code. Can you check you end and validate any changes made?

@Noone2018b
Copy link

Noone2018b commented Oct 5, 2021

Same issue here, but a couple of other observations suggest it is a network issue which I don't understand...

  • It was previously working on my home, and a remote, DS1517+ unit.
  • The remote unit is still OK, but my home unit gives the same issues as listed above.
  • On both units ping & nslookup are OK and I can access the website from a computer on the same network.
  • On both units the curl test above (curl http://packages.synocommunity.com) gives a 400 result
  • On the local unit I can't see any packages in the Community section of the package manager (i.e. in an already added package source), and I also can't connect as a new package source ("invalid location" error message).
  • On the remote unit everything seems OK, I can see packages and also connect as a new package source.

UPDATED & FIXED: now fixed on my home unit after updating DSM to 6.2.4-25556 Update 2 (was DSM 6.2.3-something) and rebooting. (Although I'm not sure if it was a DSM version issue or just a clean boot would have fixed things!)

@markhofmeijer
Copy link

Same issue here (DSM 6.2.4-25556 Update 2). A reboot unfortunately does not fix it for me.

@jedisamui
Copy link

jedisamui commented Oct 5, 2021

well. I be damned..... @Noone2018b - I updated my NAS, and that seems to have resolved it for me as well.

Updated to DSM 6.2.4-25556 Update 2

@hgy59
Copy link
Contributor

hgy59 commented Oct 5, 2021

download http://packages.synocommunity.com, code=60, err=Error

you must use secure http (https://) it will not work with http (without s).

I had the same error on DSM 5.2. It first occurred on 27.09.2021

The reason is, that the /etc/ssl/certs/ca-certificates.crt file on the diskstation is outdated (last modified in 2016)
(the path or filename of the *.crt is out of my brain and might be different - I don't have access to my ds now)

I downloaded a more recent crt file (from debian repo) but the error was not gone.

finally I solved the issue by downloading the current certs.pem from openssl site (haxxe...) and saving this under the name ca-certificates.crt on the diskstation.

As I do not expect any security update for my DS-210+ from synology this file will not be updated...

@SlalomJohn
Copy link
Author

finally I solved the issue by downloading the current certs.pem from openssl site (haxxe...) and saving this under the name ca-certificates.crt on the diskstation.

Are you send my direct link to current certs.pem from openssl site ? A can't find this cert....

@BenjV
Copy link

BenjV commented Oct 6, 2021

If it is a expired certificate problem you should renew it via the control panel, security, certificate and if it is expired right click to renew it.

@SlalomJohn
Copy link
Author

SlalomJohn commented Oct 6, 2021

If it is a expired certificate problem you should renew it via the control panel, security, certificate and if it is expired right click to renew it.

Not work. This operation created request, but not renew or update current cert's
Anyone may send actual cert's from DSM - /etc/ssl/certs/ca-certificates.crt
???
My file is:
ca-certificates.crt │ 274340│May 10 2019

@hgy59
Copy link
Contributor

hgy59 commented Oct 6, 2021

If it is a expired certificate problem you should renew it via the control panel, security, certificate and if it is expired right click to renew it.

The problem I solved with a manual update of ca-certificates.crt was not the certificate on the diskstation, but that for curl the certificate used on packages.synocommunity.com is validated as expired (in fact the certificate is not expired, but one of the intermediate ca certificates in the chain could not be verified against the known ca-certificates).

@hgy59
Copy link
Contributor

hgy59 commented Oct 6, 2021

My file is:
ca-certificates.crt │ 274340│May 10 2019

my one was from 2016. So I'm not sure it is the same problem. Do you get the error 60?

@hgy59
Copy link
Contributor

hgy59 commented Oct 6, 2021

Are you send my direct link to current certs.pem from openssl site ? A can't find this cert....

try this one https://curl.se/ca/cacert.pem

@publicarray
Copy link
Member

publicarray commented Oct 7, 2021

So yes after some testing on my end I can confirm that the trust certificates on a not fully updated DSM 6 are too old (a certificate must have expired recently). If you want to continue to stay on an old versions (not recommended obviously) you can update the trust store manually by overriding the file with a more recent one (assuming you trust the curl developers), using SSH: sudo mv /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt.bak && sudo curl -Lko /etc/ssl/certs/ca-certificates.crt https://curl.se/ca/cacert.pem This will fix the issue, alternatively you can set the clock back. The best solution however is to update to a more recent DSM6 version.

https://discord.com/channels/732558169863225384/732559466721181738/893810613384515584

Might also be related to https://scotthelme.co.uk/lets-encrypt-old-root-expiration/

@publicarray publicarray changed the title can't add community repo can't add community repo - "invalid location" error Oct 7, 2021
@hgy59
Copy link
Contributor

hgy59 commented Oct 7, 2021

you can update the trust store manually by overriding the file with a more recent one (assuming you trust the curl developers),

Yes, everybody should update the DSM. My solution is for DS-210+ and other old models that do not support DSM 6.

The cacert.pem you download from curl.se is not managed by curl, but it is the pem version of the mozillas trust store, downloaded and converted by mk-ca-bundle (see https://curl.se/docs/mk-ca-bundle.html). So everything is transparent as you can inspect and execute mk-ca-bundle yourself.
Indeed our community packages included this bundle with all packages that contain curl, before we switched to the DSM integrated version to avoid the need to update packages just to update the ca-bundle (beliving that synology does the update).

@publicarray
Copy link
Member

We are saying the same thing then. It's on curl's server hence trust the file that is there and thanks yes, I failed to mention that it is from the trust store from Mozilla. The public TLS infrastructure relies on trust, so you have to trust someone. I wrote this note as quick way to make someone think before they run a sudo command from a stranger that changes a critical system file.

@hgy59
Copy link
Contributor

hgy59 commented Oct 14, 2021

synocommunity uses let's encrypt certificate and indeed, there is an issue with an expired issuer certificate in the trust chain.

https://www.openssl.org/blog/blog/2021/09/13/LetsEncryptRootCertExpire/
https://letsencrypt.org/docs/dst-root-ca-x3-expiration-september-2021/

And yes, DSM has very old openssl (DSM 5.2 has openssl 1.0.1u-fips and DSM 6.2.4 has openssl 1.0.2u-fips)

@publicarray
Copy link
Member

@hgy59 I've send an email to Synology asking how long their release rollout is. People still run into this issue about a month after the initial release of their update. I mean how long do we keep this issue open?

@mfriedrichs
Copy link

mfriedrichs commented Nov 2, 2021

IF it is a certifcate-related error, this MAY help:

I copied this file (that was mentioned before by @hgy59 ):
https://curl.se/ca/cacert.pem
to these locations:
/usr/syno/etc/certificate/system/default/
/usr/syno/etc/certificate/system/FQDN/
and renamed them to "cert.pem", after i moved the old "cert.pem" files to a backup-folder (just in case something went wrong).
After that, i navigated INTO these folders and gave the "cert.pem" files root permissions:
chown root:root cert.pem

At first, nothing changed, even after a reboot.
But when i rebooted the DSM for different reasons a few times and after a while, the repository-list was loaded.

I didn't know where to copy this file until i found this thread, where the author ( @catchdave ) also offers a script for automation:
https://gist.github.com/catchdave/69854624a21ac75194706ec20ca61327#file-replace_synology_ssl_certs-sh

Hope, this will help some of you.

@publicarray
Copy link
Member

publicarray commented Nov 2, 2021

Please don't do this. You just replaced the default TLS (Synology's self signed) certificate with the combined root trust store from Mozilla.

If you for what ever reason can't update the DSM please read the comment above: #4897 (comment)

If it works again it's probably because the NAS updated it self.

@mfriedrichs
Copy link

Please don't do this.
[...]
If you for what ever reason can't update the DSM please read the comment above: #4897 (comment)

So,- would you also be so kind to explain, WHY this should be the way, to integrate the cacert.pem from curl.se and not otherwise?
(btw: the discord link leads into emptiness and - sorry- but the other link was way too technical and too far from my understanding and seems barely related to this question).

If it works again it's probably because the NAS updated it self.

I really don't think so. If so,- it would be solved for everyone just through waiting by now.
I would be curious to know your answer to my question.

@publicarray
Copy link
Member

publicarray commented Nov 2, 2021

Sure you use any method to update your cert. But cacert.pem is not a certificate. It's the root trust store, a list of trusted Certificate Authorities (CA) for your operating system. (it's in the name CAcert.pem). Synology was a bit slow to update theirs and their rollout is really slow. File location for the trust store is in /etc/ssl/certs/ca-certificates.crt as mentioned above: #4897 (comment) not /usr/syno/etc/certificate/system/default/

I really don't think so. If so,- it would be solved for everyone just through waiting by now.

Yes the fix is to just update to 6.2.4-25556 Update 2 or later.
From the Change log: 10 Updated the OpenSSL setting in response to new rules of Let's Encrypt certificates.

TLDR: The root course is that the Synology's outdated trust store no longer trusts Let's encrypt certificates because the DST Root CA X3 expired. The fix is to update the trust store.
#4897 (comment)

If you can't follow along I recommend reading more about PKI (Public Key Infrastructure), CA's (Certificate Authority), Chain Of Trust and Public-key cryptography (Diffie–Hellman key exchange)

https://www.youtube.com/watch?v=fuK-OAyfET4

https://www.youtube.com/results?search_query=computerphile+TLS

https://www.youtube.com/watch?v=-enHfpHMBo4

@hgy59
Copy link
Contributor

hgy59 commented Nov 2, 2021

Synology was a bit slow to update theirs and their rollout is really slow

Yes, they are sloooooooooow. I got the notification for the DSM 7.0.1 update yesterday (11/02/2021) - the update was released on 10/21/2021.

@acesabe
Copy link

acesabe commented Nov 4, 2021

Just ran into this issue (and been dealing with the fallout from the same CA expiry at work for weeks!) and confirm that upgrading to the latest version of DSM 6.2.4-25556 Update 2 has indeed resolved the issue.
I did remove the SynoCommunity package repo beforehand tho in attempt to get the cert error fixed so worth trying that also if issue persists.

@SlalomJohn
Copy link
Author

#4897 (comment)
sudo mv /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt.bak && sudo curl -Lko /etc/ssl/certs/ca-certificates.crt https://curl.se/ca/cacert.pem
This issue is fix error. Very thanks!

@publicarray
Copy link
Member

Synology was a bit slow to update theirs and their rollout is really slow

Yes, they are sloooooooooow. I got the notification for the DSM 7.0.1 update yesterday (11/02/2021) - the update was released on 10/21/2021.

From communicating with Synology:

It usually takes 6~8 weeks to complete a rolling release

@mathmathou
Copy link

Hello,
I confirm that upgrading to version DSM 6.2.4-25556 Update 2 solved the issue for me as well.
After a reboot, I had no more error message when adding the package source.
DS 412+

@SlalomJohn
Copy link
Author

Hello, I confirm that upgrading to version DSM 6.2.4-25556 Update 2 solved the issue for me as well. After a reboot, I had no more error message when adding the package source. DS 412+

My two DSM is accepted certificates without reboot :)

@SlalomJohn SlalomJohn changed the title can't add community repo - "invalid location" error can't add community repo - "invalid location" error - problem solved Nov 8, 2021
@publicarray
Copy link
Member

Please don't close the issue yet so that others can find this thread more easily. If you get too many notifications you can unsubscribe from the right sidebar.

@publicarray publicarray reopened this Nov 8, 2021
@publicarray
Copy link
Member

From Synology:

Update2 has completed its rollout process, and everyone should've received that version.

@robigombek
Copy link

robigombek commented Dec 27, 2021

So yes after some testing on my end I can confirm that the trust certificates on a not fully updated DSM 6 are too old (a certificate must have expired recently). If you want to continue to stay on an old versions (not recommended obviously) you can update the trust store manually by overriding the file with a more recent one (assuming you trust the curl developers), using SSH: sudo mv /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt.bak && sudo curl -Lko /etc/ssl/certs/ca-certificates.crt https://curl.se/ca/cacert.pem This will fix the issue, alternatively you can set the clock back. The best solution however is to update to a more recent DSM6 version.

https://discord.com/channels/732558169863225384/732559466721181738/893810613384515584

Might also be related to https://scotthelme.co.uk/lets-encrypt-old-root-expiration/

These commands do the job! Thank you publicarray!!!

@gingerbeardman
Copy link

gingerbeardman commented Jan 6, 2022

using SSH: sudo mv /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt.bak && sudo curl -Lko /etc/ssl/certs/ca-certificates.crt https://curl.se/ca/cacert.pem This will fix the issue,

Thanks for the answer @publicarray!

Still useful for those of us stuck on old 6.2.3

@Doublefire-Chen
Copy link

So yes after some testing on my end I can confirm that the trust certificates on a not fully updated DSM 6 are too old (a certificate must have expired recently). If you want to continue to stay on an old versions (not recommended obviously) you can update the trust store manually by overriding the file with a more recent one (assuming you trust the curl developers), using SSH: sudo mv /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt.bak && sudo curl -Lko /etc/ssl/certs/ca-certificates.crt https://curl.se/ca/cacert.pem This will fix the issue, alternatively you can set the clock back. The best solution however is to update to a more recent DSM6 version.

https://discord.com/channels/732558169863225384/732559466721181738/893810613384515584

Might also be related to https://scotthelme.co.uk/lets-encrypt-old-root-expiration/

Thank you! It works on my DSM 6.2.1

@florisgravendeel
Copy link

I've had the same issue on DSM 6.2.1.

I performed a manual software update to renew the certificates. Updating to DSM 7.1.1 solved the problem for me.

@debuglevel
Copy link

debuglevel commented Mar 23, 2023

For the shy which do not want to update to DSM7 yet: Updated from DSM 6.x.y to 6.2.4 and works now.

@gingerbeardman
Copy link

@debuglevel please tell me more

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests