[RE]Re: Authentication log Questions

2021-06-16 Thread Mads Kiilerich

On 6/11/21 12:07 PM, 김태호 wrote:


Hello Kallithea


Thank you for your answer !


We have solved Question1 and Question3 but the second one.



To help others with similar problems (and perhaps help us improve the 
software to avoid it), can you explain what the problem was and how you 
solved it?




So, let me elaborate on the second question.


The following attempts have been made to download kallithea-git 
repository which is about 150MB size:


1. Changed the http_server option from gearbox to waitress.

This makes it possible to download more files than the gearbox, but 
the 150MB file still fails.



*>> Command that I tired.*

ubuntu@DESKTOP-VD6IGV2:~$ git clone 
https://taeho...@scm.dev.my-company.net/my-company-smart/v2/hub-android


Cloning into 'hub-android'...

Password for 'https://taeho...@scm.dev.my-company.net:

error: RPC failed; HTTP 504 curl 22 The requested URL returned error: 504

fatal: the remote end hung up unexpectedly



I will repeat the question from 
https://lists.sfconservancy.org/pipermail/kallithea-general/2021q2/003321.html 
:



Do you get the same failure if bypassing the load balancer and 
connecting directly to the gearbox?



I also asked:


What do you get in the Kallithea logs for such requests - especially 
after setting the log levels to DEBUG?




I verified that I can serve a clone of https://github.com/git/git/ with 
gearbox, and cloning that repo locally works:


2021-06-16 15:43:38.416 INFO [kallithea.config.middleware.wrapper] 
Request from 127.0.0.1 for /baregit/git-upload-pack responded '200 OK' 
after 11.572s with 163736351 bytes




4. Changed repository setting

I changed *enable downloads *option. (checked the box) So I could 
download the zip file.


I don't think I can keep using this because all my coworkers 
using Sourcetree app. But


But I think it's going to be a clue to solve this problem.



"Downloads" is for downloading a snapshot without version control. That 
is probably not a solution to your use case.



/Mads
___
kallithea-general mailing list
kallithea-general@sfconservancy.org
https://lists.sfconservancy.org/mailman/listinfo/kallithea-general


[RE]Re: Authentication log Questions

2021-06-11 Thread 김태호
Hello KallitheaThank you for your answer !We have solved Question1 and 
Question3 but the second one.So, let me elaborate on the second question.The 
following attempts have been made to download kallithea-git repository which is 
about 150MB size:1.Changed the http_server option from gearbox to waitress.This 
makes it possible to download more files than the gearbox, but the 150MB file 
still fails.>> Command that I tired.ubuntu@DESKTOP-VD6IGV2:~$ git clone 
https://taeho...@scm.dev.my-company.net/my-company-smart/v2/hub-androidCloning 
into 'hub-android'...Password for 
'https://taeho...@scm.dev.my-company.net:error: RPC failed; HTTP 504 curl 22 
The requested URL returned error: 504fatal: the remote end hung up 
unexpectedly2. git config -> http.postbuffer=524288000It did not work at 
all...I wonder if it only works for git push command.3. NginxI thought Nginx 
possibly could solve this problem so I applied this to my server 
:https://kallithea.readthedocs.io/en/default/setup.html#nginx-virtual-host-examplethen
 it leaves log (kallithea.access.log) as following:13.209.204.126 - - 
[11/Jun/2021:07:59:04 +] "GET 
/my-company-Smart/v2/hub-android/info/refs?service=git-upload-pack HTTP/1.1" 
401 448 "-" "git/2.25.1"13.209.204.126 - admin [11/Jun/2021:07:59:04 +] 
"GET /my-company-Smart/v2/hub-android/info/refs?service=git-upload-pack 
HTTP/1.1" 401 448 "-" "git/2.25.1"13.209.204.126 - admin [11/Jun/2021:07:59:06 
+] "GET /my-company-Smart/v2/hub-android/info/refs?service=git-upload-pack 
HTTP/1.1" 200 7807 "-" "git/2.25.1"4. Changed repository settingI changedenable 
downloads option. (checked the box) So I could download the zip file.I don't 
think I can keep using this because all my coworkers usingSourcetree app. 
ButBut I think it's going to be a clue to solve this problem.Please let me know 
if you need me to try something else or more information.Thank you again !- 
Original Message -From : Mads Kiilerich To : "김태호" 
, Cc : "박정환" 
Sent : 2021-06-10 21:26:19Subject : Re: 
Authentication log Questions
  

  
  
