Jump to content

Recommended Posts

Stan Guiseppe
Posted
3 hours ago, Anthony Musgrove said:

No problems @Stan Guiseppe :)

Please note - I've revised the code, updated the internal libraries for Newtonsoft.Json, and added the following:  web:postjson

 

image.thumb.png.267c41f660be5f96ce0956cc0e997e8e.png

 

For information on how it works, please see the following wiki page:  https://wiki.emby-scripterx.au/en/processors/web

If any issues please let me know :)

Thanks Anthony - webhooks are working great for what I want to use it for - using postjson to notify HA of live TV recording finished.

Comskipper (from message above) looks interesting 🤔

Cheers for all the work, hope you are getting some sleep!

 

 

  • Thanks 1
Anthony Musgrove
Posted

Awesome to hear @Stan Guiseppe :)

Please note all - v6.0.0.6 is now on catalog; I've rewritten the WEB:POST to reflect what it was initially intended for, and wiki page is updated.  so WEB:POSTJSON is for posting Json payload, WEB:POST is for posting a POST formatted query string (tokenizable) :)

 

image.thumb.png.bfff9bbb0464224dbc4d43370c90da0b.png

 

 

web:post

When you need your action to send a standard POST data packet (like submitting a HTML form for example), use web:post.
 

Run: URL to your endpoint, for example https://myserver.com/myendpoint.php
or https://myserver.com/myendpoint.php?username=%username%
This field supports tokens
using: web:post
Parameters: Formatted POST data string, tokenizable, please see example below. This field supports tokens
where: (optional) configure logic for matching this rule to required event conditions & filters

Formatted POST data string example:
 

username=%username%&device_name=%device.name%&password=%password%&ipaddr=%device.remote.ipaddress%
Copy

Example myendpoint.php:
 

<?php

        //test web:post endpoint

        $new_log_entry = "\r\n ============================ \r\n";
        $new_log_entry .= "Date/Time: ".date("Y-m-d h:i:sa")."\r\n";

        $new_log_entry .= "Posted Data: ".print_r($_POST,true)."\r\n";

        file_put_contents('/path/to/endpoint.log', $new_log_entry, FILE_APPEND | LOCK_EX);
Copy

Example endpoint.log result:

============================
Date/Time: 2025-03-31 10:14:55am
Posted Data: Array
(
    [username] => asdfasdf
    [device_name] => Microsoft Edge Windows
    [password] => sadfasdf
    [ipaddr] => ::1
)
Copy
Anthony Musgrove
Posted (edited)

A bit more documentation up for smtp and smtp:secure:

https://wiki.emby-scripterx.au/en/processors/email

 

Email Processors
 

 

smtp

If you need your action to send an email via SMTP (simple mail transfer protocol), you can use either smtp or smtp:secure.  SMTP is for simple mail out, without needing authentication by the mail server.  Typically, your mail server will probably require authentication, in which case you should use smtp:secure below.
 

Run: Formatted parameter string providing all configuration required to send your email This field supports tokens
using: smtp
Parameters: Your email body This field supports tokens
where: (optional) configure logic for matching this rule to required event conditions & filters


Formatted parameter string (in RUN box):

from=from_email@address.com;
to=to_email@address.com;
subject=Email subject;
server=mail.myserver.com:25

example:

from=me@myemailaddress.com;to=someone@theiremailaddress.com;subject=Authentication Attempt Failure on your Emby Server;server=mail.myserver.com:25

Parameters (email body) example:

An authentication attempt was performed on your Emby Media Server (%server.name%) using username %username% and password %password% - from remote IP %device.remote.ipaddress%

 

smtp:secure

If you need your action to send an email via secure SMTP (secure simple mail transfer protocol), you should use smtp:secure.  
 

Run: Formatted parameter string providing all configuration required to send your email This field supports tokens
using: smtp
Parameters: Your email body This field supports tokens
where: (optional) configure logic for matching this rule to required event conditions & filters


Formatted parameter string (in RUN box):

from=from_email@address.com;
to=to_email@address.com;
subject=Email subject;
auth=emailaccount@username.com:emailpassword
ignorecertificate=true (you can ignore certificate errors by setting this to true, otherwise you can omit it for false)
server=mail.myserver.com:465
 

example:

from=me@myemailaddress.com;to=someone@theiremailaddress.com;subject=Authentication Attempt Failure on your Emby Server;auth=user@auth.com:passwordhere;ignorecertificate=true;server=mail.myserver.com:465


Parameters (email body) example:

An authentication attempt was performed on your Emby Media Server (%server.name%) using username %username% and password %password% - from remote IP %device.remote.ipaddress%

 

Email result from examples above:

secure_smtp.thumb.png.3aadbf500c57a17c2aa6f7ebae11d904.png
Edited by Anthony Musgrove
Posted
	*** Error Report ***
	Version: 4.9.0.42
	Command line: /opt/emby-server/system/EmbyServer.dll -programdata /var/lib/emby -ffdetect /opt/emby-server/bin/ffdetect -ffmpeg /opt/emby-server/bin/ffmpeg -ffprobe /opt/emby-server/bin/ffprobe -restartexitcode 3 -updatepackage emby-server-deb_{version}_amd64.deb
	Operating system: Linux version 6.1.0-21-amd64 (debian-kernel@lists.debian.org) (gcc-12 (Debian 12.2.0-14) 12.2.0, GNU ld (GNU Binutils for Debian) 2.40) #1 SMP PREEMPT
	OS/Process: x64/x64
	Framework: .NET 8.0.11
	Runtime: opt/emby-server/system/System.Private.CoreLib.dll
	Processor count: 8
	Data path: /var/lib/emby
	Application path: /opt/emby-server/system
	System.InvalidOperationException: System.InvalidOperationException: Nullable object must have a value.
	   at System.Nullable`1.get_Value()
	   at EmbyScripterX.EventManagers.ScripterXSessionManager._sessionManager_PlaybackProgress(Object sender, PlaybackProgressEventArgs e)
	   at MediaBrowser.Common.Events.EventHelper.TriggerAll[T](EventHandler`1 mainHandler, Object sender, T args, ILogger logger)
	Source: System.Private.CoreLib
	TargetSite: Void ThrowInvalidOperationException_InvalidOperation_NoValue()
	
