# Agent plugin wont load

**URL:** <https://forums.plex.tv/t/agent-plugin-wont-load/532946>\
**Category:** Dev/API Corner\
**Tags:** scanner-agent-dev\
**Created:** [January 26, 2020, 9:20am UTC](https://forums.plex.tv/t/agent-plugin-wont-load/532946 "2020-01-26T09:20:16Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Arimil](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/arimil/32/105067_2.png) [@Arimil](https://forums.plex.tv/u/Arimil)\
**Post date:** [January 26, 2020, 9:20am UTC](https://forums.plex.tv/t/agent-plugin-wont-load/532946/1 "2020-01-26T09:20:16Z")

</div>

I wrote a simple plugin that was meant only as a template, this was intended to scan audio.

```auto
class TestAgent(Agent.Album):
    name = 'Test Agent'
    languages = [
        Locale.Language.English,
    ]
    primary_provider = True
    fallback_agent = False
    accepts_from = None
    contributes_to = None
    
    def search(self, results, media, lang, manual):
        f = open('search', 'w')
        f.write('Self:' + '\n')
        f.write(str(self) + '\n\n\n')
        f.write('Results:' + '\n')
        f.write(str(results) + '\n\n\n')
        f.write('Media:' + '\n')
        f.write(str(media) + '\n\n\n')
        f.write('Lang:' + '\n')
        f.write(str(lang) + '\n\n\n')
        f.write('Manual:' + '\n')
        f.write(str(manual) + '\n\n\n')
        f.close()

    def update(self, metadata, media, lang, force):

```

I created the relevant files in the `Plug-ins` directory.

**Info.plist:**

```auto
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
  
  <!-- Version should always be set to 2 -->		
  <key>PlexFrameworkVersion</key>
  <string>2</string>

  <key>CFBundleIdentifier</key>
  <string>com.plexapp.agents.testagent</string>

  <!-- This one does nothing with a value of Always On, but using a value of "daemon" keeps the plugin alive in the background -->	
  <key>PlexPluginMode</key>
  <string>Agent</string>

  <!-- List any client platforms supported in the plugin. -->	
  <!-- Possible values are * for all platforms, MacOSX, Windows, Linux, Roku, Android, iOS, Safari, Firefox, Chrome, LGTV, Samsung, PlexConnect and Plex Home Theater -->
  <key>PlexClientPlatforms</key>
  <string>*</string>
  
  <!-- List any client platforms not supported in the plugin. -->	
  <key>PlexClientPlatformExclusions</key>
  <string></string>
   
  <!-- possible string values are the proper ISO two letter code for the country -->
  <!-- A full list of values are available at http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2 -->              
  <key>PlexPluginRegions</key>
  <array><string></string>
  </array>
	
	<!-- DEBUG OPTIONAL KEYS -->
  <!-- possible values are 0 and 1. Setting it to "1" rather than "0" turns on debug logging -->
  <key>PlexPluginDebug</key>
  <array><string>1</string>
	</array>       
  
  <!-- THESE BELOW ARE FOR AGENTS ONLY -->    
  
  <!-- this allows channels to access some python methods which are otherwise blocked, as well as import external code libraries, and interact with the PMS HTTP API -->	
  <key>PlexPluginCodePolicy</key>
  <string>Elevated</string>
  
  <!-- This key is used to show that the plugin is an agent. possible values are agent -->	
  <key>PlexPluginClass</key>
  <string>agent</string>

  <!-- This is used to send plugin log statements directly to stout when running PMS from the command line. Rarely used anymore-->
  <key>PlexPluginConsoleLogging</key>
	<string>0</string>
       
  <key>PlexAgentAttributionText</key>
  <string>Prints out data.</string>
</dict>
</plist>

```

**DefaultPrefs.json:**

```auto
[]

```

My directory structure:

```auto
├── TestAgent.bundle
│ └── Contents
│ ├── Code
│ │ └── __init__.py
│ ├── DefaultPrefs.json
│ └── Info.plist

```

When loading this agent however it never shows up under my agents list.

Does anyone know what I’m doing wrong?

EDIT:  
After running for 5-10 minutes this error seems to show up in the log:

> Timeout or error reading status line from plug-in pipe [com.plexapp.agents.testagent], we’re killing it.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/plex/original/3X/2/a/2acb9765406f63293d357b4ec509ec39aa28f2ad.png) [@system](https://forums.plex.tv/u/system)\
**Post date:** [April 25, 2020, 9:32am UTC](https://forums.plex.tv/t/agent-plugin-wont-load/532946/2 "2020-04-25T09:32:57Z")

</div>

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
