Announcement

Collapse
No announcement yet.

Exception - Won't Read INI file

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Exception - Won't Read INI file

    Hi, i am new to HomeSeer, still in trial mode.

    I can't get the plugin to work, it seems to not be able to read/write the ini file even though the file is present. I am running this on Linux a docker container https://hub.docker.com/r/marthoc/homeseer/

    Other plugins seem to work ok.

    System.IO.DirectoryNotFoundException: Could not find a part of the path "/Config/HSPI_SurveillanceStation.ini". at System.IO.FileStream..ctor (System.String path, System.IO.FileMode mode, System.IO.FileAccess access, System.IO.FileShare share, System.Int32 bufferSize, System.Boolean anonymous, System.IO.FileOptions options) [0x00164] in :0 at System.IO.FileStream..ctor (System.String path, System.IO.FileMode mode, System.IO.FileAccess access, System.IO.FileShare share, System.Int32 bufferSize, System.IO.FileOptions options, System.String msgPath, System.Boolean bFromProxy, System.Boolean useLongPath, System.Boolean checkHost) [0x00000] in :0 at (wrapper remoting-invoke-with-check) System.IO.FileStream..ctor(string,System.IO.FileMode,System. IO.FileAccess,System.IO.FileShare,int,System.IO.FileOptions, string,bool,bool,bool) at System.IO.StreamWriter.CreateFile (System.String path, System.Boolean append, System.Boolean checkHost) [0x0001c] in :0 at System.IO.StreamWriter..ctor (System.String path, System.Boolean append, System.Text.Encoding encoding, System.Int32 bufferSize, System.Boolean checkHost) [0x00055] in :0 at System.IO.StreamWriter..ctor (System.String path, System.Boolean append, System.Text.Encoding encoding, System.Int32 bufferSize) [0x00000] in :0 at System.IO.StreamWriter..ctor (System.String path) [0x00008] in :0 at (wrapper remoting-invoke-with-check) System.IO.StreamWriter..ctor(string) at IniParser.SimpleIniParser.write (System.String path) [0x00000] in :0 at IniParser.SimpleIniParser.save () [0x00000] in :0 at HSPI_SurveillanceStation.ConfigurationStore.Save () [0x001f6] in :0

  • #2
    Hi,

    Never tried running the plugin in a docker container, though I did test it on Linux and Windows. I notice it is trying to read from /Config, does that exist ?
    Can you post the file permissions ?

    Comment


    • #3
      Originally posted by kriz83 View Post
      Hi,

      Never tried running the plugin in a docker container, though I did test it on Linux and Windows.
      A docker container is basically ubuntu with literally the minimal number of packages installed possible to run. Mine has a couple I added to the base.
      (see attached, let me know if you see anything missing your module needs, but often mono stuff is self contained so it works on windows and linux)
      Its a little odd to get started, especially for a dye-in-the-wool windows person like myself. That said I now use docker containers as my default for any Linux HA project, all running on my synology.
      I will write up my synology/docker implementation of homeseer soon.

      I only have one thing left on my rpi (nodelink).

      This is the container in question https://github.com/marthoc/docker-homeseer

      I notice it is trying to read from /Config, does that exist ?
      Can you post the file permissions ?
      Hi yes it exists (and the case is the same too)

      Belowis the file perms you asked for
      Code:
      -rwxr-xr-x 1 root root 217 Jun  8 18:42 HSPI_SurveillanceStation.ini
      The folder is:
      Code:
      drwxr-xr-x  19 1026 users  4096 Jun 12 17:35 HomeSeer
      Note the folder is ./HomeSeer it hangs directly off root, one other plugin didn't like that apparently either (hsbuddy)

      I removed the plug in and re-installed it did not create the config file when re-enabling / re-installing you can see the installer creating the file from the package
      Code:
      Jun-12 17:35:23	 	Updater	Copying file: /HomeSeer/Config/HSPI_SurveillanceStation.ini
      If I populate the file by hand it does not read it either.

      I have 14 other plugs reading and writing from this directory just fine.
      Attached Files
      Last edited by scyto; June 15th, 2018, 02:47 AM. Reason: typols

      Comment


      • #4
        Hi,

        I would need to spin up (install ...) my linux environment again, but I'm wont have time for that untill next week (holidays).

        Is homeseer run as root ?

        What happens if you change file (and directory) rights to 777 ?

        Comment


        • #5
          Originally posted by kriz83 View Post
          Hi,
          Is homeseer run as root ?
          What happens if you change file (and directory) rights to 777 ?
          Yes all processes run as UID 0 (root)
          Chmod 777 made no difference (i notice applying it to the HomeSeer folder made it cascade)
          No rush, other than i have 26 days of trial of the plugin - can that be etxended if needed?
          Last edited by scyto; June 13th, 2018, 02:54 PM.

          Comment


          • #6
            Hi,

            I can send you a custom version once the trial has expired.
            For now you could run it for testing purposes 'remotely' (so outside your docker container).

            Comment


            • #7
              Originally posted by kriz83 View Post
              Hi,

              I can send you a custom version once the trial has expired.
              For now you could run it for testing purposes 'remotely' (so outside your docker container).
              Umm guess so, I will have to spin up Linux somewhere (I run my docker on a Synology box or windows).

              Comment


              • #8
                Will try to have a look this weekend.
                Also planning to rewrite it to .NET core, so you don't need Mono anymore. This should work better in docker containers.

                Comment


                • #9
                  Hi, got my 18.04 ubuntu installed on hyper V, setting it up now... will edit post as I make progress.

                  Installed 18.04 desktop

                  All commands run using sudo in /Home/alex

                  Updated the mono deb files to latest stable mono (5.12.0.226) as per http://www.mono-project.com/download.../#download-lin


                  sudo apt-get install mono-runtime
                  sudo apt-get install mono-vbnc
                  sudo apt-get install flite
                  sudo apt-get install chromium-bsu
                  sudp apt-get install mono-xsp4
                  sudo wget -O /homeseer.tgz "https://homeseer.com/updates3/hs3_linux_3_0_0_435.tar.gz
                  sudo tar -xzo -C / -f /homeseer.tgz



                  app went bang in same way with same IO, only difference it was looking for ini file in /Home/alex/Config and the file does not exist there....
                  quit

                  changed to root dir

                  sudo mono /HomeSeer/HSConsole.exe --log

                  app went bang in same way with same IO, only difference it was looking for ini file in /Config and the file does not exist there....

                  quit

                  changed to ./HomeSeer

                  sudo mono /HomeSeer/HSConsole.exe --log

                  WORKED!!!!

                  Why does this matter for your plugin and not others? Any idea? Should you change to a file path relative to /HomeSeer rather than an absolute path that is derived from where the HSConsole / Mono commands will be run from?

                  I will try changing the startup script on my docker container to CD into the HomeSeer dir?

                  (I have opened issue with the docker container maintainer here https://github.com/marthoc/docker-homeseer/issues/11 too)
                  Last edited by scyto; June 24th, 2018, 02:46 PM.

                  Comment

                  Working...
                  X