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

New install, can't log in - just get the login page #1145

Closed
pokrface opened this issue Mar 3, 2015 · 19 comments
Closed

New install, can't log in - just get the login page #1145

pokrface opened this issue Mar 3, 2015 · 19 comments
Labels

Comments

@pokrface
Copy link

pokrface commented Mar 3, 2015

Same symptoms as issue 1040—new installation, and after installation, I'm directed to enter my credentials at the login screen. Doing so results in the login screen again. Installation indicates all prerequisites are satisfied and no errors are displayed on screen at any point, including after the login page is re-displayed.

Environment:
Ubuntu 14.04 server
Nginx 1.7.10
PHP 5.6.6 (using PHP-FPM)
Varnish 3.0.6

Have tried current versions of Firefox, Chrome, and Safari. Results are the same.

Have tried installing Wallabag via downloading latest.zip and also via composer; results are the same.

Have tried using MySQL (actually MariaDB 10.0.17) and PostgreSQL (9.3); results are the same.

Have tried using HTTP or HTTPS (completely bypassing Varnish); results are the same. Even disabled Varnish completely and tried with HTTP that way; results are the same.

No errors (or any messages at all) register in the PHP log file.

No log.txt exists anywhere beneath the wallabag cache directory.

Nginx access log just shows a post and a get:

POST /?login HTTP/1.1 302 520 "https://wallabag.bigdinosaur.org/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:36.0) Gecko/20100101 Firefox/36.0" "-"
GET / HTTP/1.1 200 2068 "https://wallabag.bigdinosaur.org/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:36.0) Gecko/20100101 Firefox/36.0" "-"

No errors are displayed in the Nginx error log (except for one complaining about a missing favicon).

The MySQL (or postgresql) database I create does get populated with starter values from the install; I see several tables (config, entries, tag, tag_entries, users, and users_config) and most of them have at least one row.

PHP-PFM does appear to be working. The login form is displayed, obviously, and when I supply invalid login credentials, I receive an error from the wallabag application in the nginx error log:

2015/03/03 17:33:24 [error] 12184#0: *1810 FastCGI sent in stderr: "PHP message: user lee authentication failure" while reading response header from upstream, client: 10.10.10.110, server: wallabag.bigdinosaur.org, request: "POST /?login HTTP/1.1", upstream: "fastcgi://unix:/var/run/php5-fpm.soc:", host: "wallabag.bigdinosaur.org", referrer: "https://wallabag.bigdinosaur.org/"

For reference, here's the nginx vhost configuration I'm using. The HTTP side is listening on 8881 because Varnish is on port 80.

server {
    server_name wallabag.bigdinosaur.org;
        listen 8881;
    root /var/www-wallabag/wallabag;
    index index.html index.php;
    autoindex off;

    location / {
        allow 10.10.10.0/24;
        allow 127.0.0.1;
        deny all;
    }

    location ~ /.*\.php {
        allow 10.10.10.0/24;
        allow 127.0.0.1;
        deny all;
        try_files $uri =404;
        include fastcgi_params;
        fastcgi_pass php5-fpm-sock;
        fastcgi_intercept_errors on;
        fastcgi_split_path_info ^(.+\.php)(/.+)$;
        fastcgi_param SERVER_PORT 80;
    }

}

# HTTPS server
server {
    listen 443 ssl spdy;
    server_name wallabag.bigdinosaur.org;
    root /var/www-wallabag/wallabag;
    index index.html index.php;
    autoindex off;

    ssl on;
    ssl_certificate redacted;
    ssl_certificate_key redacted;
    ssl_protocols TLSv1.2 TLSv1.1 TLSv1;
    ssl_ciphers EECDH+ECDSA+AESGCM:EECDH+aRSA+AESGCM:EECDH+ECDSA+SHA384:EECDH+ECDSA+SHA256:EECDH+aRSA+SHA384:EECDH+aRSA+SHA256:EECDH+aRSA+RC4:EECDH:EDH+aRSA:!aNULL:!eNULL:!LOW:!3DES:!MD5:!EXP:!PSK:!SRP:!DSS:!RC4;
    ssl_prefer_server_ciphers on;
    ssl_ecdh_curve secp384r1;

    location / {
        allow 10.10.10.0/24;
        allow 127.0.0.1;
        deny all;
    }

    location ~ /.*\.php {
        allow 10.10.10.0/24;
        allow 127.0.0.1;
        deny all;
            try_files $uri =404;
            include fastcgi_params;
            fastcgi_pass php5-fpm-sock;
            fastcgi_param HTTPS on;
        fastcgi_split_path_info ^(.+\.php)(/.+)$;
    }

}

