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

Bad Gateway after reboot with multipass #68

Open
bcdiaconu opened this issue Jan 31, 2023 · 7 comments
Open

Bad Gateway after reboot with multipass #68

bcdiaconu opened this issue Jan 31, 2023 · 7 comments

Comments

@bcdiaconu
Copy link
Contributor

bcdiaconu commented Jan 31, 2023

Created a ubuntu VM on windows with multipass. I also create a bridge by use of multipass cli arguments.

Took a clean clone and configured the hosts file. Than ran the ansible playbook with maas_url set to the bridged external ethernet adapter, maas_version set to 3.2 and maas_instalation_type set to snap.
After successful run of the playbook, maas is working initially.

But after reboot, it will error out with message The server connection failed with the error "Bad Gateway".

Does it behave the same also in testing setup? Can someone help to fix?

@bcdiaconu
Copy link
Contributor Author

The same behavior is with maas_version set to 3.3 from candidate channel.

@bcdiaconu
Copy link
Contributor Author

I saw that iptables rules are not persistent between restarts

@bcdiaconu
Copy link
Contributor Author

bcdiaconu commented Feb 24, 2023

code snippet for a solution to look into:

- name: Install iptables-persistent
  hosts: all
  become: true
  tasks:
    - name: Install iptables-persistent
      ansible.builtin.apt:
        name: iptables-persistent
        state: present
      changed_when: false

- name: Configure iptables rules
  hosts: all
  become: true
  tasks:
    - name: Set up iptables rules
      ansible.builtin.iptables:
        chain: INPUT
        protocol: tcp
        destination_port: "{{ item }}"
        jump: ACCEPT
      loop:
        - 22
        - 80
        - 443
      changed_when: false

    - name: Save iptables rules
      ansible.builtin.shell: netfilter-persistent save
      changed_when: false

@ElineMaaikedeWeerd
Copy link
Contributor

Hi @bcdiaconu thank you for raising these issues. If I understand correctly, they are separate issues. Would you be able to open another issue here on GitHub regarding the iptables bug you ran into, so that we may track progress fixing these bugs separately? Many thanks

@bcdiaconu
Copy link
Contributor Author

bcdiaconu commented Feb 24, 2023

I am not sure they are different. Since the iptables are not persistent, this might be the reasons behind bad gateway error after restart. If no rules are kept into iptables the required working ports might be closed. This is to be tested.

Keep in mind that prior to restart, the system is working as expected. So the non president iptables issue has a good probability to be related to the initially reported issue.

It would be very helpful if you could confirm or infirm that this bad gateway error is consistent also on your systems after restarting the machine.

@ElineMaaikedeWeerd
Copy link
Contributor

Hi @bcdiaconu the reason I said they are likely separate issues is that I can reproduce the non-persistent iptables issue, but not yet your first issue, which will need further looking into. Therefore it would be good to be able to track progress on these issues separately. Thank you!

@bcdiaconu
Copy link
Contributor Author

bcdiaconu commented Feb 27, 2023

@ElineMaaikedeWeerd Thanks for update. I created a separate issue for iptables: #85

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants