Tasmoadmin: could not read MyConfig.json in read

Created on 31 Aug 2018  ·  20Comments  ·  Source: reloxx13/TasmoAdmin

after following the wiki guide for installing son-web and later tasmoadmin on my R-pi-ZeroW sbc its been a great and very useful tool.

However on opening the start page yesterday all i was presented with was:
array(3) { [0]=> array(7) { ["file"]=> string(50) "/var/www/tasmoadmin/tasmoadmin/includes/Config.php" ["line"]=> int(138) ["function"]=> string(4) "read" ["class"]=> string(6) "Config" ["object"]=> object(Config)#1 (4) { ["debug":"Config":private]=> bool(false) ["cfgFile":"Config":private]=> string(49) "/var/www/tasmoadmin/tasmoadmin/data/MyConfig.json" ["cfgFile140":"Config":private]=> string(48) "/var/www/tasmoadmin/tasmoadmin/data/MyConfig.php" ["defaultConfigs":"Config":private]=> array(14) { ["ota_server_ip"]=> string(0) "" ["ota_server_port"]=> string(0) "" ["username"]=> string(0) "" ["password"]=> string(0) "" ["refreshtime"]=> string(1) "5" ["current_git_tag"]=> string(0) "" ["update_automatic_lang"]=> string(0) "" ["nightmode"]=> string(4) "auto" ["login"]=> string(1) "1" ["scan_from_ip"]=> string(13) "192.168.178.2" ["scan_to_ip"]=> string(15) "192.168.178.254" ["homepage"]=> string(5) "start" ["check_for_updates"]=> string(1) "1" ["minimize_resources"]=> string(1) "1" } } ["type"]=> string(2) "->" ["args"]=> array(2) { [0]=> string(13) "ota_server_ip" [1]=> bool(true) } } [1]=> array(7) { ["file"]=> string(47) "/var/www/tasmoadmin/tasmoadmin/includes/top.php" ["line"]=> int(105) ["function"]=> string(11) "__construct" ["class"]=> string(6) "Config" ["object"]=> object(Config)#1 (4) { ["debug":"Config":private]=> bool(false) ["cfgFile":"Config":private]=> string(49) "/var/www/tasmoadmin/tasmoadmin/data/MyConfig.json" ["cfgFile140":"Config":private]=> string(48) "/var/www/tasmoadmin/tasmoadmin/data/MyConfig.php" ["defaultConfigs":"Config":private]=> array(14) { ["ota_server_ip"]=> string(0) "" ["ota_server_port"]=> string(0) "" ["username"]=> string(0) "" ["password"]=> string(0) "" ["refreshtime"]=> string(1) "5" ["current_git_tag"]=> string(0) "" ["update_automatic_lang"]=> string(0) "" ["nightmode"]=> string(4) "auto" ["login"]=> string(1) "1" ["scan_from_ip"]=> string(13) "192.168.178.2" ["scan_to_ip"]=> string(15) "192.168.178.254" ["homepage"]=> string(5) "start" ["check_for_updates"]=> string(1) "1" ["minimize_resources"]=> string(1) "1" } } ["type"]=> string(2) "->" ["args"]=> array(0) { } } [2]=> array(4) { ["file"]=> string(40) "/var/www/tasmoadmin/tasmoadmin/index.php" ["line"]=> int(5) ["args"]=> array(1) { [0]=> string(47) "/var/www/tasmoadmin/tasmoadmin/includes/top.php" } ["function"]=> string(12) "include_once" } } could not read MyConfig.json in read

Not understanding what was going on i took the sledge hammer approach and deleted the tasmoadmin directory and re-cloned it from github and changed ownership etc, after a reboot Tasmoadmin was back and empty so i scanned again and everything was found ok.

However this morning when i look and see the page is no more and the above text is all i get dispalyed?

where should myconfig.json live and how can i replace it?

BUG INVESTIGATE

All 20 comments

I have the same problem but i'm using HASSIO and the TasmoAdmin addon.
I tried removing and reinstalling the docker image, but it does not work nearly all the times.
This is what i posted as issue in the hassio-addon/tasmoadmin github, but the guy told me i had to go upstream here.


Problem/Motivation
TasmoAdmin doesnt work anymore

Expected behavior
Open the web page, but it des not

Actual behavior
returns a "could not read MyConfig.json"

Steps to reproduce
Almost everytime i restart the docker image in hassio, it boots. When i open the UI i get only a "could not read MyConfig.json"

Proposed changes
Nope, tried removing it from hassio e reinstalling, but it alwasy (almost) gives the same error. Some times it works, but very slowly.

found MyConfig.json or the empty file in /var/www/tasmoadmin/tasmoadmin/data, yes its happened AGAIN!! and had not backed up the file !!!

This time after discovering all the devices currently turned on after a lost MyConfig.json and reload, i backed up the file, and then replaced it with an empty file to recreate the problem, restoring the file, and ensuring the same permissions were set revived tasmoadmin, So Make a backup of MyConfig.json regularly, daily perhaps..

heya,

thanks for reporting, i added some more debugs and error catching in next version.

no trouble , am lurvin the software, had another whoopsie this evening
posted it too..

On Tue, 4 Sep 2018 at 01:05, reloxx13 notifications@github.com wrote:

heya,

thanks for reporting, i added some more debugs and error catching in next
version.


You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub
https://github.com/reloxx13/TasmoAdmin/issues/207#issuecomment-418207731,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AMo5__eHQl-oBTNTnHblQLC9PcmmQiRiks5uXcPHgaJpZM4WU2Nm
.

any date for the next release? I cant use TasmoAdmin at all since this problem started

Same problem here.
MyConfig.json has 0 bytes(?)

Page content (source):

  | array(3) {
-- | --
  | [0]=>
  | array(7) {
  | ["file"]=>
  | string(50) "/var/www/tasmoadmin/tasmoadmin/includes/Config.php"
  | ["line"]=>
  | int(150)
  | ["function"]=>
  | string(4) "read"
  | ["class"]=>
  | string(6) "Config"
  | ["object"]=>
  | object(Config)#1 (4) {
  | ["debug":"Config":private]=>
  | bool(false)
  | ["cfgFile":"Config":private]=>
  | string(49) "/var/www/tasmoadmin/tasmoadmin/data/MyConfig.json"
  | ["cfgFile140":"Config":private]=>
  | string(48) "/var/www/tasmoadmin/tasmoadmin/data/MyConfig.php"
  | ["defaultConfigs":"Config":private]=>
  | array(15) {
  | ["ota_server_ssl"]=>
  | string(1) "0"
  | ["ota_server_ip"]=>
  | string(0) ""
  | ["ota_server_port"]=>
  | string(0) ""
  | ["username"]=>
  | string(0) ""
  | ["password"]=>
  | string(0) ""
  | ["refreshtime"]=>
  | string(1) "8"
  | ["current_git_tag"]=>
  | string(0) ""
  | ["update_automatic_lang"]=>
  | string(2) "EN"
  | ["nightmode"]=>
  | string(4) "auto"
  | ["login"]=>
  | string(1) "1"
  | ["scan_from_ip"]=>
  | string(13) "192.168.178.2"
  | ["scan_to_ip"]=>
  | string(15) "192.168.178.254"
  | ["homepage"]=>
  | string(5) "start"
  | ["check_for_updates"]=>
  | string(1) "1"
  | ["minimize_resources"]=>
  | string(1) "1"
  | }
  | }
  | ["type"]=>
  | string(2) "->"
  | ["args"]=>
  | array(2) {
  | [0]=>
  | string(14) "ota_server_ssl"
  | [1]=>
  | bool(true)
  | }
  | }
  | [1]=>
  | array(7) {
  | ["file"]=>
  | string(47) "/var/www/tasmoadmin/tasmoadmin/includes/top.php"
  | ["line"]=>
  | int(105)
  | ["function"]=>
  | string(11) "__construct"
  | ["class"]=>
  | string(6) "Config"
  | ["object"]=>
  | object(Config)#1 (4) {
  | ["debug":"Config":private]=>
  | bool(false)
  | ["cfgFile":"Config":private]=>
  | string(49) "/var/www/tasmoadmin/tasmoadmin/data/MyConfig.json"
  | ["cfgFile140":"Config":private]=>
  | string(48) "/var/www/tasmoadmin/tasmoadmin/data/MyConfig.php"
  | ["defaultConfigs":"Config":private]=>
  | array(15) {
  | ["ota_server_ssl"]=>
  | string(1) "0"
  | ["ota_server_ip"]=>
  | string(0) ""
  | ["ota_server_port"]=>
  | string(0) ""
  | ["username"]=>
  | string(0) ""
  | ["password"]=>
  | string(0) ""
  | ["refreshtime"]=>
  | string(1) "8"
  | ["current_git_tag"]=>
  | string(0) ""
  | ["update_automatic_lang"]=>
  | string(2) "EN"
  | ["nightmode"]=>
  | string(4) "auto"
  | ["login"]=>
  | string(1) "1"
  | ["scan_from_ip"]=>
  | string(13) "192.168.178.2"
  | ["scan_to_ip"]=>
  | string(15) "192.168.178.254"
  | ["homepage"]=>
  | string(5) "start"
  | ["check_for_updates"]=>
  | string(1) "1"
  | ["minimize_resources"]=>
  | string(1) "1"
  | }
  | }
  | ["type"]=>
  | string(2) "->"
  | ["args"]=>
  | array(0) {
  | }
  | }
  | [2]=>
  | array(4) {
  | ["file"]=>
  | string(40) "/var/www/tasmoadmin/tasmoadmin/index.php"
  | ["line"]=>
  | int(4)
  | ["args"]=>
  | array(1) {
  | [0]=>
  | string(47) "/var/www/tasmoadmin/tasmoadmin/includes/top.php"
  | }
  | ["function"]=>
  | string(12) "include_once"
  | }
  | }
  | could not read MyConfig.json in read