I've also got a pass statement set in varnish's sub vcl_recv so that it stays out of the way for now. Plus, of course, when I'm using HTTPS it's not a factor.

    # Ignore all traffic sent to our Wallabag instance for now
    if (req.http.host ~"wallabag.bigdinosaur.org") {
        return (pass);
    }

Is there any additional information I can supply that would assist in troubleshooting?

@tcitworld tcitworld added the Bug label Mar 4, 2015
@tcitworld
Copy link
Member

Thanks a lot for such detailing your issue. :)

Have tried using MySQL (actually MariaDB 10.0.17) and PostgreSQL (9.3); results are the same.

Did you try SQLite so that we can exclude a database issue ?

No errors (or any messages at all) register in the PHP log file.

Maybe set your error level to E_ALL to catch them.

No log.txt exists anywhere beneath the wallabag cache directory.

You need to activate debug mode into the inc/poche/config.inc.php config file, but it will only display some basic informations.

In that same file, you will find a constant named HTTP_PORT. Please try and changing it to 8881 to see how it goes without varnish (I've seen you already tried over https, but I'm just trying all I can think of right now).

Finally, after trying to log in, do you have any cookies saved (there should be __cfduid and poche) ?

Hope we manage to fix this this time.

@pokrface
Copy link
Author

pokrface commented Mar 5, 2015

I'm having trouble making it work with SQLite at all—can't get the install to complete. In light of the next few results, though, I think it's likely not a database issue. I can try to make it work with sqllite if you think it's helpful, though.

I've enabled debug mode in config.inc.php and I'm now seeing the log file. When I go to log on, it displays the following:

2015/03/05_05:05:51 - 10.10.10.110 - storage type mysql
2015/03/05_05:05:51 - 10.10.10.110 - login successful
2015/03/05_05:05:51 - 10.10.10.110 - redirect to https://wallabag.bigdinosaur.org/index.php

I also set the app error level to E_ALL, and PHP-FPM is logging the same debug messages in Nginx's error log. Looks like this:

PHP message: DEBUG POCHE : redirect to https://wallabag.bigdinosaur.org/index.php" while reading response header from upstream, client: 10.10.10.110, server: wallabag.bigdinosaur.org, request: "POST /index.php?login HTTP/1.1", upstream: "fastcgi://unix:/var/run/php5-fpm.soc:", host: "wallabag.bigdinosaur.org", referrer: "https://wallabag.bigdinosaur.org/index.php"

Also made sure per your note to set the HTTP_PORT constant to 8881; didn't see any change (including actually using :8881 in the address bar to hit nginx directly).

I am definitely not seeing any cookies set; I tried in both Chrome and Safari to make sure it wasn't a specific browser acting weird. In Chrome, I'm set to "Allow local data to be set" and the option to block 3rd party cookies is un-checked.

I've got hhvm handy—I suppose I could try switching to that away from php-fpm to see if that might change anything.

@pokrface
Copy link
Author

pokrface commented Mar 5, 2015

Hmm, no, looks like swapping to hhvm isn't an option because there's no support for gettext built into the default ubuntu repo install. I'd have to go hunting to see if hhvm supports it.

(installation screenshot)

@pokrface
Copy link
Author

pokrface commented Mar 5, 2015

