9.0.1 plex port conflict issue

Assists Greatly with Development Costs

CyborgPirate

Respected Member
Original poster
Local time
1:34 PM
Aug 22, 2018
78
21
Hello, I am testing out 9.0.1 on an ubuntu 18.04 LTS vm with 4GB ram, 4 vCPU cores and 240GB SSD

I used this install file from the v90 branch:
Code:
https://raw.githubusercontent.com/PGBlitz/Install/v90/install.sh
and selected 9.0.1 on first boot.
Installed pgui, Traefik, portainer, opened ports, clone (Blitz SDrive unencypted with 2 keys), then plex, tautulli and netdata.

All went fine except plex which is giving me this error.
Code:
TASK [Deploying plex] **********************************************************
Tuesday 12 November 2019  23:36:46 +0000 (0:00:00.069)       0:00:05.359 ******
fatal: [127.0.0.1]: FAILED! => {"changed": false, "msg": "Error starting container 456a1981dd564b813f9e1b23f362f6b83823a1464cbdcdb64868a8f2016cac46: 500 Server Error: Internal Server Error (\"driver failed programming external connectivity on endpoint plex (f7e8901697e57d1f91279456b09f530686b8ecd96ad19216c28f297ade62f6b2): Bind for 0.0.0.0:33443 failed: port is already allocated\")"}
    to retry, use: --limit @/pg/apps/programs/plex/app.retry

PLAY RECAP *********************************************************************
127.0.0.1                  : ok=27   changed=10   unreachable=0    failed=1
I tried reinstalling plex, tried hard deleting the container and reinstalling again, tried to find out what was using that port but nothing seems to...

Any ideas?

TL;DR plex container won't start. Says port 33443 is in use. Netstat and docker ps show nothing using that port :(
 

justinglock40

Respected Member
Local time
7:34 AM
May 27, 2018
66
13
Is something on you network using that port?
 

CyborgPirate

Respected Member
Original poster
Local time
1:34 PM
Aug 22, 2018
78
21
Thanks for your reply.

I don't think another machine is using that port but i can't work out why that would cause an issue anyway. I'm trying to run this on a local machine, not through the internet so multiple machines using the same port would surely not be a problem? For example I have a VPN running on 443 but my pg server also has traefik running on 443 and there is no issue because I'm not trying to port forward the router to both of them.

Maybe I have misunderstood? Can you explain a bit more for me please?
 

CyborgPirate

Respected Member
Original poster
Local time
1:34 PM
Aug 22, 2018
78
21
So I just had a look in the plex app.yml file and it looks like its trying to set up the ports 33443 and 33400 twice each which might be causing the issue.

I know how to edit this file in the file system but that gets overwritten when I go to PG Box to deploy it.

Can someone show me where in the repos this file is so that I can fork it and fix it please?
It was found in /pg/apps/programs/plex/app.yml

