Invalid session in Android Webview



  • I'm creating an app by following this topic
    Re: NodeBB Android App using this project https://github.com/ReyKoxha/nodebb-webview/

    I did the test with https://community.nodebb.org/ and I had no problem, but with my forum I had this problem, and in login it gives a forbidden error.
    In the browser works normally, only in Webview causes this error in any action I do.

    0_1483815623369_device-2017-01-07-165649.png

    Need to enable something on the server to work correctly through webview?


  • Global Moderator

    @Braulio-Cesar-Holtz-Ribeiro the error does not occur with a normal browser?



  • No, Chrome (Android) works normally, no error message and login works normally.
    Testing on the same device.



  • Please share your NGINX config. I am still using the webview app (even though I got a slightly improved version) and it still works flawlessly.
    I see no reason why it is the webview app's fold as I have not included any hooks to interfere with the actual website.



  • My config

    server {
    listen 80;

    server_name 52.41.178.169;
    
    location / {
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header Host $http_host;
        proxy_set_header X-NginX-Proxy true;
    
        proxy_pass http://52.41.178.169:4567/;
        proxy_redirect off;
    
        # Socket.IO Support
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
    }
    

    }

    Is this setting or another? Strange that for the Chrome browser works well and in Webview the same app does not work properly.



  • I decided to update the forum, I am in version 1.0.3, I run the ./nodebb upgrade --upgrade v1.1.0 command but nothing happens, I am doing for versions for testing compatibility.
    The installation log

    13/1 23:31 [1786] - info: Beginning database schema update
    13/1 23:31 [1786] - info: [2015/09/30] Converting default Gravatar image to default User Avatar skipped
    13/1 23:31 [1786] - info: [2015/11/06] Gravatar removal skipped
    13/1 23:31 [1786] - info: [2015/12/15] Chats upgrade skipped!
    13/1 23:31 [1786] - info: [2015/12/23] Chats room hashes upgrade skipped!
    13/1 23:31 [1786] - info: [2015/12/23] Adding theme to active plugins sorted set skipped!
    13/1 23:31 [1786] - info: [2016/01/14] Creating user best post sorted sets skipped!
    13/1 23:31 [1786] - info: [2016/01/20] Creating users:notvalidated skipped!
    13/1 23:31 [1786] - info: [2016/01/23] Creating Global moderators group skipped!
    13/1 23:31 [1786] - info: [2016/02/25] Social: Post Sharing skipped!
    13/1 23:31 [1786] - info: [upgrade] Schema already up to date!
    OK

                            NodeBB Upgrade Complete!
    

    I tried restarting and reloading the forum, but it continues in the old version, I had created a separate instance (AWS), and I thought it might be some mistake confusing the old connection, but I did the same command in the official installation but it does not update .


  • Global Moderator

    @Braulio-Ribeiro that's not how upgrades are done. Try

    git fetch
    git checkout v1.1.0
    ./nodebb upgrade
    


  • Not working

    1. Bringing [..] date... OK
    2. Checking [..] updates... OK
    3. Updating NodeBB data store schema...
    14/1 02:02 [2402] - info: Beginning database schema update
    14/1 02:02 [2402] - info: [2015/12/15] Chats upgrade skipped!
    14/1 02:02 [2402] - info: [2015/12/23] Chats room hashes upgrade skipped!
    14/1 02:02 [2402] - info: [2015/12/23] Adding theme to active plugins sorted set                    skipped!
    14/1 02:02 [2402] - info: [2016/01/14] Creating user best post sorted sets skipp                   ed!
    14/1 02:02 [2402] - info: [2016/01/20] Creating users:notvalidated skipped!
    14/1 02:02 [2402] - info: [2016/01/23] Creating Global moderators group skipped!
    14/1 02:02 [2402] - info: [2016/02/25] Social: Post Sharing skipped!
    14/1 02:02 [2402] - info: [2016/04/14] Group title from settings to user profile
    [...]
    14/1 02:02 [2402] - info: upgraded 1010 users
    14/1 02:02 [2402] - info: upgraded 1111 users
    14/1 02:02 [2402] - info: [2016/04/14] Group title from settings to user profile                    done
    14/1 02:02 [2402] - info: [2016/04/19] Users post count per tid
    14/1 02:02 [2402] - info: upgraded 0 topics
    14/1 02:02 [2402] - info: upgraded 101 topics
    14/1 02:02 [2402] - info: upgraded 202 topics
    14/1 02:02 [2402] - info: upgraded 303 topics
    14/1 02:02 [2402] - info: upgraded 404 topics
    14/1 02:02 [2402] - info: upgraded 505 topics
    14/1 02:02 [2402] - info: [2016/04/19] Users post count per tid done
    14/1 02:02 [2402] - info: [2016/04/29] Dismiss flags from deleted topics
    14/1 02:02 [2402] - info: [2016/04/29] 0 dismissable flags found
    14/1 02:02 [2402] - info: [2016/04/29] Dismiss flags from deleted topics done
    14/1 02:02 [2402] - info: [2016/05/28] Giving topics:read privs to any group tha                   t was previously allowed to Find & Access Category
    14/1 02:02 [2402] - info: cid:22:privileges:groups:topics:read granted to gid: r                   egistered-users
    14/1 02:02 [2402] - info: -- cid 22 upgraded
    14/1 02:02 [2402] - info: cid:7:privileges:groups:topics:read granted to gid: re                   gistered-users
    14/1 02:02 [2402] - info: cid:7:privileges:groups:topics:read granted to gid: gu                   ests
    [..]
    14/1 02:02 [2402] - info: -- cid 30 upgraded
    14/1 02:02 [2402] - info: cid:32:privileges:groups:topics:read granted to gid: r                   egistered-users
    14/1 02:02 [2402] - info: -- cid 32 upgraded
    [...]
    14/1 02:02 [2402] - info: cid:34:privileges:groups:topics:read granted to gid: r                   egistered-users
    14/1 02:02 [2402] - info: cid:34:privileges:groups:topics:read granted to gid: g                   uests
    14/1 02:02 [2402] - info: -- cid 34 upgraded
    14/1 02:02 [2402] - info: cid:35:privileges:groups:topics:read granted to gid: r                   egistered-users
    14/1 02:02 [2402] - info: cid:35:privileges:groups:topics:read granted to gid: g                   uests
    14/1 02:02 [2402] - info: -- cid 35 upgraded
    14/1 02:02 [2402] - info: [2016/05/28] Giving topics:read privs to any group tha                   t was previously allowed to Find & Access Category - done
    14/1 02:02 [2402] - info: [2016/06/13] Store upvotes/downvotes separately
    14/1 02:02 [2402] - info: upgraded 0 posts
    14/1 02:02 [2402] - info: upgraded 101 posts
    [...]
    14/1 02:02 [2402] - info: upgraded 2020 posts
    14/1 02:02 [2402] - info: [2016/06/13] Store upvotes/downvotes separately done
    14/1 02:02 [2402] - info: [upgrade] Schema update complete!
    OK
    
                                NodeBB Upgrade Complete!
    

    You are running NodeBB v1.0.3.
    A new version (v1.4.2) has been released. Consider upgrading your NodeBB.

    I also restarted to see if anything changed, but nothing
    The log is not complete because Akismet blocks


  • Global Moderator

    @Braulio-Cesar-Holtz-Ribeiro try running npm ls nodebb | grep nodebb@ and tell me what that outputs



  • nodebb@1.1.0 /opt/bitnami/nginx/html/NodeBB
    npm ERR! code 1
    

    I tried to npm clean cache but displays the same error


    I ran the command "npm install -g npm@latest" and now displayed "nodebb@1.1.0 /opt/bitnami/nginx/html/NodeBB"

    Running the NodeBB update again

    1. Bringing base dependencies up to date... OK
    2. Checking installed plugins for updates... OK
    3. Updating NodeBB data store schema...
    14/1 14:07 [3781] - info: Beginning database schema update
    14/1 14:07 [3781] - info: [2015/12/15] Chats upgrade skipped!
    14/1 14:07 [3781] - info: [2015/12/23] Chats room hashes upgrade skipped!
    14/1 14:07 [3781] - info: [2015/12/23] Adding theme to active plugins sorted set skipped!
    14/1 14:07 [3781] - info: [2016/01/14] Creating user best post sorted sets skipped!
    14/1 14:07 [3781] - info: [2016/01/20] Creating users:notvalidated skipped!
    14/1 14:07 [3781] - info: [2016/01/23] Creating Global moderators group skipped!
    14/1 14:07 [3781] - info: [2016/02/25] Social: Post Sharing skipped!
    14/1 14:07 [3781] - info: [2016/04/14] Group title from settings to user profile skipped!
    14/1 14:07 [3781] - info: [2016/04/19] Users post count per tid skipped!
    14/1 14:07 [3781] - info: [2016/04/29] Dismiss flags from deleted topics skipped!
    14/1 14:07 [3781] - info: [2016/05/28] Giving topics:read privs to any group that was previously allowed to Find & Access Category - skipped!
    14/1 14:07 [3781] - info: [2016/06/13] Store upvotes/downvotes separately skipped!
    14/1 14:07 [3781] - info: [upgrade] Schema already up to date!
    OK
    
                                NodeBB Upgrade Complete!
    

  • Global Moderator

    @Braulio-Cesar-Holtz-Ribeiro you have NodeBB v1.1.0 installed, so obviously it is something else that's the problem.



  • I was doing this on the test server, Nginx was with the original IP, I switched to the IP of the test server and now it has "502 Bad Gateway" error, as the problem is another one (not NodeBB), I will search for solution through the Internet.



  • I managed to do the update, after correcting the nginx .conf for the test IP, I did not start the application, causing the Bad Gateway error.
    The forum works with Webview from version 1.1

    Thank you for your help


 

| |