Well, holy crap, it works with hhvm. Support for tiny isn't yet available, but gettext support in hhvm can be enabled by turning on the zend compatibility layer setting. Once I did that, the installation completed and I was able to log in.

The log.txt this time looks like this:

2015/03/05_05:32:25 - 10.10.10.110 - storage type mysql
2015/03/05_05:32:25 - 10.10.10.110 - login successful
2015/03/05_05:32:25 - 10.10.10.110 - redirect to https://wallabag.bigdinosaur.org/index.php?clean=0
2015/03/05_05:32:25 - 10.10.10.110 - storage type mysql
2015/03/05_05:32:25 - 10.10.10.110 - display home view

I see a wallabag cookie in the browser, too.

So the big question is, what's PHP-FPM doing that it doesn't like wallabag?!

@tcitworld
Copy link
Member

On my computer, I have nginx that works wth PHP-FPM, so it must be a configuration issue.

@tcitworld
Copy link
Member

What I did to make it work :

  • install nginx, mysql-server mysql-client, php5-fpm, php5-mysql, php5-sqlite, sqlite, php5-gd, php5-tidy php5-curl
  • cp -r mywallabag/ /usr/share/nginx/html/wallabag
  • chown -R www-data:www-data /usr/share/nginx/html/wallabag

My vhost is very much like the default one, not much modifications.

server {
        listen 80 default_server;
        listen [::]:80 default_server ipv6only=on;

        root /usr/share/nginx/html;
        index index.php index.html index.htm;

        # Make site accessible from http://localhost/
        server_name localhost;

        location / {
                # First attempt to serve request as file, then
                # as directory, then fall back to displaying a 404.
                try_files $uri $uri/ =404;
                # Uncomment to enable naxsi on this location
                # include /etc/nginx/naxsi.rules
        }

   location ~ \.php$ {
                try_files $uri =404;
                fastcgi_split_path_info ^(.+\.php)(/.+)$;
                # NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini

                # With php5-cgi alone:
                #fastcgi_pass 127.0.0.1:9000;
                # With php5-fpm:
                fastcgi_pass unix:/var/run/php5-fpm.sock;
                fastcgi_index index.php;
                include fastcgi_params;
        }

}
# HTTPS server
#
server {
        listen 443;
        server_name localhost;

        root html;
        index index.php index.html index.htm;

        ssl on;
        ssl_certificate ssl/admin-serv.net.crt;
        ssl_certificate_key ssl/admin-serv.net.key;

        ssl_session_timeout 5m;

        ssl_protocols SSLv3 TLSv1 TLSv1.1 TLSv1.2;
        ssl_ciphers "HIGH:!aNULL:!MD5 or HIGH:!aNULL:!MD5:!3DES";
        ssl_prefer_server_ciphers on;

        location / {
                try_files $uri $uri/ =404;
        }
        location ~ \.php$ {
                try_files $uri =404;
                fastcgi_split_path_info ^(.+\.php)(/.+)$;
                # NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini

                # With php5-cgi alone:
                #fastcgi_pass 127.0.0.1:9000;
                # With php5-fpm:
                fastcgi_pass unix:/var/run/php5-fpm.sock;
                fastcgi_index index.php;
                include fastcgi_params;
        }

}

Any differences you could spot ? I'm not familiar with nginx or php-fpm.

@pokrface
Copy link
Author

pokrface commented Mar 5, 2015

It might be an issue with the split path statement, but I'm kind of baffled as to why I can literally just change my fastcgi_pass line from pointing at php-fpm's socket to hhvm's socket and it magically works.

Will poke around some over the next hour with the path and a few other params in the nginx config and see if I can make anything change.

@GitHubGeek
Copy link

Have you tried uwsgi 2.0.x instead of php-fpm? It's working well with nginx and Ubuntu 14.04 here 😄

@pokrface
Copy link
Author

I've been unable to make this work, sadly, even after experimenting with a bunch of different settings. Switching to uwsgi isn't an option since this is a production web server running several other php sites; I don't want to screw with my configuration too much.

It's got to be something in my php configuration, but I'm clueless as to what it could be; It's pretty close to stock. I'll see if I can compile a list of non-default settings in my php.ini file and my fpm pool configuration today or tomorrow and post them.

@tcitworld
Copy link
Member

Please post a phpinfo() eventually too. Hope we manage to fix this !

@pokrface
Copy link
Author

Good idea—phpinfo() output can be viewed here.

@fpytloun
Copy link

Hello,
unfortunately I have hit just the same issue running on Apache with mod_php (Debian Jessie). No output in logs and behavior same as already mentioned.
Anyone figured out how to workaround or fix the issue?
Many PHP sites is running on my server and none of them has similar issues.

@tcitworld
Copy link
Member

Can you post a phpinfo() too ? What database system are you using ? Did you fill all the database informations correctly ?

@fpytloun
Copy link

I am running MySQL, database is setup correctly. User seems to be created as well. When I enable registration, new user is created but no pop-up about successful user creation will appear.
PHP info is here: https://fpy.cz/pub/tmp/phpinfo.html

@tcitworld
Copy link
Member

Hmm. At first look I don't have a clue. Can you set your error level to E_ALL in your php.ini file to catch eventual errors while trying to register (don't forget to reset it afterwards !) ?

@fpytloun
Copy link

Unfortunately no output in apache error_log or site :-/
Just tried clean installation with no success.
Output from composer:

$ curl -s http://getcomposer.org/installer | php
#!/usr/bin/env php
All settings correct for using Composer
Downloading...

Composer successfully installed to: /srv/www/filip/wallabag.fpy.cz/composer.phar
Use it: php composer.phar
$ php composer.phar install                        
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Warning: The lock file is not up to date with the latest changes in composer.json. You may be getting outdated dependencies. Run update to update them.
  - Installing symfony/event-dispatcher (v2.3.2)
    Loading from cache

  - Installing symfony/intl (v2.3.2)
    Loading from cache

  - Installing symfony/icu (v1.0.0)
    Loading from cache

  - Installing symfony/options-resolver (v2.3.2)
    Loading from cache

  - Installing symfony/property-access (v2.3.2)
    Loading from cache

  - Installing twig/twig (v1.13.2)
    Loading from cache

  - Installing twig/extensions (v1.0.0)
    Loading from cache

  - Installing symfony/twig-bridge (v2.3.2)
    Loading from cache

  - Installing symfony/translation (v2.3.2)
    Loading from cache

  - Installing symfony/routing (v2.3.2)
    Loading from cache

  - Installing symfony/form (v2.3.2)
    Loading from cache

  - Installing symfony/filesystem (v2.3.2)
    Loading from cache

  - Installing umpirsky/twig-gettext-extractor (1.1.3)
    Loading from cache

symfony/event-dispatcher suggests installing symfony/dependency-injection ()
symfony/event-dispatcher suggests installing symfony/http-kernel ()
symfony/twig-bridge suggests installing symfony/http-kernel ()
symfony/twig-bridge suggests installing symfony/security ()
symfony/twig-bridge suggests installing symfony/templating ()
symfony/twig-bridge suggests installing symfony/yaml ()
symfony/translation suggests installing symfony/config ()
symfony/translation suggests installing symfony/yaml ()
symfony/routing suggests installing doctrine/common ()
symfony/routing suggests installing symfony/config ()
symfony/routing suggests installing symfony/yaml ()
symfony/form suggests installing symfony/http-foundation ()
symfony/form suggests installing symfony/validator ()
Generating autoload files

@tcitworld
Copy link
Member

Thanks. Quite bothering. Guess it's just a silly thing. However, I don't think we'll take time to try to reproduce the issue since the next version* (v2) handles things completely differently. Please excuse us and wait a little. ;)

* You are very welcomed to give it a go to see how things go in your particular case, even if it's in alpha state.

@fpytloun
Copy link

Thank you anyway, I will surely check v2 :-)

@nicosomb
Copy link
Member

This issue affects wallabag v1. This version won't move anymore.

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

5 participants