config folders:

$ ll -R /var/www/tasmoadmin/tasmoadmin/data/
/var/www/tasmoadmin/tasmoadmin/data/:
insgesamt 24
drwxrwxrwx  4 www-data www-data 4096 Sep 16 20:07 ./
drwxr-xr-x 10 www-data www-data 4096 Sep 15 00:07 ../
-rw-------  1 www-data www-data   80 Sep 16 20:08 devices.csv
drwxr-xr-x  2 www-data www-data 4096 Sep 15 00:07 firmwares/
-rw-r--r--  1 www-data www-data   80 Sep 15 00:07 .htaccess
-rw-r--r--  1 www-data www-data    0 Sep 18 00:43 MyConfig.json
drwxr-xr-x  2 www-data www-data 4096 Sep 15 00:07 updates/

/var/www/tasmoadmin/tasmoadmin/data/firmwares:
insgesamt 12
drwxr-xr-x 2 www-data www-data 4096 Sep 15 00:07 ./
drwxrwxrwx 4 www-data www-data 4096 Sep 16 20:07 ../
-rw-r--r-- 1 www-data www-data    0 Sep 15 00:07 .empty
-rw-r--r-- 1 www-data www-data   11 Sep 15 00:07 .htaccess

/var/www/tasmoadmin/tasmoadmin/data/updates:
insgesamt 8
drwxr-xr-x 2 www-data www-data 4096 Sep 15 00:07 ./
drwxrwxrwx 4 www-data www-data 4096 Sep 16 20:07 ../
-rw-r--r-- 1 www-data www-data    0 Sep 15 00:07 .empty

