jam-py / jam-py

Jam.py is an event-driven framework for the development of database applications with a Web interface.
http://jam-py.com
BSD 3-Clause "New" or "Revised" License
451 stars 85 forks source link

wsgi.py and Apache issues #17

Closed platipusica closed 7 years ago

platipusica commented 7 years ago

Hi Andrew

I copied ../jam/project/wsgi.py into demo folder and set the Apache as per instructions.

First, I encountered the "OperationalError: attempt to write a readonly database", hence made the sqlite db r/w for apache process and demo folder r/w as well.

However, something is not quite right. You can try to access it from here: http://jam....

Even if I login, it will log me out straight away. The debug is on, and the Apache error log is showing many of: [Fri Dec 16 01:13:04.445406 2016] [:error] [pid 1636:tid 139632608016128] 1111111 17 [Fri Dec 16 01:13:22.021127 2016] [:error] [pid 1636:tid 139632599623424] 1111111 4 [Fri Dec 16 01:13:22.022195 2016] [:error] [pid 1636:tid 139632599623424] 1111111 7 . Fri Dec 16 01:21:18.822937 2016] [:error] [pid 1745:tid 139632713185024] /home/ubuntu/jam.py-4.0.36/jam/third_party/werkzeug/filesystem.py:63: BrokenFilesystemWarning: Detected a misconfigured UNIX filesystem: Will use UTF-8 as filesystem encoding instead of 'ANSI_X3.4-1968' [Fri Dec 16 01:21:18.822979 2016] [:error] [pid 1745:tid 139632713185024] BrokenFilesystemWarning)

If you like, paste your Public key here and I will give you the access to the server.

Thanks

Dean

jam-py commented 7 years ago

Hi, Dean

May be this will help http://stackoverflow.com/questions/34515331/werkzeug-raises-brokenfilesystemwarning

platipusica commented 7 years ago

I did see that, changed locale to UTF8 etc. BUT, this is not only on above server, something is not quite right with wsgi.py on other servers as well...It is logging me out straight after login in. Which is not the case when not running Apache.

D.

jam-py commented 7 years ago

I've just tried the latest version on the apache server and it worked. Can you send me the server logs.

2016-12-16 10:16 GMT+03:00 dbabicwa notifications@github.com:

I did see that, changed locale to UTF8 etc. BUT, this is not only on above server, something is not quite right with wsgi.py on other servers as well...It it logging me out straight after login in.

D.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/jam-py/jam-py/issues/17#issuecomment-267532543, or mute the thread https://github.com/notifications/unsubscribe-auth/AJOgGRD_FzZHv2ZDu_0OzlNAcPUCQVIjks5rIjrJgaJpZM4LOwkH .

platipusica commented 7 years ago

You can try the app with admin/111 The error log is just full of below, no more than that: [Fri Dec 16 13:26:04.275915 2016] [:error] [pid 2381:tid 140510576432896] 1111111 4 [Fri Dec 16 13:26:04.276005 2016] [:error] [pid 2381:tid 140510576432896] 1111111 7 [Fri Dec 16 13:26:05.782153 2016] [:error] [pid 2381:tid 140510568040192] 1111111 4 [Fri Dec 16 13:26:05.782325 2016] [:error] [pid 2381:tid 140510568040192] 1111111 7 [Fri Dec 16 13:26:21.228187 2016] [:error] [pid 2382:tid 140510559647488] 1111111 17 [Fri Dec 16 13:26:22.891587 2016] [:error] [pid 2382:tid 140510618396416] 1111111 17 [Fri Dec 16 13:28:37.103838 2016] [:error] [pid 2382:tid 140510710716160] 1111111 17 [Fri Dec 16 13:28:38.333171 2016] [:error] [pid 2382:tid 140510727501568] 1111111 17

The app perfectly runs with no wsgi, with server.py. I can spin up a new vm and see...

jam-py commented 7 years ago