2025-03-31 21:24:18.872 Error SessionManager: Error in event handler
	*** Error Report ***
	Version: 4.9.0.42
	Command line: /opt/emby-server/system/EmbyServer.dll -programdata /var/lib/emby -ffdetect /opt/emby-server/bin/ffdetect -ffmpeg /opt/emby-server/bin/ffmpeg -ffprobe /opt/emby-server/bin/ffprobe -restartexitcode 3 -updatepackage emby-server-deb_{version}_amd64.deb
	Operating system: Linux version 6.1.0-21-amd64 (debian-kernel@lists.debian.org) (gcc-12 (Debian 12.2.0-14) 12.2.0, GNU ld (GNU Binutils for Debian) 2.40) #1 SMP PREEMPT
	OS/Process: x64/x64
	Framework: .NET 8.0.11
	Runtime: opt/emby-server/system/System.Private.CoreLib.dll
	Processor count: 8
	Data path: /var/lib/emby
	Application path: /opt/emby-server/system
	System.InvalidOperationException: System.InvalidOperationException: Nullable object must have a value.
	   at System.Nullable`1.get_Value()
	   at EmbyScripterX.EventManagers.ScripterXSessionManager._sessionManager_PlaybackProgress(Object sender, PlaybackProgressEventArgs e)
	   at MediaBrowser.Common.Events.EventHelper.TriggerAll[T](EventHandler`1 mainHandler, Object sender, T args, ILogger logger)
	Source: System.Private.CoreLib
	TargetSite: Void ThrowInvalidOperationException_InvalidOperation_NoValue()
	
2025-03-31 21:24:18.884 Info SessionManager: Removed playSession 073b7673ad1e4723bc743baff358cc0f from session 0d34a72ea66f29ed4d24445cd9e73a7b
2025-03-31 21:24:18.936 Error SessionManager: Error in event handler
	*** Error Report ***
	Version: 4.9.0.42
	Command line: /opt/emby-server/system/EmbyServer.dll -programdata /var/lib/emby -ffdetect /opt/emby-server/bin/ffdetect -ffmpeg /opt/emby-server/bin/ffmpeg -ffprobe /opt/emby-server/bin/ffprobe -restartexitcode 3 -updatepackage emby-server-deb_{version}_amd64.deb
	Operating system: Linux version 6.1.0-21-amd64 (debian-kernel@lists.debian.org) (gcc-12 (Debian 12.2.0-14) 12.2.0, GNU ld (GNU Binutils for Debian) 2.40) #1 SMP PREEMPT
	OS/Process: x64/x64
	Framework: .NET 8.0.11
	Runtime: opt/emby-server/system/System.Private.CoreLib.dll
	Processor count: 8
	Data path: /var/lib/emby
	Application path: /opt/emby-server/system
	System.InvalidOperationException: System.InvalidOperationException: Nullable object must have a value.
	   at System.Nullable`1.get_Value()
	   at EmbyScripterX.EventManagers.ScripterXSessionManager._sessionManager_PlaybackProgress(Object sender, PlaybackProgressEventArgs e)
	   at MediaBrowser.Common.Events.EventHelper.TriggerAll[T](EventHandler`1 mainHandler, Object sender, T args, ILogger logger)
	Source: System.Private.CoreLib
	TargetSite: Void ThrowInvalidOperationException_InvalidOperation_NoValue()
	
2025-03-31 21:24:23.616 Error SessionManager: Error in event handler
	*** Error Report ***
	Version: 4.9.0.42
	Command line: /opt/emby-server/system/EmbyServer.dll -programdata /var/lib/emby -ffdetect /opt/emby-server/bin/ffdetect -ffmpeg /opt/emby-server/bin/ffmpeg -ffprobe /opt/emby-server/bin/ffprobe -restartexitcode 3 -updatepackage emby-server-deb_{version}_amd64.deb
	Operating system: Linux version 6.1.0-21-amd64 (debian-kernel@lists.debian.org) (gcc-12 (Debian 12.2.0-14) 12.2.0, GNU ld (GNU Binutils for Debian) 2.40) #1 SMP PREEMPT
	OS/Process: x64/x64
	Framework: .NET 8.0.11
	Runtime: opt/emby-server/system/System.Private.CoreLib.dll
	Processor count: 8
	Data path: /var/lib/emby
	Application path: /opt/emby-server/system
	System.InvalidOperationException: System.InvalidOperationException: Nullable object must have a value.
	   at System.Nullable`1.get_Value()
	   at EmbyScripterX.EventManagers.ScripterXSessionManager._sessionManager_PlaybackProgress(Object sender, PlaybackProgressEventArgs e)
	   at MediaBrowser.Common.Events.EventHelper.TriggerAll[T](EventHandler`1 mainHandler, Object sender, T args, ILogger logger)
	Source: System.Private.CoreLib
	TargetSite: Void ThrowInvalidOperationException_InvalidOperation_NoValue()
	
2025-03-31 21:24:26.383 Error SessionManager: Error in event handler
	*** Error Report ***
	Version: 4.9.0.42
	Command line: /opt/emby-server/system/EmbyServer.dll -programdata /var/lib/emby -ffdetect /opt/emby-server/bin/ffdetect -ffmpeg /opt/emby-server/bin/ffmpeg -ffprobe /opt/emby-server/bin/ffprobe -restartexitcode 3 -updatepackage emby-server-deb_{version}_amd64.deb
	Operating system: Linux version 6.1.0-21-amd64 (debian-kernel@lists.debian.org) (gcc-12 (Debian 12.2.0-14) 12.2.0, GNU ld (GNU Binutils for Debian) 2.40) #1 SMP PREEMPT
	OS/Process: x64/x64
	Framework: .NET 8.0.11
	Runtime: opt/emby-server/system/System.Private.CoreLib.dll
	Processor count: 8
	Data path: /var/lib/emby
	Application path: /opt/emby-server/system
	System.InvalidOperationException: System.InvalidOperationException: Nullable object must have a value.
	   at System.Nullable`1.get_Value()
	   at EmbyScripterX.EventManagers.ScripterXSessionManager._sessionManager_PlaybackProgress(Object sender, PlaybackProgressEventArgs e)
	   at MediaBrowser.Common.Events.EventHelper.TriggerAll[T](EventHandler`1 mainHandler, Object sender, T args, ILogger logger)
	Source: System.Private.CoreLib
	TargetSite: Void ThrowInvalidOperationException_InvalidOperation_NoValue()
	
