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

Fail2Ban API Banlist Error #6089

Open
5 tasks done
daygle opened this issue Sep 25, 2024 · 8 comments
Open
5 tasks done

Fail2Ban API Banlist Error #6089

daygle opened this issue Sep 25, 2024 · 8 comments
Labels

Comments

@daygle
Copy link

daygle commented Sep 25, 2024

Contribution guidelines

I've found a bug and checked that ...

  • ... I understand that not following the below instructions will result in immediate closure and/or deletion of my issue.
  • ... I have understood that this bug report is dedicated for bugs, and not for support-related inquiries.
  • ... I have understood that answers are voluntary and community-driven, and not commercial support.
  • ... I have verified that my issue has not been already answered in the past. I also checked previous issues.

Description

api/v1/get/fail2ban/banlist/ not working.

Error - SyntaxError: JSON.parse: unexpected end of data at line 1 column 1 of the JSON data

Uploading image.png…

Logs:

No logs available for this error.

Steps to reproduce:

1. Login to mailcow with your administrator account.
2. Navigate to System > Configuration > Options > Fail2ban parameters
3. Scroll down to the bottom of the page and locate https://mail.domain.net/api/v1/get/fail2ban/banlist/5297f53f-8fe2-4890-9ca0-f93753137e41
4. Copy link and paste in to browser.
5. Error - SyntaxError: JSON.parse: unexpected end of data at line 1 column 1 of the JSON data

Which branch are you using?

master

Which architecture are you using?

x86

Operating System:

Ubuntu 22.04

Server/VM specifications:

10GB

Is Apparmor, SELinux or similar active?

Yes

Virtualization technology:

Proxmox

Docker version:

Latest

docker-compose version or docker compose version:

Latest

mailcow version:

2024-08a

Reverse proxy:

Nginx

Logs of git diff:

N/A

Logs of iptables -L -vn:

N/A

Logs of ip6tables -L -vn:

N/A

Logs of iptables -L -vn -t nat:

N/A

Logs of ip6tables -L -vn -t nat:

N/A

DNS check:

N/A
@daygle daygle added the bug label Sep 25, 2024
@daygle
Copy link
Author

daygle commented Sep 25, 2024

Screenshot 2024-09-25 145657

@apio-sys
Copy link

This is usually the case when you currently have no banned IPs, hence the json is empty and returns this error in a browser. If you curl the URL, you will just get an empty response as expected if now hosts banned. Can you confirm that in your UI it says No active bans just above the URL? That will confirm it is not a bug but just expected behaviour.

@daygle
Copy link
Author

daygle commented Sep 27, 2024

Thanks @apio-sys - See attached screenshot, although I have one banned IP is still throws the error :(

image

@apio-sys
Copy link

And if you curl the URL do you get any output?

@daygle
Copy link
Author

daygle commented Sep 27, 2024

And if you curl the URL do you get any output?

@apio-sys Sure do.

image

@apio-sys
Copy link

OK so data is there then. Maybe something to do with formatting. I don't see curly brackets around the data. Have you tried different browsers to open the URL? If you go to "raw data" don't you see the same output as in curl? Sorry out of ideas otherwise.

@daygle
Copy link
Author

daygle commented Sep 27, 2024

Thanks @apio-sys - Yeah, tried other browsers. Raw data shows the error. I suspect all users have the same issue.

@apio-sys
Copy link

I think you are right. I'll try to confirm this as soon as I catch an IP in fail2ban, currently have none. The data is there, it's just the formatting which doesn't seem proper json.

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

2 participants