WordPress.org

Forums

Not able to search for new themes (21 posts)

  1. londonnet
    Member
    Posted 1 year ago #

    I have performed a fresh install of WP

    Everything is working accept I can't search for themes but I can search for plugins.

    When I search for themes I get the following error message

    An unexpected error occurred. Something may be wrong with WordPress.org or this server’s configuration. If you continue to have problems, please try the support forums.

    Try again

    I do not think this is a connectivity issue as I can download plugins etc

  2. Tara
    Volunteer Moderator
    Posted 1 year ago #

    WP free theme repository: http://wordpress.org/themes/

  3. londonnet
    Member
    Posted 1 year ago #

    Thanks for the reply. I'm reporting an issue with my wp configuration or permissions.

    I am trying to use the search theme and install tool buil into wordpress.

    When I click the search button I get the following error message after a time out period.

    "An unexpected error occurred. Something may be wrong with WordPress.org or this server’s configuration. If you continue to have problems, please try the support forums."

    ownership of the files is set to the Apache user
    I set for the purposes of testing my root http directory to 777 recursively
    Selinux in not enabled

    Has anyone sean and fixed this issue before?

  4. londonnet
    Member
    Posted 1 year ago #

    I got debug working and get the following error message when I search for themes using the search key at /wp-admin/network/theme-install.php

    but I don't think this is related to my issue

    [14-Oct-2013 22:59:52] PHP Notice: wpdb::escape is deprecated since version 3.6! Use wpdb::prepare() or esc_sql() instead. in /var/www/html/wp-includes/functions.php on line 2905

  5. Tara
    Volunteer Moderator
    Posted 1 year ago #

    - To rule out any theme-specific issue, try switching to the unedited default theme for a moment using the WP dashboard. If you don't have access to your admin area, you can switch to the default theme by renaming your current theme's folder in wp-content/themes and adding "-old" to the end of the folder name using via FTP or SFTP or whatever file management application your host provides. Alternately, you can remove other themes except the default theme. That will force your site to use it.

  6. londonnet
    Member
    Posted 1 year ago #

    Thanks for the tip.

    As it happens I was already using the default twenty thirteen theme but did have many others installed
    I have deleted the others no change I still cant search for new themes

    Further information about my installation
    I am hosting this myself on a centos 6 server
    WP is installed as a multisite installation
    I can search for plugins and install them

    My browser looks like it is timing out waiting for an answer somewhere. Are there any logs I can view to find out where the search page is trying to pull information from so I can check access

  7. Tara
    Volunteer Moderator
    Posted 1 year ago #

    If your server does not allow automatic installation of themes, try installing themes manually.

    Useful codex: http://codex.wordpress.org/Using_Themes

  8. londonnet
    Member
    Posted 1 year ago #

    Many thanks for the advice however I see no reason why the search tool shouldn't work.

    Installing manualy is a workaround.

    I have full access to the server and rebuild as many thimes as it takes to obtain a fully working installation of wordpress.

    Somthing is blocking access.

    Thanks

  9. esmi
    Forum Moderator
    Posted 1 year ago #

    If blocking is happening, it's at your server's end rather than at wordpress.org. For example this is sometimes caused by a failure to compile PHP with cUrl on your server.

  10. londonnet
    Member
    Posted 1 year ago #

    This sounds more like the issue.
    is there a log I can see blocking occour?

    I install my servers via RPM. Could it be there is a package dependencie missing?

    Which cUrl and PHP packages do I need?

    Thanks

  11. esmi
    Forum Moderator
    Posted 1 year ago #

    is there a log I can see blocking occour?

    That log would be on your server - not here.

    Could it be there is a package dependencie missing?

    Quite possibly.

    Which cUrl and PHP packages do I need?

    Ok - now you've got me! I've not set up a server using Red Hat's package manager. As I'm only using my own server locally, I've wimped out and used a WAMP type bundled install. I'll ask around and see if I can get someone with the requisite experience to chime in on this.

  12. Interesting, you're the second person I've seen post that they can search plugins but not themes via WordPress admin. In the other poster's case, he just contacted his host (I think they had to whitelist a URL).

    What happens when you do this:

    curl -I http://api.wordpress.org/plugins/info/1.0/

    and

    curl -I http://api.wordpress.org/themes/info/1.0/

    That will at least tell you if you have cURL installed and if you can make the connection to the repspecitve APIs (though you've already said you can search plugins). If you can, you should see output something like this:

    HTTP/1.1 200 OK
    Server: nginx
    Date: Tue, 15 Oct 2013 14:06:36 GMT
    Content-Type: text/html; charset=utf-8
    Connection: close
    Vary: Accept-Encoding

  13. londonnet
    Member
    Posted 1 year ago #

    So it doesn't look like a connectivity issue then

    [root@web01 ~]# curl -I http://api.wordpress.org/plugins/info/1.0/
    HTTP/1.1 200 OK
    Server: nginx
    Date: Tue, 15 Oct 2013 17:49:59 GMT
    Content-Type: text/html; charset=utf-8
    Connection: close
    Vary: Accept-Encoding

    [root@web01 ~]# curl -I http://api.wordpress.org/themes/info/1.0/
    HTTP/1.1 200 OK
    Server: nginx
    Date: Tue, 15 Oct 2013 17:50:32 GMT
    Content-Type: text/html; charset=utf-8
    Connection: close
    Vary: Accept-Encoding

    Back to looking at permissions and config

  14. cURL isn't the only transport used (curl, streams, and fsockopen), but WordPress will look for curl first.

    So, one more cURL attempt. Actually query the API instead of just calling the HEAD:

    Themes - search for 'blue'

    curl --data 'action=query_themes&request=O:8:"stdClass":4:{s:4:"page";i:1;s:8:"per_page";i:36;s:6:"fields";N;s:6:"search";s:4:"blue";}' http://api.wordpress.org/themes/info/1.0/

    Plugins - search for 'cache'

    curl --data 'action=query_plugins&request=O:8:"stdClass":3:{s:4:"page";i:1;s:8:"per_page";i:30;s:6:"search";s:5:"cache";}' http://api.wordpress.org/plugins/info/1.0/

    In both cases you should get a load of serialized data back.

  15. londonnet
    Member
    Posted 1 year ago #

    Yes. get lots of data coming back on both commands

    O:8:"stdClass":2:{s:4:"info";a:3:{s:4:"page";i:1;s:5:"pages";i:2;s:7:"results";i:45;}s:6:"themes";a:36:{i:0;O:8:"stdClass":10:{s:4:"name";s:9:"Catch Box";s:4:"slug";s:9:"catch-box";s:7:"version";s:5:"2.8.1";s:6:"author";s:11:"catchthemes";s:11:"preview_url";s:30:"http://wp-themes.com/catch-box";s:14:"screenshot_url";s:63:"http://wp-themes.com/wp-content/themes/catch-box/screenshot.png";s:6:"rating";d:90.7999999999999971578290569595992565155029296875;s:11:"num_ratings";i:52;s:8:"homepage";s:37:"http://wordpress.org/themes/catch-box";s:11:"description";s:1166:"Catch Box is simple, lightweight, box shaped, and adaptable WordPress Theme for bloggers and professionals. It is based on HTML5, CSS3 and Responsive Web Design to view in various devices. 10 Best Reasons to use Catch Box Theme.

    It must be permissions of some sort

  16. At this point, if it were me, I'd have to debug from within WordPress core to see what's coming back from the request in WordPress itself. For instance, if I var_dump $request in wp-admin/includes/theme.php and turn of wifi (I'm on my laptop), I get:

    /common-controller.php on line 315
    object(WP_Error)#258 (2) { ["errors"]=> array(1) { ["http_request_failed"]=> array(1) { [0]=> string(87) "Could not resolve host: api.wordpress.org; nodename nor servname provided, or not known" } } ["error_data"]=> array(0) { } }

    That said, you shouldn't have to do this, (and you probably shouldn't), I'd say it has to be a server issue.

    There are a lot of reasons the request could fail, but to see the error message:

    An unexpected error occurred. Something may be wrong with WordPress.org or this server’s configuration. If you continue to have problems, please try the support forums.

    I think that only happens if the request failed or the data that came back was bad (or empty).

  17. londonnet
    Member
    Posted 1 year ago #

    Well I can ping api.wordpress.org which means I can resolve the host.

    Trying to back track and rebuild the box manually to see where the issue is. I have had this working.

    I'm trying to build a kickstart. rebuilding is part of the development

  18. londonnet
    Member
    Posted 1 year ago #

    Do we think my ht access file and httpd.conf look correct?

    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]

    # add a trailing slash to /wp-admin
    RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]

    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^ - [L]
    RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L]
    RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
    RewriteRule . index.php [L]

    <Directory "/var/www/html/">
    AllowOverride All
    Options All
    </Directory>

  19. londonnet
    Member
    Posted 1 year ago #

    I have performed a few tests between an install I can get to work and my current kick start install and I see when I run the following command the good server starts downloading in about a second and the bad server in about 7 seconds

    curl --data 'action=query_plugins&request=O:8:"stdClass":3:{s:4:"page";i:1;s:8:"per_page";i:30;s:6:"search";s:5:"cache";}' http://api.wordpress.org/plugins/info/1.0/

    Perhaps this is a simple time out issue

    Two questions
    What maybe coursing the delay?
    how can I ask wordpress to wait longer?

    Thanks

  20. For what could be causing the delay, I have no idea, but it does sound like there is something different about the servers.

    This is untested, and I had to dig through core and the hooks, but I think I found a way you can get around this. The default http anc curl timeout is 5 seconds, but if you use a couple WordPress filter hooks, you can lengthen that (I'm changing it to 10 seconds, but use what ever works for you). Try this in your theme's functions.php file:

    function my_http_request_args ( $r ) {
        // Set http request timeout to 10 seconds
        $r['timeout'] = 10;
        return $r;
    }
    add_filter( 'http_request_args', 'my_http_request_args', 100, 1 );
    
    function my_http_api_curl ( $handle ) {
        // Set CURLOPT_CONNECTTIMEOUT to 10 seconds
        curl_setopt( $handle, CURLOPT_CONNECTTIMEOUT, 10 );
        // Set CURLOPT_TIMEOUT to 10 seconds
        curl_setopt( $handle, CURLOPT_TIMEOUT, 10 );
    }
    add_action( 'http_api_curl', 'my_http_api_curl', 100, 1 );
  21. londonnet
    Member
    Posted 1 year ago #

    Thanks for the support. The issue is now fixed.

    I tried extending the time out and this did fix the problem but was slow.
    However it did point me in an alternative direction and I have discovered that one of the DNS servers from my ISP is just very slow.

    I have used a public DNS server and in addition configure dnsmasq.
    The wordpress installation now performs increably fast in comparison to how it was.

    Thanks again for you help

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.