2025-03-31 21:24:27.478 Error SessionManager: Error in event handler
	*** Error Report ***
	Version: 4.9.0.42
	Command line: /opt/emby-server/system/EmbyServer.dll -programdata /var/lib/emby -ffdetect /opt/emby-server/bin/ffdetect -ffmpeg /opt/emby-server/bin/ffmpeg -ffprobe /opt/emby-server/bin/ffprobe -restartexitcode 3 -updatepackage emby-server-deb_{version}_amd64.deb
	Operating system: Linux version 6.1.0-21-amd64 (debian-kernel@lists.debian.org) (gcc-12 (Debian 12.2.0-14) 12.2.0, GNU ld (GNU Binutils for Debian) 2.40) #1 SMP PREEMPT
	OS/Process: x64/x64
	Framework: .NET 8.0.11
	Runtime: opt/emby-server/system/System.Private.CoreLib.dll
	Processor count: 8
	Data path: /var/lib/emby
	Application path: /opt/emby-server/system
	System.InvalidOperationException: System.InvalidOperationException: Nullable object must have a value.
	   at System.Nullable`1.get_Value()
	   at EmbyScripterX.EventManagers.ScripterXSessionManager._sessionManager_PlaybackProgress(Object sender, PlaybackProgressEventArgs e)
	   at MediaBrowser.Common.Events.EventHelper.TriggerAll[T](EventHandler`1 mainHandler, Object sender, T args, ILogger logger)
	Source: System.Private.CoreLib
	TargetSite: Void ThrowInvalidOperationException_InvalidOperation_NoValue()

Hi, I don't know what happened, but it make Emby-server not work

Anthony Musgrove
Posted (edited)

Hey @clostsorry about that, this is a simple one to resolve but I won't be back in my office until later this afternoon.

 

Workaround for right now, just untick the box on onPlaybackProgress and it will disable that event for the time being.  Update will be up later this afternoon and I'll post here to confirm  :)

 

Actually scrap that, I'll head back to the office in 10 min to push out an update.

Edited by Anthony Musgrove
Anthony Musgrove
Posted

All sorted, please update to v6.0.0.7.

* rectified nullable error with onPlaybackProgress, and also modernised the interpreter editor dropdown.  More will be coming out of that soon :)

 

image.thumb.png.a3238ee92ba8c4ea1fb7425870a4d7a9.png

  • Thanks 1
Ilicitano81
Posted (edited)

I have the following error when using the parameter %item.library.name%

 

2025-04-01 09:14:49.594 Info Emby ScripterX: onPlaybackStopped: "Movie" "admin" "%series.meta.tmdb%" "%season.number%" "%episode.number%" "13051" "%series.meta.tvdb%" "error: System.IndexOutOfRangeException: Index was outside the bounds of the array.
   at EmbyScripterX.Core.ScripterXContextFactory.<>c__DisplayClass17_0.<Item>b__0(VirtualFolderInfo x)
   at System.Collections.Generic.List`1.Find(Predicate`1 match)
   at EmbyScripterX.Core.ScripterXContextFactory.Item(BaseItem item, BaseItem parent)"

 

Edited by Ilicitano81
Anthony Musgrove
Posted
3 hours ago, Ilicitano81 said:

I have the following error when using the parameter %item.library.name%

 

2025-04-01 09:14:49.594 Info Emby ScripterX: onPlaybackStopped: "Movie" "admin" "%series.meta.tmdb%" "%season.number%" "%episode.number%" "13051" "%series.meta.tvdb%" "error: System.IndexOutOfRangeException: Index was outside the bounds of the array.
   at EmbyScripterX.Core.ScripterXContextFactory.<>c__DisplayClass17_0.<Item>b__0(VirtualFolderInfo x)
   at System.Collections.Generic.List`1.Find(Predicate`1 match)
   at EmbyScripterX.Core.ScripterXContextFactory.Item(BaseItem item, BaseItem parent)"

 

Thank you for this information @Ilicitano81- I'll look into this one for you.  I'd say there may be some slight changes with interfacing to find that information, shouldn't be too difficult to find.

Anthony Musgrove
Posted

@Ilicitano81 could you please give me some more information, perhaps a copy of your emby log?

I've just tested onPlaybackStopped for a movie, 2025-04-01 22:24:45.522 Info Emby ScripterX: onPlaybackStopped: "Movie" "Movies" and it seems to be functioning correctly.

I tried the above with the movie Toy Story,

and I also played/stopped an episode of a TV series I have:

2025-04-01 22:27:31.756 Info Emby ScripterX: onPlaybackStopped: "TV" "TV shows"

Thanks in advance, Anthony

image.thumb.png.316ec2923573e0d0c223e6b8f07c78a5.png

Posted
1 hour ago, Anthony Musgrove said:

@Ilicitano81 could you please give me some more information, perhaps a copy of your emby log?

I've just tested onPlaybackStopped for a movie, 2025-04-01 22:24:45.522 Info Emby ScripterX: onPlaybackStopped: "Movie" "Movies" and it seems to be functioning correctly.

I tried the above with the movie Toy Story,

and I also played/stopped an episode of a TV series I have:

2025-04-01 22:27:31.756 Info Emby ScripterX: onPlaybackStopped: "TV" "TV shows"

Thanks in advance, Anthony

image.thumb.png.316ec2923573e0d0c223e6b8f07c78a5.png

I have a "script.sh" file that I use to send notifications to Telegram through a bot, everything works fine except for what I mentioned before.IMG_20250401_152828_813.thumb.jpg.605418aceb85c3b3ea421cf9c976e68a.jpg

