Commands not installing

/wikipedia command not working
I am running Nextcloud 19.01
I just installed talk
and I ran
sudo -u www-data php occ talk:command:add-samples from /var/www/nextcloud
I get,

PHP Warning:  file_get_contents(https://en.wikipedia.org/w/api.php?action=query&generator=prefixsearch&gpssearch=Nextcloud&prop=description%7Cinfo&format=json&formatversion=2&inprop=url): failed to open stream: Connection timed out in /var/www/nextcloud/apps/spreed/sample-commands/wikipedia.php on line 54
PHP Fatal error:  Uncaught TypeError: json_encode() expects parameter 2 to be int, bool given in /var/www/nextcloud/apps/spreed/sample-commands/wikipedia.php:55
Stack trace:
#0 /var/www/nextcloud/apps/spreed/sample-commands/wikipedia.php(55): json_encode()
#1 {main}
  thrown in /var/www/nextcloud/apps/spreed/sample-commands/wikipedia.php on line 55
An error occured while setting up the wiki command

do you need the logs?

failed to open stream: Connection timed out

Check the connection from your server to Wikipedia.

1 Like

@tcit
How do I do this? Would it be curl https://en.wikipeida.org?

For instance, yes. You may add some -vvv options to get more information. Otherwise dig, ping and traceroute can help too.

@tcit I ran curl https://en.wikipedia.org -vvv and I got

*   Trying 208.80.153.224:443...
* TCP_NODELAY set
* Connected to en.wikipedia.org (208.80.153.224) port 443 (#0)
* ALPN, offering h2
* ALPN, offering http/1.1
* successfully set certificate verify locations:
*   CAfile: /etc/ssl/certs/ca-certificates.crt
  CApath: /etc/ssl/certs
* TLSv1.3 (OUT), TLS handshake, Client hello (1):
* TLSv1.3 (IN), TLS handshake, Server hello (2):
* TLSv1.3 (IN), TLS handshake, Encrypted Extensions (8):
* TLSv1.3 (IN), TLS handshake, Certificate (11):
* TLSv1.3 (IN), TLS handshake, CERT verify (15):
* TLSv1.3 (IN), TLS handshake, Finished (20):
* TLSv1.3 (OUT), TLS change cipher, Change cipher spec (1):
* TLSv1.3 (OUT), TLS handshake, Finished (20):
* SSL connection using TLSv1.3 / TLS_AES_256_GCM_SHA384
* ALPN, server accepted to use h2
* Server certificate:
*  subject: CN=*.wikipedia.org
*  start date: Jul 20 09:02:07 2020 GMT
*  expire date: Oct 18 09:02:07 2020 GMT
*  subjectAltName: host "en.wikipedia.org" matched cert's "*.wikipedia.org"
*  issuer: C=US; O=Let's Encrypt; CN=Let's Encrypt Authority X3
*  SSL certificate verify ok.
* Using HTTP2, server supports multi-use
* Connection state changed (HTTP/2 confirmed)
* Copying HTTP/2 data in stream buffer to connection buffer after upgrade: len=0
* Using Stream ID: 1 (easy handle 0x5647d6952c20)
> GET / HTTP/2
> Host: en.wikipedia.org
> user-agent: curl/7.68.0
> accept: */*
> 
* TLSv1.3 (IN), TLS handshake, Newsession Ticket (4):
* Connection state changed (MAX_CONCURRENT_STREAMS == 100)!
< HTTP/2 301 
< date: Fri, 28 Aug 2020 15:19:01 GMT
< server: mw1330.eqiad.wmnet
< x-content-type-options: nosniff
< p3p: CP="See https://en.wikipedia.org/wiki/Special:CentralAutoLogin/P3P for more info."
< vary: Accept-Encoding,X-Forwarded-Proto,Cookie,Authorization
< cache-control: s-maxage=1200, must-revalidate, max-age=0
< x-request-id: a9d81be3-2943-4ad8-9c3e-802f47eac356
< last-modified: Fri, 28 Aug 2020 15:19:01 GMT
< location: https://en.wikipedia.org/wiki/Main_Page
< content-length: 0
< content-type: text/html; charset=utf-8
< age: 682
< x-cache: cp2041 miss, cp2041 hit/143
< x-cache-status: hit-front
< server-timing: cache;desc="hit-front"
< strict-transport-security: max-age=106384710; includeSubDomains; preload
< set-cookie: WMF-Last-Access=28-Aug-2020;Path=/;HttpOnly;secure;Expires=Tue, 29 Sep 2020 12:00:00 GMT
< set-cookie: WMF-Last-Access-Global=28-Aug-2020;Path=/;Domain=.wikipedia.org;HttpOnly;secure;Expires=Tue, 29 Sep 2020 12:00:00 GMT
< x-client-ip: 199.66.15.46
< set-cookie: GeoIP=US:IA:Indianola:41.31:-93.59:v4; Path=/; secure; Domain=.wikipedia.org
< 
* Connection #0 to host en.wikipedia.org left intact

@tcit is my connection to Wikipedia working?

It seems you have too many concurrent connections to wikipedia.

How is that posable?