The server and wsgi work OK. I attached the screenshot. The server exchages data with the client. The on the request to get the number of records in the invoices the server returns not logged message. The problem can be with jam library. Can you update jam to the latest version or tell me what version you are using. I reworked this login checking code recently. I can tell you where to insert prints so we would know what is going on.

2016-12-16 16:32 GMT+03:00 dbabicwa notifications@github.com:

You can try the app with admin/111 The error log is just full of below, no more than that: [Fri Dec 16 13:26:04.275915 2016] [:error] [pid 2381:tid 140510576432896] 1111111 4 [Fri Dec 16 13:26:04.276005 2016] [:error] [pid 2381:tid 140510576432896] 1111111 7 [Fri Dec 16 13:26:05.782153 2016] [:error] [pid 2381:tid 140510568040192] 1111111 4 [Fri Dec 16 13:26:05.782325 2016] [:error] [pid 2381:tid 140510568040192] 1111111 7 [Fri Dec 16 13:26:21.228187 2016] [:error] [pid 2382:tid 140510559647488] 1111111 17 [Fri Dec 16 13:26:22.891587 2016] [:error] [pid 2382:tid 140510618396416] 1111111 17 [Fri Dec 16 13:28:37.103838 2016] [:error] [pid 2382:tid 140510710716160] 1111111 17 [Fri Dec 16 13:28:38.333171 2016] [:error] [pid 2382:tid 140510727501568] 1111111 17

The app perfectly runs with no wsgi, with server.py.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/jam-py/jam-py/issues/17#issuecomment-267594600, or mute the thread https://github.com/notifications/unsubscribe-auth/AJOgGWaAfhfw0qTMY-7cqncPcan_aUxkks5rIpLWgaJpZM4LOwkH .

platipusica commented 7 years ago

Ah, ok. I did download the latest zip from http://jam-py.com/download/jam.py-4.0.36.tar.gz

I got Debian 8 on 130.56.253.210 and Ubuntu 14.04 on 130.56.252.19 you can try to access both. This VM's will expire soon.

platipusica commented 7 years ago

Hi Andrew, I think you said to use nginx, do you have an example how to set it up? Or is the issue the same on nginx?

Thx

jam-py commented 7 years ago

Hi, Dean. I am sorry for the delay. I have been away on the weekend. Can you contact me by skype: yushev_andrew

platipusica commented 7 years ago

Hi Andrew, there is a huge time difference now between you and I probably :) Thanks for the offer though, it's not anything urgent. If you like, you can close the issue.

jam-py commented 7 years ago

Dean, I would like to solve the problem. May be we can to plan it somehow. I am in Moscow time zone

2016-12-19 11:32 GMT+03:00 dbabicwa notifications@github.com:

Hi Andrew, there is a huge time difference now between you and I probably :) Thanks for the offer though, it's not anything urgent. If you like, you can close the issue.

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/jam-py/jam-py/issues/17#issuecomment-267908669, or mute the thread https://github.com/notifications/unsubscribe-auth/AJOgGW7GNAdg30igv_OkfFnuAI2CiEQdks5rJkEtgaJpZM4LOwkH .

platipusica commented 7 years ago

The best would be to add you as a user to VM's so you can try at your leisure since the holidays are coming :) jam....supports only public keys auth, if you like, create a key and I will paste it to .ssh/authorized_keys? I can spin a Centos if you think this would work? let me know.

jam-py commented 7 years ago

I will create a public key on the comp at home

platipusica commented 7 years ago

I just set the app on my laptop, the 'safe mode' is bypassed if accessed with http://localhost. If accessed by http://IP on same laptop, 'safe mode' is not bypassed, and can't login to http://IP/admin.html. The app behavior is changing when switching from the IP to localhost. The permissions are 755 on demo, 775 on *.sqlite, all owned by www-data.

jam-py commented 7 years ago

The application on the client saves the user id that is generated on the server to cookies so that user doesn't need to login again if he reloads the page. This behavior may be caused by that. To check the mode on the client press F12 to go into debugging mode and in the console check task.safe_mode or task.user_info.