Hi


On 6/10/21 9:25 AM, 김태호 wrote:


  
  
  >>
  Question 1


We are constantly getting this kind of log as following (at
  WARNING level) :
...
2021-06-10 07:04:42.989 ERROR
  [kallithea.lib.auth_modules.auth_internal] user admin had a
  bad password
2021-06-10 07:04:42.989 WARNI [kallithea.lib.auth_modules]
  User `admin` failed to authenticate against
  kallithea.lib.auth_modules.auth_internal
2021-06-10 07:04:48.507 WARNI [kallithea.lib.auth] user is
  anonymous and NOT authenticated with regular auth @
  HomeController:index
2021-06-10 07:04:48.853 WARNI [kallithea.lib.auth] user is
  anonymous and NOT authenticated with regular auth @
  HomeController:index
2021-06-10 07:05:18.535 WARNI [kallithea.lib.auth] user is
  anonymous and NOT authenticated with regular auth @
  HomeController:index
2021-06-10 07:05:18.848 WARNI [kallithea.lib.auth] user is
  anonymous and NOT authenticated with regular auth @
  HomeController:index
2021-06-10 07:05:48.560 WARNI [kallithea.lib.auth] user is
  anonymous and NOT authenticated with regular auth @
  HomeController:index
2021-06-10 07:05:48.859 WARNI [kallithea.lib.auth] user is
  anonymous and NOT authenticated with regular auth @
  HomeController:index
2021-06-10 07:06:18.592 WARNI [kallithea.lib.auth] user is
  anonymous and NOT authenticated with regular auth @
  HomeController:index
2021-06-10 07:06:18.865 WARNI [kallithea.lib.auth] user is
  anonymous and NOT authenticated with regular auth @
  HomeController:index
2021-06-10 07:06:39.255 WARNI [kallithea.lib.auth_modules]
  User `member1` failed to authenticate against
  kallithea.lib.auth_modules.auth_crowd
2021-06-10 07:06:45.635 WARNI [kallithea.lib.auth_modules]
  User `member1`
  failed to authenticate against
  kallithea.lib.auth_modules.auth_crowd
2021-06-10 07:06:48.719 WARNI [kallithea.lib.auth] user is
  anonymous and NOT authenticated with regular auth @
  HomeController:index
2021-06-10 07:06:48.884 WARNI [kallithea.lib.auth] user is
  anonymous and NOT authenticated with regular auth @
  HomeController:index
[2021-06-10 07:07:10 +] [5664] [INFO] Handling signal:
  winch
2021-06-10 07:07:18.640 WARNI [kallithea.lib.auth] user is
  anonymous and NOT authenticated with regular auth @
  HomeController:index
2021-06-10 07:07:18.911 WARNI [kallithea.lib.auth] user is

Re: Authentication log Questions

2021-06-10 Thread Mads Kiilerich

Hi

On 6/10/21 9:25 AM, 김태호 wrote:

*>> Question 1*


We are constantly getting this kind of log as following (at WARNING 
level) :


...

2021-06-10 07:04:42.989 ERROR 
[kallithea.lib.auth_modules.auth_internal] user admin had a bad password


2021-06-10 07:04:42.989 WARNI [kallithea.lib.auth_modules] User 
`admin` failed to authenticate against 
kallithea.lib.auth_modules.auth_internal


2021-06-10 07:04:48.507 WARNI [kallithea.lib.auth] user is anonymous 
and NOT authenticated with regular auth @ HomeController:index


2021-06-10 07:04:48.853 WARNI [kallithea.lib.auth] user is anonymous 
and NOT authenticated with regular auth @ HomeController:index


2021-06-10 07:05:18.535 WARNI [kallithea.lib.auth] user is anonymous 
and NOT authenticated with regular auth @ HomeController:index


2021-06-10 07:05:18.848 WARNI [kallithea.lib.auth] user is anonymous 
and NOT authenticated with regular auth @ HomeController:index


2021-06-10 07:05:48.560 WARNI [kallithea.lib.auth] user is anonymous 
and NOT authenticated with regular auth @ HomeController:index