YAML:
#!/bin/bash
#
# Title:      PGBlitz (Reference Title File)
# Author(s):  Admin9705
# URL:        https://pgblitz.com - http://github.pgblitz.com
# GNU:        General Public License v3.0
################################################################################
# !!!!!!!!!!!!! REMINDER FIX PORTS FOR LOCAL/REMOTE from old
---
- hosts: localhost
  gather_facts: false
  tasks:
    # FACTS #######################################################################
    - name: 'Set Known Facts'
      set_fact:
        pgrole: 'plex'
        int1: '32400/tcp'
        ext1: '32400'
        int2: '3005/tcp'
        ext2: '3005'
        int3: '8324/tcp'
        ext3: '8324'
        int4: '32410/udp'
        ext4: '32410'
        int5: '32412/udp'
        ext5: '32412'
        int6: '32413/udp'
        ext6: '32413'
        int7: '32414/udp'
        ext7: '32414'
        int8: '33400/tcp'
        ext8: '33400'
        int9: '33443/tcp'
        ext9: '33443'
        int10: '33400/tcp'
        ext10: '33400'
        int11: '33443/tcp'
        ext11: '33443'

    # FACTS #######################################################################
    - name: 'Plex Server Network Type'
      shell: 'cat /pg/var/server.type'
      register: servertype

    - name: Register Claim Number
      shell: 'cat /pg/var/plex.claim'
      register: claim
      when: servertype.stdout == "remote"

    - name: Register Extension Type - Remote
      shell: 'cat /pg/var/image.select'
      register: imageselect

    # CORE (MANDATORY) ############################################################
    - name: 'Mandatory Core Role'
      include_tasks: '/pg/apps/_core.yml'

    # LABELS ######################################################################
    - name: 'Adding Traefik'
      set_fact:
        pg_labels:
          traefik.enable: 'true'
          traefik.port: '{{int1}}'
          traefik.frontend.rule: 'Host:{{pgrole}}.{{domain}}{{tldset}}'
          traefik.frontend.headers.SSLHost: '{{domain}}'
          traefik.frontend.headers.SSLRedirect: 'true'
          traefik.frontend.headers.STSIncludeSubdomains: 'true'
          traefik.frontend.headers.STSPreload: 'true'
          traefik.frontend.headers.STSSeconds: '315360000'
          traefik.frontend.headers.browserXSSFilter: 'true'
          traefik.frontend.headers.contentTypeNosniff: 'true'
          traefik.frontend.headers.customResponseHeaders: 'X-Robots-Tag:noindex,nofollow,nosnippet,noarchive,notranslate,noimageindex'
          traefik.frontend.headers.forceSTSHeader: 'true'

    - name: 'Setting PG Volumes'
      set_fact:
        pg_volumes:
          - '/pg/tmp:/tmp'
          - '/mnt:/mnt'
          - '/pg/data/plex/database:/config'
          - '/pg/transcodes:/transcode'
          - '/dev/shm:/ram_transcode'
          - '{{path.stdout}}:{{path.stdout}}'
          - '/etc/localtime:/etc/localtime:ro'
          - '/pg/unity:/unity'
          - '/pg:/pg'

    ########################################## Secure Connections
    - name: 'Secure Connections'
      include_tasks: '/pg/apps/programs/plex/secure.yml'

    ########################################## Other
    - name: Check /dev/dri exists
      stat:
        path: '/dev/dri'
      register: dev_dri

    - name: Create Transcodes Directory
      file: 'path={{item}} state=directory mode=0775 owner=1000 group=1000'
      with_items:
        - /pg/transcodes

    # MAIN DEPLOYMENT #############################################################
    - name: 'Remote Plex'
      include_tasks: '/pg/apps/programs/plex/remote.yml'
      when: servertype.stdout == "remote"

    - name: 'Local Plex'
      include_tasks: '/pg/apps/programs/plex/local.yml'
      when: servertype.stdout == "local"

    ###################### Plex WebTools
    - name: Check WebTools
      stat:
        path: '/pg/data/plex/database/Library/Application Support/Plex Media Server/Plug-ins/WebTools.bundle'
      register: webtools

    - name: Create Basic Directories
      file: 'path={{item}} state=directory mode=0775 owner=1000 group=1000'
      with_items:
        - '/pg/data/plex/database/Library/Application Support/Plex Media Server/Plug-ins/WebTools.bundle'
      when:
        - webtools.stat.exists == False

    - name: Installing WebTools
      unarchive:
        src: https://github.com/ukdtom/WebTools.bundle/releases/download/3.0.0/WebTools.bundle.zip
        dest: /pg/data/plex/database/Library/Application Support/Plex Media Server/Plug-ins
        keep_newer: no
        owner: '1000'
        group: '1000'
        mode: 0775
        copy: no
      when:
        - webtools.stat.exists == False

    - name: Notify User
      pause:
        prompt: "\nWebTools Installed! [PRESS ENTER] to Continue"
      when:
        - webtools.stat.exists == False

    - debug: msg="Final Notes - Remote Plex | IP Address {{ipaddress.stdout}} | Plex Type {{servertype.stdout}} | Token {{claim.stdout}}"
      when: servertype.stdout == "remote"

    - debug: msg="Final Notes - Local Plex | IP Address {{ipaddress.stdout}} | Plex Type {{servertype.stdout}}"
      when: servertype.stdout == "local"
 

Create an account or login to comment

You must be a member in order to leave a comment

Create account

Create an account on our community. It's easy!

Log in

Already have an account? Log in here.

Similar threads


Maintenance Donations

Recommend NewsGroups

      Up To a 58% Discount!

Trending