2016-12-19 16:55 GMT+03:00 dbabicwa notifications@github.com:

I just set the app on my laptop, the 'safe mode' is bypassed if accessed with http://localhost. If accessed by http://IP on same laptop, 'safe mode' is not bypassed, and can't login to http://IP/admin.html. The app behavior is changing when switching from the IP to localhost.

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/jam-py/jam-py/issues/17#issuecomment-267969418, or mute the thread https://github.com/notifications/unsubscribe-auth/AJOgGfvDNb6pt6Y55RqzqEKy46WQEm-qks5rJozcgaJpZM4LOwkH .

jam-py commented 7 years ago

I attached my public key

2016-12-19 21:42 GMT+03:00 Andrew Yushev yushevaa@gmail.com:

The application on the client saves the user id that is generated on the server to cookies so that user doesn't need to login again if he reloads the page. This behavior may be caused by that. To check the mode on the client press F12 to go into debugging mode and in the console check task.safe_mode or task.user_info.

2016-12-19 16:55 GMT+03:00 dbabicwa notifications@github.com:

I just set the app on my laptop, the 'safe mode' is bypassed if accessed with http://localhost. If accessed by http://IP on same laptop, 'safe mode' is not bypassed, and can't login to http://IP/admin.html. The app behavior is changing when switching from the IP to localhost.

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/jam-py/jam-py/issues/17#issuecomment-267969418, or mute the thread https://github.com/notifications/unsubscribe-auth/AJOgGfvDNb6pt6Y55RqzqEKy46WQEm-qks5rJozcgaJpZM4LOwkH .

platipusica commented 7 years ago

I don't see it anywhere...

jam-py commented 7 years ago

I attached it in the browser. May be if you open the message in the browser it will be there. If it will not be there I send it later.

2016-12-20 8:36 GMT+03:00 dbabicwa notifications@github.com:

I don't see it anywhere...

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/jam-py/jam-py/issues/17#issuecomment-268159677, or mute the thread https://github.com/notifications/unsubscribe-auth/AJOgGY0v5hIx7s8hmdp4th38iSEEK2_zks5rJ2lTgaJpZM4LOwkH .

jam-py commented 7 years ago

Here is the key file. I compressed it, github doesn't accept pub extension id_rsa.pub.zip

platipusica commented 7 years ago

Done. Use below and than sudo su: ssh debian@jam2... ssh ubuntu@jam....

Thx

jam-py commented 7 years ago

Thank you, Dean. I have checked connection, it works OK. After work I will try to find the problem.

2016-12-20 15:28 GMT+03:00 dbabicwa notifications@github.com:

Done. Use below and than sudo su: ssh debian@jam2.is.uwa.edu.au ssh ubuntu@jam.is.uwa.edu.au

Thx

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/jam-py/jam-py/issues/17#issuecomment-268231476, or mute the thread https://github.com/notifications/unsubscribe-auth/AJOgGWzm4h6IVjq0-DbMNXmWeWZTlMRsks5rJ8nrgaJpZM4LOwkH .

jam-py commented 7 years ago

Hi, Dean

I solved the problem. I made a lot of changes and did not have time to test the library properly. So I have not published the framework yet. I will do it in the new year and inform you then.

Thank you for your help!

2016-12-21 7:46 GMT+03:00 Andrew Yushev yushevaa@gmail.com:

Thank you, Dean. I have checked connection, it works OK. After work I will try to find the problem.

2016-12-20 15:28 GMT+03:00 dbabicwa notifications@github.com:

Done. Use below and than sudo su: ssh debian@jam2.is.uwa.edu.au ssh ubuntu@jam.is.uwa.edu.au

Thx

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/jam-py/jam-py/issues/17#issuecomment-268231476, or mute the thread https://github.com/notifications/unsubscribe-auth/AJOgGWzm4h6IVjq0-DbMNXmWeWZTlMRsks5rJ8nrgaJpZM4LOwkH .

platipusica commented 7 years ago

NP, glad to help:)

Enjoy and hope your efforts will be well recognised!

D.