2021-06-10 07:05:48.859 WARNI [kallithea.lib.auth] user is anonymous 
and NOT authenticated with regular auth @ HomeController:index


2021-06-10 07:06:18.592 WARNI [kallithea.lib.auth] user is anonymous 
and NOT authenticated with regular auth @ HomeController:index


2021-06-10 07:06:18.865 WARNI [kallithea.lib.auth] user is anonymous 
and NOT authenticated with regular auth @ HomeController:index


2021-06-10 07:06:39.255 WARNI [kallithea.lib.auth_modules] User 
`member1` failed to authenticate against 
kallithea.lib.auth_modules.auth_crowd


2021-06-10 07:06:45.635 WARNI [kallithea.lib.auth_modules] User 
`member1` failed to authenticate against 
kallithea.lib.auth_modules.auth_crowd


2021-06-10 07:06:48.719 WARNI [kallithea.lib.auth] user is anonymous 
and NOT authenticated with regular auth @ HomeController:index


2021-06-10 07:06:48.884 WARNI [kallithea.lib.auth] user is anonymous 
and NOT authenticated with regular auth @ HomeController:index


[2021-06-10 07:07:10 +] [5664] [INFO] Handling signal: winch

2021-06-10 07:07:18.640 WARNI [kallithea.lib.auth] user is anonymous 
and NOT authenticated with regular auth @ HomeController:index


2021-06-10 07:07:18.911 WARNI [kallithea.lib.auth] user is anonymous 
and NOT authenticated with regular auth @ HomeController:index


2021-06-10 07:07:22.535 WARNI [kallithea.lib.auth_modules] User 
`member1` failed to authenticate against 
kallithea.lib.auth_modules.auth_crowd


2021-06-10 07:07:28.507 WARNI [kallithea.lib.auth_modules] User 
`member1` failed to authenticate against 
kallithea.lib.auth_modules.auth_crowd


...


I wonder why the log prints that the authentication failed even if 
login is successful.




It is very possible that some of the logging statements in the code are 
too verbose. The code path might seem warning-ish when looking at the 
particular function, but perhaps less relevant when used in production. 
We can fix that.



For example, I noticed that one of the messages seems too verbose and 
not helpful, so I will propose something like 
https://kallithea-scm.org/repos/kallithea-incoming/changeset/2b37222f8d71 
for next release.



Even if not a Python programmer, it should be possible for you to find 
the log statements in the code and get an idea under what circumstances 
it is emitted. That can provide a good argument why the logging should 
be different.



For the log entries you show, the timestamps are so different that it 
must be for different requests. INFO logging for [logger_kallithea] will 
give more context ... but also make the logging much more verbose and 
impossible to read if there are multiple simultaneous requests.



Can you be more precise about which "wrong" log statements come from 
*one* successful login?




*>> Question 2*

*
*

We changed http_server to waitress to download a large size file from 
my kallithea-git.


Also I put larger value for channel_timeout 
and max_request_body_size(channel_timeout = 180, max_request_body_size 
= 322122547200) in my .ini file.


But I still haven't received the same size file as the next attached 
picture.



*But I can still download small size files from Kallithea. *

image.16233092690410.png



(Is this related to the other question asked some days ago? If so: It is 
much better to follow up in that thread so we have all the relevant 
information in one place, without mixing things up. And make sure to 
answer all questions if you want help.)



Exactly what problem do you see? Can you reproduce it in a test setup? 
Can you describe how you think we can reproduce the problem?




*>> Question 3*

As a guest, whenever I push to git repositoy, the following error 
message occurs.



*ERROR MESSAGE 1:*

POST git-receive-pack (642 bytes)
remote: Traceback (most recent call last):
remote:   File "hooks/pre-receive", line 16, in 
remote: from kallithea.lib.hooks import handle_git_pre_receive as _handler 



Authentication log Questions