Anthony Musgrove
Posted
13 minutes ago, Sonipelu said:

I have a "script.sh" file that I use to send notifications to Telegram through a bot, everything works fine except for what I mentioned before.IMG_20250401_152828_813.thumb.jpg.605418aceb85c3b3ea421cf9c976e68a.jpg

Hi there @Sonipelu, could you please refresh my memory of what the problem was? I can't seem to find your original post, thank you.

Ilicitano81
Posted
46 minutes ago, Anthony Musgrove said:

Hi there @Sonipelu, could you please refresh my memory of what the problem was? I can't seem to find your original post, thank you.

Sorry, I answered you from my cell phone that my wife's account was open.

  • 3 weeks later...
Apotropaic
Posted

Hi, I've scrambled my brain trying to figure out where this plugin project is at...are the community packages still a thing?

As I was hoping someone else had tried to do what I wanted but luckily I worked out enough from here to get it working.

I run my script as a scheduled task to determine my VPN location (country, city, IP) and send that info as variables to a Pushover event so I can easily keep track of what's going. If anyone is interested I'd be happy to share it but I don't want to fill the forum with my pointless bad scripting!!!

  • Thanks 1
Anthony Musgrove
Posted
16 hours ago, jaspalgill said:

Hi, I've scrambled my brain trying to figure out where this plugin project is at...are the community packages still a thing?

As I was hoping someone else had tried to do what I wanted but luckily I worked out enough from here to get it working.

I run my script as a scheduled task to determine my VPN location (country, city, IP) and send that info as variables to a Pushover event so I can easily keep track of what's going. If anyone is interested I'd be happy to share it but I don't want to fill the forum with my pointless bad scripting!!!

Hey @jaspalgillthank you so much for your feedback and contribution!  My goal now is to improve and simplify the user experience for Scripter-X, and behind the scenes I am working on some big things.

I'm also trying to get the Wiki content written so that it reflects all the important information contained within this forum thread, the wiki is located at https://wiki.scripter-x.au - but is largely incomplete at this stage.

I'm working hard though to get this stuff done and can't wait to see the outcome and growth of this project moving forward - I can't believe that from a simple idea, to what it has become today with many, many users, many scripts, many ideas and many contributions - and 5 years (wow, that went fast - I have a 6 year old now), I thank every single person that has helped me with making Scripter-X what it is today.

And also, thank you so warmly to those who donate to the project to allow me to take some time away from other work to truly work on this project further.

Any ideas, suggestions, comments, all very welcome, and all are taken into consideration.  

Warm regards,

Anthony Musgrove 

  • Like 1
  • Thanks 1
Ilicitano81
Posted

What information is obtained with these two parameters? What could they be used for?IMG_20250420_222219_015.jpg.a5aa3bcca0bd38790f0fbcf6b8f6f8e3.jpg

Posted

i just discovered this plugin and it's like drinking from a firehouse LOL.  I'm hoping this can solve an issue i'm having that can be solved by running a simple .sh script after a scheduled task completes.  So far i've created:

image.thumb.png.2c6d52cac78911e83b6ad3018f867c68.png

After the scheduled task completes the log is showing:

025-04-27 00:34:43.992 Info TaskManager: Executing Convert M3U Vods To STRMS
2025-04-27 00:34:43.992 Info Server: http/1.1 Response 204 to ‌‍‍192.168.1.146‌. Time: 1ms. POST http://‌‍‍192.168.1.143‌:9096/emby/ScheduledTasks/Running/479238119a14fac0f6d57ac8d0731aab?X-Emby-Client=Emby Web&X-Emby-Device-Name=Edge Windows&X-Emby-Device-Id=fbafce8a-aa0b-4060-8363-2a4a85ef0c2d&X-Emby-Client-Version=4.8.11.0&X-Emby-Token=‌4535912e6dc1429583694ff29336c141‌&X-Emby-Language=en-us
2025-04-27 00:34:44.298 Info TaskManager: Convert M3U Vods To STRMS Completed after 0 minute(s) and 0 seconds
2025-04-27 00:34:44.299 Info Emby ScripterX: onScheduledTaskEnded: 
2025-04-27 00:34:44.299 Error TaskManager: Error in event handler
    *** Error Report ***
    Version: 4.8.11.0
    Command line: /system/EmbyServer.dll -programdata /config -ffdetect /bin/ffdetect -ffmpeg /bin/ffmpeg -ffprobe /bin/ffprobe -restartexitcode 3
    Operating system: Linux version 6.12.15-production+truenas (root@tnsbuilds01.tn.ixsystems.net) (gcc (Debian 12.2.0-14) 12.2.0, GNU ld (GNU Binutils for Debian) 2.40) #1
    Framework: .NET 6.0.36
    OS/Process: x64/x64
    Runtime: system/System.Private.CoreLib.dll
    Processor count: 12
    Data path: /config
    Application path: /system
    System.ComponentModel.Win32Exception: System.ComponentModel.Win32Exception (2): An error occurred trying to start process '/bin/bash' with working directory '/var/run/s6/services/emby-server'. No such file or directory
       at System.Diagnostics.Process.ForkAndExecProcess(ProcessStartInfo startInfo, String resolvedFilename, String[] argv, String[] envp, String cwd, Boolean setCredentials, UInt32 userId, UInt32 groupId, UInt32[] groups, Int32& stdinFd, Int32& stdoutFd, Int32& stderrFd, Boolean usesTerminal, Boolean throwOnNoExec)
       at System.Diagnostics.Process.StartCore(ProcessStartInfo startInfo)
       at System.Diagnostics.Process.Start()
       at EmbyScripterX.Plugin.execute_action(EmbyScripterXAction nAction, String parameters)
       at EmbyScripterX.Core.ScripterXEventContext.Process(EmbyScripterXAction withAction)
       at EmbyScripterX.EventManagers.ScripterXTaskManager._taskManager_TaskCompleted(Object sender, TaskCompletionEventArgs e)
       at MediaBrowser.Common.Events.EventHelper.TriggerAll[T](EventHandler`1 mainHandler, Object sender, T args, ILogger logger)
    Source: System.Diagnostics.Process
    TargetSite: Boolean ForkAndExecProcess(System.Diagnostics.ProcessStartInfo, System.String, System.String[], System.String[], System.String, Boolean, UInt32, UInt32, UInt32[], Int32 ByRef, Int32 ByRef, Int32 ByRef, Boolean, Boolean)
 

I'm running Emby in docker but not sure where to start looking to understand what the error means.  Is there anyone that could point me in the right direction?

 

 

 

Anthony Musgrove
Posted
14 minutes ago, goin3d said:

i just discovered this plugin and it's like drinking from a firehouse LOL.  I'm hoping this can solve an issue i'm having that can be solved by running a simple .sh script after a scheduled task completes.  So far i've created:

image.thumb.png.2c6d52cac78911e83b6ad3018f867c68.png

After the scheduled task completes the log is showing:

025-04-27 00:34:43.992 Info TaskManager: Executing Convert M3U Vods To STRMS
2025-04-27 00:34:43.992 Info Server: http/1.1 Response 204 to ‌‍‍192.168.1.146‌. Time: 1ms. POST http://‌‍‍192.168.1.143‌:9096/emby/ScheduledTasks/Running/479238119a14fac0f6d57ac8d0731aab?X-Emby-Client=Emby Web&X-Emby-Device-Name=Edge Windows&X-Emby-Device-Id=fbafce8a-aa0b-4060-8363-2a4a85ef0c2d&X-Emby-Client-Version=4.8.11.0&X-Emby-Token=‌4535912e6dc1429583694ff29336c141‌&X-Emby-Language=en-us
2025-04-27 00:34:44.298 Info TaskManager: Convert M3U Vods To STRMS Completed after 0 minute(s) and 0 seconds
2025-04-27 00:34:44.299 Info Emby ScripterX: onScheduledTaskEnded: 
2025-04-27 00:34:44.299 Error TaskManager: Error in event handler
    *** Error Report ***
    Version: 4.8.11.0
    Command line: /system/EmbyServer.dll -programdata /config -ffdetect /bin/ffdetect -ffmpeg /bin/ffmpeg -ffprobe /bin/ffprobe -restartexitcode 3
    Operating system: Linux version 6.12.15-production+truenas (root@tnsbuilds01.tn.ixsystems.net) (gcc (Debian 12.2.0-14) 12.2.0, GNU ld (GNU Binutils for Debian) 2.40) #1
    Framework: .NET 6.0.36
    OS/Process: x64/x64
    Runtime: system/System.Private.CoreLib.dll
    Processor count: 12
    Data path: /config
    Application path: /system
    System.ComponentModel.Win32Exception: System.ComponentModel.Win32Exception (2): An error occurred trying to start process '/bin/bash' with working directory '/var/run/s6/services/emby-server'. No such file or directory
       at System.Diagnostics.Process.ForkAndExecProcess(ProcessStartInfo startInfo, String resolvedFilename, String[] argv, String[] envp, String cwd, Boolean setCredentials, UInt32 userId, UInt32 groupId, UInt32[] groups, Int32& stdinFd, Int32& stdoutFd, Int32& stderrFd, Boolean usesTerminal, Boolean throwOnNoExec)
       at System.Diagnostics.Process.StartCore(ProcessStartInfo startInfo)
       at System.Diagnostics.Process.Start()
       at EmbyScripterX.Plugin.execute_action(EmbyScripterXAction nAction, String parameters)
       at EmbyScripterX.Core.ScripterXEventContext.Process(EmbyScripterXAction withAction)
       at EmbyScripterX.EventManagers.ScripterXTaskManager._taskManager_TaskCompleted(Object sender, TaskCompletionEventArgs e)
       at MediaBrowser.Common.Events.EventHelper.TriggerAll[T](EventHandler`1 mainHandler, Object sender, T args, ILogger logger)
    Source: System.Diagnostics.Process
    TargetSite: Boolean ForkAndExecProcess(System.Diagnostics.ProcessStartInfo, System.String, System.String[], System.String[], System.String, Boolean, UInt32, UInt32, UInt32[], Int32 ByRef, Int32 ByRef, Int32 ByRef, Boolean, Boolean)
 

I'm running Emby in docker but not sure where to start looking to understand what the error means.  Is there anyone that could point me in the right direction?

 

 

 

G'day mate!  Hehe, I'm not sure if drinking from a firehose is a good or bad thing, I think it'd hurt quite a bit :)


Alrighty!  The error is here:

System.ComponentModel.Win32Exception: System.ComponentModel.Win32Exception (2): An error occurred trying to start process '/bin/bash' with working directory '/var/run/s6/services/emby-server'. No such file or directory

 

The issue here is that it can't find /bin/bash to execute it.  Are you certain your docker has a /bin/bash or is it /bin/sh or something else?  If you can, ssh into your docker instance and type whereis bash and/or whereis sh

You should see something like:

root@medius:~# whereis bash
bash: /bin/bash /etc/bash.bashrc /usr/share/man/man1/bash.1.gz
root@medius:~# whereis sh
sh: /bin/sh /bin/sh.distrib /usr/share/man/man1/sh.1.gz

And just make sure your Using: dropdown reflects the path to your sh/bash interpreter.

note:  You can override the contents of the Using: box just by typing in there instead of selecting from the predefined dropdown options :)

 

Posted
10 minutes ago, Anthony Musgrove said:

G'day mate!  Hehe, I'm not sure if drinking from a firehose is a good or bad thing, I think it'd hurt quite a bit :)


Alrighty!  The error is here:

System.ComponentModel.Win32Exception: System.ComponentModel.Win32Exception (2): An error occurred trying to start process '/bin/bash' with working directory '/var/run/s6/services/emby-server'. No such file or directory

 

The issue here is that it can't find /bin/bash to execute it.  Are you certain your docker has a /bin/bash or is it /bin/sh or something else?  If you can, ssh into your docker instance and type whereis bash and/or whereis sh

You should see something like:

root@medius:~# whereis bash
bash: /bin/bash /etc/bash.bashrc /usr/share/man/man1/bash.1.gz
root@medius:~# whereis sh
sh: /bin/sh /bin/sh.distrib /usr/share/man/man1/sh.1.gz