$ ll -R /var/www/tasmoadmin/tasmoadmin/tmp/
/var/www/tasmoadmin/tasmoadmin/tmp/:
insgesamt 16
drwxrwxrwx  4 www-data www-data 4096 Sep 16 20:07 ./
drwxr-xr-x 10 www-data www-data 4096 Sep 15 00:07 ../
drwxr-xr-x  3 www-data www-data 4096 Sep 15 00:07 cache/
drwxr-xr-x  2 www-data www-data 4096 Sep 15 00:16 sessions/

/var/www/tasmoadmin/tasmoadmin/tmp/cache:
insgesamt 12
drwxr-xr-x 3 www-data www-data 4096 Sep 15 00:07 ./
drwxrwxrwx 4 www-data www-data 4096 Sep 16 20:07 ../
drwxr-xr-x 2 www-data www-data 4096 Sep 15 00:16 i18n/

/var/www/tasmoadmin/tasmoadmin/tmp/cache/i18n:
insgesamt 56
drwxr-xr-x 2 www-data www-data  4096 Sep 15 00:16 ./
drwxr-xr-x 3 www-data www-data  4096 Sep 15 00:07 ../
-rw-r--r-- 1 www-data www-data     0 Sep 15 00:07 .empty
-rwxr-xr-x 1 www-data www-data 18784 Sep 15 00:16 json_i18n_de.cache.json*
-rwxr-xr-x 1 www-data www-data 26084 Sep 15 00:16 php_i18n_86956f044040a97669be02b47ba99b4d___L_de.cache.php*