2021-06-10 Thread 김태호
Hello Kallithea>> Question 1We are constantly getting this kind of log as 
following (at WARNING level) :...2021-06-10 07:04:42.989 ERROR 
[kallithea.lib.auth_modules.auth_internal] user admin had a bad 
password2021-06-10 07:04:42.989 WARNI [kallithea.lib.auth_modules] User `admin` 
failed to authenticate against 
kallithea.lib.auth_modules.auth_internal2021-06-10 07:04:48.507 WARNI 
[kallithea.lib.auth] user is anonymous and NOT authenticated with regular auth 
@ HomeController:index2021-06-10 07:04:48.853 WARNI [kallithea.lib.auth] user 
is anonymous and NOT authenticated with regular auth @ 
HomeController:index2021-06-10 07:05:18.535 WARNI [kallithea.lib.auth] user is 
anonymous and NOT authenticated with regular auth @ 
HomeController:index2021-06-10 07:05:18.848 WARNI [kallithea.lib.auth] user is 
anonymous and NOT authenticated with regular auth @ 
HomeController:index2021-06-10 07:05:48.560 WARNI [kallithea.lib.auth] user is 
anonymous and NOT authenticated with regular auth @ 
HomeController:index2021-06-10 07:05:48.859 WARNI [kallithea.lib.auth] user is 
anonymous and NOT authenticated with regular auth @ 
HomeController:index2021-06-10 07:06:18.592 WARNI [kallithea.lib.auth] user is 
anonymous and NOT authenticated with regular auth @ 
HomeController:index2021-06-10 07:06:18.865 WARNI [kallithea.lib.auth] user is 
anonymous and NOT authenticated with regular auth @ 
HomeController:index2021-06-10 07:06:39.255 WARNI [kallithea.lib.auth_modules] 
User `member1` failed to authenticate against 
kallithea.lib.auth_modules.auth_crowd2021-06-10 07:06:45.635 WARNI 
[kallithea.lib.auth_modules] User `member1` failed to authenticate against 
kallithea.lib.auth_modules.auth_crowd2021-06-10 07:06:48.719 WARNI 
[kallithea.lib.auth] user is anonymous and NOT authenticated with regular auth 
@ HomeController:index2021-06-10 07:06:48.884 WARNI [kallithea.lib.auth] user 
is anonymous and NOT authenticated with regular auth @ 
HomeController:index[2021-06-10 07:07:10 +] [5664] [INFO] Handling signal: 
winch2021-06-10 07:07:18.640 WARNI [kallithea.lib.auth] user is anonymous and 
NOT authenticated with regular auth @ HomeController:index2021-06-10 
07:07:18.911 WARNI [kallithea.lib.auth] user is anonymous and NOT authenticated 
with regular auth @ HomeController:index2021-06-10 07:07:22.535 WARNI 
[kallithea.lib.auth_modules] User `member1` failed to authenticate against 
kallithea.lib.auth_modules.auth_crowd2021-06-10 07:07:28.507 WARNI 
[kallithea.lib.auth_modules] User `member1` failed to authenticate against 
kallithea.lib.auth_modules.auth_crowd...I wonder why the log prints that the 
authentication failedeven if login is successful.>> Question 2We changed 
http_server to waitress to download a large size file from my 
kallithea-git.Also I put larger value for channel_timeout 
andmax_request_body_size(channel_timeout = 180, max_request_body_size = 
322122547200) in my .ini file.But I still haven't received the same size file 
as the next attached picture.But I can still download small size files from 
Kallithea.>> Question 3As a guest, whenever I push to git repositoy, the 
following error message occurs.ERROR MESSAGE 
1:POSTgit-receive-pack(642bytes)remote:Traceback(mostrecentcalllast):remote:File"hooks/pre-receive",line16,inremote:fromkallithea.lib.hooksimporthandle_git_pre_receiveas_handlerremote:ModuleNotFoundError:Nomodulenamed'kallithea'
   ERROR MESSAGE 
2:Enumeratingobjects:46,done.Deltacompressionusingupto8threadsTotal32(delta17),reused0(delta0),pack-reused0POSTgit-receive-pack(34113bytes)Remote:Traceback(mostrecentcalllast):Remote:File"hooks/pre-receive",line16,inRemote:fromkallithea.lib.hooksimporthandle_git_pre_receiveas_handlerRemote:ModuleNotFoundError:Nomodulenamed'kallithea'
   Why cannot it find the 'kallithea' module?___
kallithea-general mailing list
kallithea-general@sfconservancy.org
https://lists.sfconservancy.org/mailman/listinfo/kallithea-general