And just make sure your Using: dropdown reflects the path to your sh/bash interpreter.

note:  You can override the contents of the Using: box just by typing in there instead of selecting from the predefined dropdown options :)

 

Thank you so much for the detailed explanation!  It appears i should have been selecting sh instead of bash.  after changing that i've gotten a few steps further!  thank you!!!!!

  • Like 1
Anthony Musgrove
Posted
10 minutes ago, goin3d said:

Thank you so much for the detailed explanation!  It appears i should have been selecting sh instead of bash.  after changing that i've gotten a few steps further!  thank you!!!!!

You're very welcome my dude!  Thank you so much for joining the Scripter-X crew :) 

Apotropaic
Posted

Hi, I had a scheduled task firing off a curl script working with the latest emby server on ubuntu 22.04, since then I've rebuilt my emby server on Ubuntu 24.04 but I can't get the exact same script setup to work.

If I execute it manually via the shell it works, but from the scheduled task within Emby it runs but doesn't produce the expected result. There's no error messages within the emby log, but I can see the plugin working and part of the script logs to a local file and I can see that updating. So the script is being called by the plugin.

It's the curl component that's failing and going through /var/log/syslog I can see the following messages.

2025-05-02T10:19:53.915351+01:00 xxxxxxx emby-server[4154]: curl: /opt/emby-server/lib/libcurl.so.4: no version information available (required by curl)
2025-05-02T10:19:53.916915+01:00 xxxxxxx emby-server[4154]: curl: symbol lookup error: curl: undefined symbol: curl_global_trace, version CURL_OPENSSL_4

So does this mean emby has it's own curl which is the issue but the curl installed under 22.04 is fine?

Thanks to anyone who can shed some light here, enough so I can understand if this is an emby issue, my scripterX setup or something wrong in 22.04.

Anthony Musgrove
Posted (edited)
9 hours ago, jaspalgill said:

Hi, I had a scheduled task firing off a curl script working with the latest emby server on ubuntu 22.04, since then I've rebuilt my emby server on Ubuntu 24.04 but I can't get the exact same script setup to work.

If I execute it manually via the shell it works, but from the scheduled task within Emby it runs but doesn't produce the expected result. There's no error messages within the emby log, but I can see the plugin working and part of the script logs to a local file and I can see that updating. So the script is being called by the plugin.

It's the curl component that's failing and going through /var/log/syslog I can see the following messages.

2025-05-02T10:19:53.915351+01:00 xxxxxxx emby-server[4154]: curl: /opt/emby-server/lib/libcurl.so.4: no version information available (required by curl)
2025-05-02T10:19:53.916915+01:00 xxxxxxx emby-server[4154]: curl: symbol lookup error: curl: undefined symbol: curl_global_trace, version CURL_OPENSSL_4

So does this mean emby has it's own curl which is the issue but the curl installed under 22.04 is fine?

Thanks to anyone who can shed some light here, enough so I can understand if this is an emby issue, my scripterX setup or something wrong in 22.04.

Hey @jaspalgill thanks for using Scripter-X :) 

The issue you're having looks like an environment/curl issue.  In your working curl environment (in the shell environment), try typing whereis curl and see which curl binary is being executed in your shell environment, you'll get something like:

root@medius:~# whereis curl
curl: /usr/bin/curl /usr/share/man/man1/curl.1.gz

and if that is the working curl binary, in Scripter-X paste that exact path in the Using: box.  This *should* force Emby Media Server to use the working curl binary/install.  But the issue looks like a curl installation issue, perhaps two different versions of curl installed on the one server, which can cause grief especially if Emby's user environment points to the erroneous installation.

Edit:  Another thing thing you can try (just to confirm), create a bash script, make that bash script log curl --version >> /path/to/writeable/testfile.log - then configure Scripter-X to run that bash script on an event, and see which curl binary the Emby environment is actually pointing at. 

I hope this all helps mate, please let me know how you go!

Edited by Anthony Musgrove
spelling
Apotropaic
Posted
On 02/05/2025 at 22:14, Anthony Musgrove said:

Hey @jaspalgill thanks for using Scripter-X :) 

The issue you're having looks like an environment/curl issue.  In your working curl environment (in the shell environment), try typing whereis curl and see which curl binary is being executed in your shell environment, you'll get something like:

root@medius:~# whereis curl
curl: /usr/bin/curl /usr/share/man/man1/curl.1.gz

and if that is the working curl binary, in Scripter-X paste that exact path in the Using: box.  This *should* force Emby Media Server to use the working curl binary/install.  But the issue looks like a curl installation issue, perhaps two different versions of curl installed on the one server, which can cause grief especially if Emby's user environment points to the erroneous installation.

Edit:  Another thing thing you can try (just to confirm), create a bash script, make that bash script log curl --version >> /path/to/writeable/testfile.log - then configure Scripter-X to run that bash script on an event, and see which curl binary the Emby environment is actually pointing at. 

I hope this all helps mate, please let me know how you go!

Thank you for trying to help here!

My curl location is the same as yours
curl: /usr/bin/curl /usr/share/man/man1/curl.1.gz

if I use the /usr/bin/curl path within Scripter-X it still 'fails' but the error is a little different 

2025-05-04T13:30:59.208526+01:00 asajjventress emby-server[18357]: /usr/bin/curl: /opt/emby-server/lib/libcurl.so.4: no version information available (required by /usr/bin/curl)
2025-05-04T13:30:59.209297+01:00 asajjventress emby-server[18357]: /usr/bin/curl: symbol lookup error: /usr/bin/curl: undefined symbol: curl_global_trace, version CURL_OPENSSL_4

So I feel emby is somehow interfering with its own curl version somehow, as it's still using the libcurl.so.4 library within the emby install instead my shell environment version.

Trying to make Scripter-X write out the curl version emby is trying to use fails in the same way, the execution fails.

What's odd is this is a fresh 24.04 server with a fresh emby install, although I did use the emby backup and restore tool. There's quite a few articles online with similar curl issues, I just don't want to break emby if it's relying on this setup.

