title: Failure to authenticate using Fitbit API, worked yesterday, no idea how to interpret error log
body: <p>I am a complete beginner to programming (I am using Python through Jupyter Notebooks) and I especially have no idea what any of these errors mean or how to debug them. I obtained a Client ID and Client Secret from Fitbit API and was able to successfully log in and pull some data when I ran my code yesterday and it no longer runs apparently due to authentication issues. As far as I can tell, the only thing I have done that may have tripped something up is to try to set up an API for a friend and tried using his Client ID/Secret in my code, but then I re-ran my code using my own Client ID/Secret and it then no longer worked. I have absolutely no idea what any of the errors or ports mean. Another post on Stackexchange mentioned looking into localhost:8080 but it brings up a 404 error. Lastly, when I ran the code yesterday, a screen would pop-up in the Fitbit site asking for me to login and it no longer does that but rather says that it can't connect. All of my code is based off the following tutorial: <a href="https://towardsdatascience.com/collect-your-own-fitbit-data-with-python-ff145fa10873" rel="nofollow noreferrer">https://towardsdatascience.com/collect-your-own-fitbit-data-with-python-ff145fa10873</a></p>
  
  <pre><code>import os
  # use the following to re-direct working directory to where cloned Fitbit GitHub repo is located
  %cd C:\Users\David\Documents\python-fitbit-master
  cwd = os.getcwd()
  
  import gather_keys_oauth2 as Oauth2
  import fitbit
  import pandas as pd 
  import datetime
  CLIENT_ID = 'XXXXXX'
  CLIENT_SECRET = 'X#X#X#X#...'
  
  server = Oauth2.OAuth2Server(CLIENT_ID, CLIENT_SECRET)
  server.browser_authorize()
  ACCESS_TOKEN = str(server.fitbit.client.session.token['access_token'])
  REFRESH_TOKEN = str(server.fitbit.client.session.token['refresh_token'])
  auth2_client = fitbit.Fitbit(CLIENT_ID, CLIENT_SECRET, oauth2=True, access_token=ACCESS_TOKEN, 
  refresh_token=REFRESH_TOKEN)
  
  [16/Mar/2020:01:15:09] ENGINE Listening for SIGTERM.
  [16/Mar/2020:01:15:09] ENGINE Bus STARTING
  [16/Mar/2020:01:15:09] ENGINE Set handler for console events.
  CherryPy Checker:
  The Application mounted at '' has an empty config.
  
  [16/Mar/2020:01:15:09] ENGINE Started monitor thread 'Autoreloader'.
  [16/Mar/2020:01:15:10] ENGINE Error in 'start' listener &lt;bound method Server.start of &lt;cherrypy._cpserver.Server object at 0x000001B599668748&gt;&gt;
  Traceback (most recent call last):
    File "C:\Users\David\Anaconda3\envs\Renv\lib\site-packages\portend.py", line 115, in free
      Checker(timeout=0.1).assert_free(host, port)
    File "C:\Users\David\Anaconda3\envs\Renv\lib\site-packages\portend.py", line 69, in assert_free
      list(itertools.starmap(self._connect, info))
    File "C:\Users\David\Anaconda3\envs\Renv\lib\site-packages\portend.py", line 85, in _connect
      raise PortNotFree(tmpl.format(**locals()))
  portend.PortNotFree: Port 127.0.0.1 is in use on 8080.
  
  During handling of the above exception, another exception occurred:
  
  Traceback (most recent call last):
    File "C:\Users\David\Anaconda3\envs\Renv\lib\site-packages\cherrypy\process\wspbus.py", line 230, in publish
      output.append(listener(*args, **kwargs))
    File "C:\Users\David\Anaconda3\envs\Renv\lib\site-packages\cherrypy\_cpserver.py", line 180, in start
      super(Server, self).start()
    File "C:\Users\David\Anaconda3\envs\Renv\lib\site-packages\cherrypy\process\servers.py", line 177, in start
      portend.free(*self.bind_addr, timeout=Timeouts.free)
    File "C:\Users\David\Anaconda3\envs\Renv\lib\site-packages\portend.py", line 119, in free
      raise Timeout("Port {port} not free on {host}.".format(**locals()))
  portend.Timeout: Port 8080 not free on 127.0.0.1.
  
  [16/Mar/2020:01:15:10] ENGINE Shutting down due to error in start listener:
  Traceback (most recent call last):
    File "C:\Users\David\Anaconda3\envs\Renv\lib\site-packages\cherrypy\process\wspbus.py", line 268, in start
      self.publish('start')
    File "C:\Users\David\Anaconda3\envs\Renv\lib\site-packages\cherrypy\process\wspbus.py", line 248, in publish
      raise exc
  cherrypy.process.wspbus.ChannelFailures: Timeout('Port 8080 not free on 127.0.0.1.')
  
  [16/Mar/2020:01:15:10] ENGINE Bus STOPPING
  [16/Mar/2020:01:15:10] ENGINE HTTP Server cherrypy._cpwsgi_server.CPWSGIServer(('127.0.0.1', 8080)) already shut down
  [16/Mar/2020:01:15:10] ENGINE Removed handler for console events.
  [16/Mar/2020:01:15:10] ENGINE Stopped thread 'Autoreloader'.
  [16/Mar/2020:01:15:10] ENGINE Bus STOPPED
  [16/Mar/2020:01:15:10] ENGINE Bus EXITING
  </code></pre>