/var/www/tasmoadmin/tasmoadmin/tmp/sessions:
insgesamt 12
drwxr-xr-x 2 www-data www-data 4096 Sep 15 00:16 ./
drwxrwxrwx 4 www-data www-data 4096 Sep 16 20:07 ../
-rw-r--r-- 1 www-data www-data    0 Sep 15 00:07 .empty
-rw------- 1 www-data www-data  427 Sep 18 21:30 sess_3k4asvirmmnglsdadvn9npjjnk

my 2cents:
last time my MyConfig.json was empty, i was having a full HDD...

Hi l<=you& you+°|

⁣Sent from TypeApp ​

On 10 Oct 2018, 16:27, at 16:27, raTmole notifications@github.com wrote:

my 2cents:
last time my MyConfig.json was empty, i was having a full HDD...

--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/reloxx13/TasmoAdmin/issues/207#issuecomment-428483622

I have same problem. few days ago installed, everything working fine.
Next morning confronted with the array dump as above.
removed the MyConfig.json file. and interface start working again.
today i got the error again.
So it's looks like on some process is writing a empty MyConfig.json file.
Please have a look.

I have same problem. few days ago installed, everything working fine.
Next morning confronted with the array dump as above.
removed the MyConfig.json file. and interface start working again.
today i got the error again.
So it's looks like on some process is writing a empty MyConfig.json file.

Same. I did an uninstall, cleared any trace of TasmoAdmin, reinstalled, and it was working.
The day after, even without any reboot of the raspberry, i got de MyConfig.json empry arror again

Any news? I have the same error.

could not read MyConfig.json

I am running Fedora 29, nginx and php-fpm 7.2
What should be in this file? What permissions should it have?
How to repair it? When I delete this file (MyConfig.json) it is created again when I refresh the page. But has 0 bytes, it's empty!

Ok, solved.
First of all check if you have installed php-json.
Second of all delete MyConfig.json if exists and empty
Third of all refresh the webpage.

This has just happened to my Hass.io system after months of faultless operation.
How do I get access to the Hass.io file system to delete the empty MyConfig.json file?

Same here... could not read MyConfig.json

Same here... could not read MyConfig.json. I don't access very often so I don't know when it went bad, currently running Home Assistant 0.104.1. I have tried it on various browsers and devices, and have even tried to shutdown and restart, still no joy. Where is file in Hassio?

Happened to me again today in Hassio. Simplest fix is to uninstall TasmoAdmin, re-install immediately then rescan devices. Back up and running in 15 minutes! Still it’s a pain.

This just happened to me. I was in the process of doing a new autoscan when it seems the process went rogue and deleted the MyConfig.json. I'm using the hassio addon as well.

Check if your php json were enabled:
check $ php -m
if you don't see json on the list, edit your php.ini or *curl.ini at /etc/php/7.2/cli/conf.d (check your php version mine is 7.2)
insert extension=json.so at the end of the file.
Delete /var/www/tasmoadmin/tasmoadmin/data/MyConfig.json
Then restart apache2
Then try accessing your server on the browser

Same here (probably after HA 108 update ?).
Just restore tasmoadmin in my last snapshot, and everything come back.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

gabrielboliveira picture gabrielboliveira  ·  3Comments

eeprom23 picture eeprom23  ·  5Comments

eeprom23 picture eeprom23  ·  3Comments

riddik14 picture riddik14  ·  3Comments

arendst picture arendst  ·  8Comments