Might just try to reinstall curl and see what happens lol

 

Apotropaic
Posted

For anyone who has a similar issue I managed to fix it by setting the environmental variable path within my script with the following command.

export LD_LIBRARY_PATH=/usr/bin/

You'll need to add your own path to where your working binaries are!

 

Apotropaic
Posted

Hi @Anthony Musgrove, any idea what is causing this to appear in the EmbyServer log?

2025-05-10 16:35:36.847 Info Emby ScripterX: Waiting maximum 600000ms to call MediaItemAddedComplete for Item ID 2450645

I only have one script running on a scheduled task that has nothing to do with media scans or library updates. I did notice all the plugin Actions were enabled so I've gone through and disabled them all except the 'onScheduledTask' action which I use, but I still see these appearing in the log. Just worried this is impacting the speed at which my libraries scan as I've noticed them take longer and longer recently and just trying to discount this.

Posted (edited)
On 31/03/2025 at 23:04, clost said:
	*** Error Report ***
	Version: 4.9.0.42
	Command line: /opt/emby-server/system/EmbyServer.dll -programdata /var/lib/emby -ffdetect /opt/emby-server/bin/ffdetect -ffmpeg /opt/emby-server/bin/ffmpeg -ffprobe /opt/emby-server/bin/ffprobe -restartexitcode 3 -updatepackage emby-server-deb_{version}_amd64.deb
	Operating system: Linux version 6.1.0-21-amd64 (debian-kernel@lists.debian.org) (gcc-12 (Debian 12.2.0-14) 12.2.0, GNU ld (GNU Binutils for Debian) 2.40) #1 SMP PREEMPT
	OS/Process: x64/x64
	Framework: .NET 8.0.11
	Runtime: opt/emby-server/system/System.Private.CoreLib.dll
	Processor count: 8
	Data path: /var/lib/emby
	Application path: /opt/emby-server/system
	System.InvalidOperationException: System.InvalidOperationException: Nullable object must have a value.
	   at System.Nullable`1.get_Value()
	   at EmbyScripterX.EventManagers.ScripterXSessionManager._sessionManager_PlaybackProgress(Object sender, PlaybackProgressEventArgs e)
	   at MediaBrowser.Common.Events.EventHelper.TriggerAll[T](EventHandler`1 mainHandler, Object sender, T args, ILogger logger)
	Source: System.Private.CoreLib
	TargetSite: Void ThrowInvalidOperationException_InvalidOperation_NoValue()
	
2025-03-31 21:24:18.872 Error SessionManager: Error in event handler
	*** Error Report ***
	Version: 4.9.0.42
	Command line: /opt/emby-server/system/EmbyServer.dll -programdata /var/lib/emby -ffdetect /opt/emby-server/bin/ffdetect -ffmpeg /opt/emby-server/bin/ffmpeg -ffprobe /opt/emby-server/bin/ffprobe -restartexitcode 3 -updatepackage emby-server-deb_{version}_amd64.deb
	Operating system: Linux version 6.1.0-21-amd64 (debian-kernel@lists.debian.org) (gcc-12 (Debian 12.2.0-14) 12.2.0, GNU ld (GNU Binutils for Debian) 2.40) #1 SMP PREEMPT
	OS/Process: x64/x64
	Framework: .NET 8.0.11
	Runtime: opt/emby-server/system/System.Private.CoreLib.dll
	Processor count: 8
	Data path: /var/lib/emby
	Application path: /opt/emby-server/system
	System.InvalidOperationException: System.InvalidOperationException: Nullable object must have a value.
	   at System.Nullable`1.get_Value()
	   at EmbyScripterX.EventManagers.ScripterXSessionManager._sessionManager_PlaybackProgress(Object sender, PlaybackProgressEventArgs e)
	   at MediaBrowser.Common.Events.EventHelper.TriggerAll[T](EventHandler`1 mainHandler, Object sender, T args, ILogger logger)
	Source: System.Private.CoreLib
	TargetSite: Void ThrowInvalidOperationException_InvalidOperation_NoValue()
	
2025-03-31 21:24:18.884 Info SessionManager: Removed playSession 073b7673ad1e4723bc743baff358cc0f from session 0d34a72ea66f29ed4d24445cd9e73a7b
2025-03-31 21:24:18.936 Error SessionManager: Error in event handler
	*** Error Report ***
	Version: 4.9.0.42
	Command line: /opt/emby-server/system/EmbyServer.dll -programdata /var/lib/emby -ffdetect /opt/emby-server/bin/ffdetect -ffmpeg /opt/emby-server/bin/ffmpeg -ffprobe /opt/emby-server/bin/ffprobe -restartexitcode 3 -updatepackage emby-server-deb_{version}_amd64.deb
	Operating system: Linux version 6.1.0-21-amd64 (debian-kernel@lists.debian.org) (gcc-12 (Debian 12.2.0-14) 12.2.0, GNU ld (GNU Binutils for Debian) 2.40) #1 SMP PREEMPT
	OS/Process: x64/x64
	Framework: .NET 8.0.11
	Runtime: opt/emby-server/system/System.Private.CoreLib.dll
	Processor count: 8
	Data path: /var/lib/emby
	Application path: /opt/emby-server/system
	System.InvalidOperationException: System.InvalidOperationException: Nullable object must have a value.
	   at System.Nullable`1.get_Value()
	   at EmbyScripterX.EventManagers.ScripterXSessionManager._sessionManager_PlaybackProgress(Object sender, PlaybackProgressEventArgs e)
	   at MediaBrowser.Common.Events.EventHelper.TriggerAll[T](EventHandler`1 mainHandler, Object sender, T args, ILogger logger)
	Source: System.Private.CoreLib
	TargetSite: Void ThrowInvalidOperationException_InvalidOperation_NoValue()
	
2025-03-31 21:24:23.616 Error SessionManager: Error in event handler
	*** Error Report ***
	Version: 4.9.0.42
	Command line: /opt/emby-server/system/EmbyServer.dll -programdata /var/lib/emby -ffdetect /opt/emby-server/bin/ffdetect -ffmpeg /opt/emby-server/bin/ffmpeg -ffprobe /opt/emby-server/bin/ffprobe -restartexitcode 3 -updatepackage emby-server-deb_{version}_amd64.deb
	Operating system: Linux version 6.1.0-21-amd64 (debian-kernel@lists.debian.org) (gcc-12 (Debian 12.2.0-14) 12.2.0, GNU ld (GNU Binutils for Debian) 2.40) #1 SMP PREEMPT
	OS/Process: x64/x64
	Framework: .NET 8.0.11
	Runtime: opt/emby-server/system/System.Private.CoreLib.dll
	Processor count: 8
	Data path: /var/lib/emby
	Application path: /opt/emby-server/system
	System.InvalidOperationException: System.InvalidOperationException: Nullable object must have a value.
	   at System.Nullable`1.get_Value()
	   at EmbyScripterX.EventManagers.ScripterXSessionManager._sessionManager_PlaybackProgress(Object sender, PlaybackProgressEventArgs e)
	   at MediaBrowser.Common.Events.EventHelper.TriggerAll[T](EventHandler`1 mainHandler, Object sender, T args, ILogger logger)
	Source: System.Private.CoreLib
	TargetSite: Void ThrowInvalidOperationException_InvalidOperation_NoValue()
	
2025-03-31 21:24:26.383 Error SessionManager: Error in event handler
	*** Error Report ***
	Version: 4.9.0.42
	Command line: /opt/emby-server/system/EmbyServer.dll -programdata /var/lib/emby -ffdetect /opt/emby-server/bin/ffdetect -ffmpeg /opt/emby-server/bin/ffmpeg -ffprobe /opt/emby-server/bin/ffprobe -restartexitcode 3 -updatepackage emby-server-deb_{version}_amd64.deb
	Operating system: Linux version 6.1.0-21-amd64 (debian-kernel@lists.debian.org) (gcc-12 (Debian 12.2.0-14) 12.2.0, GNU ld (GNU Binutils for Debian) 2.40) #1 SMP PREEMPT
	OS/Process: x64/x64
	Framework: .NET 8.0.11
	Runtime: opt/emby-server/system/System.Private.CoreLib.dll
	Processor count: 8
	Data path: /var/lib/emby
	Application path: /opt/emby-server/system
	System.InvalidOperationException: System.InvalidOperationException: Nullable object must have a value.
	   at System.Nullable`1.get_Value()
	   at EmbyScripterX.EventManagers.ScripterXSessionManager._sessionManager_PlaybackProgress(Object sender, PlaybackProgressEventArgs e)
	   at MediaBrowser.Common.Events.EventHelper.TriggerAll[T](EventHandler`1 mainHandler, Object sender, T args, ILogger logger)
	Source: System.Private.CoreLib
	TargetSite: Void ThrowInvalidOperationException_InvalidOperation_NoValue()
	
2025-03-31 21:24:27.478 Error SessionManager: Error in event handler
	*** Error Report ***
	Version: 4.9.0.42
	Command line: /opt/emby-server/system/EmbyServer.dll -programdata /var/lib/emby -ffdetect /opt/emby-server/bin/ffdetect -ffmpeg /opt/emby-server/bin/ffmpeg -ffprobe /opt/emby-server/bin/ffprobe -restartexitcode 3 -updatepackage emby-server-deb_{version}_amd64.deb
	Operating system: Linux version 6.1.0-21-amd64 (debian-kernel@lists.debian.org) (gcc-12 (Debian 12.2.0-14) 12.2.0, GNU ld (GNU Binutils for Debian) 2.40) #1 SMP PREEMPT
	OS/Process: x64/x64
	Framework: .NET 8.0.11
	Runtime: opt/emby-server/system/System.Private.CoreLib.dll
	Processor count: 8
	Data path: /var/lib/emby
	Application path: /opt/emby-server/system
	System.InvalidOperationException: System.InvalidOperationException: Nullable object must have a value.
	   at System.Nullable`1.get_Value()
	   at EmbyScripterX.EventManagers.ScripterXSessionManager._sessionManager_PlaybackProgress(Object sender, PlaybackProgressEventArgs e)
	   at MediaBrowser.Common.Events.EventHelper.TriggerAll[T](EventHandler`1 mainHandler, Object sender, T args, ILogger logger)
	Source: System.Private.CoreLib
	TargetSite: Void ThrowInvalidOperationException_InvalidOperation_NoValue()

Hi, I don't know what happened, but it make Emby-server not work

Today same problem happened again, and make my server shut down

It cost a lot of memory of the server, happened again and again

	*** Error Report ***
	Version: 4.9.0.43
	Command line: /opt/emby-server/system/EmbyServer.dll -programdata /var/lib/emby -ffdetect /opt/emby-server/bin/ffdetect -ffmpeg /opt/emby-server/bin/ffmpeg -ffprobe /opt/emby-server/bin/ffprobe -restartexitcode 3 -updatepackage emby-server-deb_{version}_amd64.deb
	Operating system: Linux version 6.1.0-21-amd64 (debian-kernel@lists.debian.org) (gcc-12 (Debian 12.2.0-14) 12.2.0, GNU ld (GNU Binutils for Debian) 2.40) #1 SMP PREEMPT
	OS/Process: x64/x64
	Framework: .NET 8.0.11
	Runtime: opt/emby-server/system/System.Private.CoreLib.dll
	Processor count: 8
	Data path: /var/lib/emby
	Application path: /opt/emby-server/system
	System.InvalidOperationException: System.InvalidOperationException: Nullable object must have a value.
	   at System.Nullable`1.get_Value()
	   at EmbyScripterX.EventManagers.ScripterXSessionManager._sessionManager_PlaybackProgress(Object sender, PlaybackProgressEventArgs e)
	   at MediaBrowser.Common.Events.EventHelper.TriggerAll[T](EventHandler`1 mainHandler, Object sender, T args, ILogger logger)
	Source: System.Private.CoreLib
	TargetSite: Void ThrowInvalidOperationException_InvalidOperation_NoValue()
	
2025-05-17 18:42:17.904 Error SessionManager: Error in event handler

 

Edited by clost

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...