Community
OpenEnergyMonitor

Community

Feed create error on shared host

(Fubax) #1

Hi guys.
Excuse me for my English.
I have installed emoncms on my shared host.
Everything is OK and i can send my data to it But when I wish to create feed get this error:
ERROR: Feed could not be created,could not write meta data file fopen(/proud116/emoncmsdata/phpfina/10.meta) failed to open stream: No such file or directory

In the setting file I’ve added this three lines:

'phpfiwa'=>array(
            'datadir' => '/proud116/emoncmsdata/phpfiwa/'
        ),
        'phpfina'=>array(
            'datadir' => '/proud116/emoncmsdata/phpfina/'
        ),
        'phptimeseries'=>array(
            'datadir' => '/proud116/emoncmsdata/phptimeseries/'
        )

phpfiwa,phpfina and phptimeseries have 755 write access.
Please HELP

(Eric Wouters) #2

most probably the path isn’t complete
I think you need to set

/home/proud116/emoncmsdata/php…/

2 Likes
(Fubax) #3

Thank you bro.
It works :grinning:

1 Like
(Bjarni) #4

3 years later… I am having the same problem, but adding home or root in front of the path does not help, I set the access for the three folders to 777 any suggestion?

(Brian Orpin) #5

Navigate to the folder where the data is to be stored and do a

pwd

This will tell you the true path.

1 Like
(Bjarni) #6

sorry I am totally newbie to this world… how should I do pwd? there is no command line… the screenshot is taken when in one of the folders

(Brian Orpin) #7

How have you installed this?

How do you edit the settings file? Via FTP? Is this shared/virtual hosting?

[edit]
image

From this image you can see the path should start as /root/fja etc.

(Bjarni) #8

yes shared hosting, /root/fjarvoktun/emoncmsdata/php… works :slight_smile: I must have forgotten a backslash or something before because now it gets me a step closer and does not give me the “no such file or directory” error now… but now it gives me another kind of error,
If I choose PHPFIWA or PHPFINA Fixed Interval then I get “ERROR: Feed could not be created, undefined”
but if I choose PHPTIMESERIES I get “ERROR: Feed could not be created, could not write data file fopen(/root/fjarvoktun/emoncmsdata/phptimeseries/feed_104.MYD): failed to open stream: Operation not permitted”

(Brian Orpin) #9

That is a file permission error. Not sure how to fix that on a shared hosting environment.

1 Like
(Paul) #10

Feeds can be located anywhere emoncms has permission to write to. You need to move your feed folders to a better location depending on your folder/site setup, and then just edit the paths in settings.php to suit.

2 Likes
(Bjarni) #11

OK, the folders all have Chmod value 777 (full permision) what is it that could restrict emoncms permission to write to these folders? (sorry I am pretty lost in this)

(Paul) #12

Shared hosting often has quirks that mean your web application only has access to certain folders, not to the whole root folder plus all sub-folders, this is to protect your data from accidental access.

Somewhere in your shard-hosting docs this will be explained further.

I cannot guess what your hosting supplier might allow/restrict and it’s been a very long time since I used any shared hosting space so I can’t tell you where to put them exactly, sorry.

[edit]

I assume you’ve seen this page in the docs

although quite dated now, I think it’s generally still valid. “public_html” tends to be (was?) freely accessible by web apps on most shared hosting.

(Bjarni) #13

thanks alot for trying to help! yes these are the instructions I have been following. But If I choose PHPFIWA or PHPFINA Fixed Interval when trying to create a feed then I get “ERROR: Feed could not be created, undefined”do you think that error is also because of emoncms not having write permission? don’t understand why I get different error for PHPFIWA or PHPFINA Fixed Interval and PHPTIMESERIES… p.s. I have tried to move the folders to the same folder as emoncms but with no luck, also tried to move it to the root, but also no luck

(Paul) #14

Are you saying you can now use phptimeseries ok? Or are they both still not working? The wording of the error message may just be different, or they maybe hitting different issues because they are different feed engines. If one works without issue it does mean you have the right location, permissions and settings path for that feed folder, if they are setup to be the same they should then both work, if they are the same but only one works, then yes there is another problem.

(Bjarni) #15

nope neither of them work, just give two different error messages :confused:

(Bill Thomson) #17

/root/fjarvoktun/emoncmsdata/phptimeseries/feed_104.MYD

For future reference, and hopefully, to avoid some confusion for other users reading this thread…

The /root directory is the root user’s “home” directory,
which is not the same thing as the / directory which is the filesystem root directory.

1 Like
(Bjarni) #18

found a suggestion to change the directories in these three files (red underscore) to the same as in settings.php


it worked for that guy, but does not make any difference for me :confused:

(here is the link… https://openenergymonitor.org/forum-archive/node/6318.html )

(Paul) #19

I wouldn’t read too much into that post you linked, I would have been more surprised if it had worked, it suggests emoncms is unable to read it’s own settings.php file which cannot be true, emoncms would not run if it couldn’t load other settings from that same file.

You haven’t told us the hosting supplier or anything about your setup, we cannot help you to configure the unknown. If the folders are in an accessible location and the path matches, I’m confident it would work.

The path and the location must match, whether it’s a absolute path from a specific “root” folder (root of server, root of filesytem, root of website, root of user account we do not know) or perhaps try a relative path? I do not know if it will definately work, but the use of $log_filename = dirname(__FILE__).'/' . 'emoncms.log'; in the shared hosting guide might suggest it could work.

As a test, try putting the data folder inside the emoncms folder and use

        'phpfina'=>array(
            'datadir' => dirname(__FILE__).'/data/phpfina/'
        ),
        'phptimeseries'=>array(
            'datadir' => dirname(__FILE__).'/data/phptimeseries/'
        ),

hopefully this might remove the unknown part of the path as it should get the absolute path for the emoncms folder to which you are just adding the last levels. Not sure this will 100% work, but worth a try. The problem here is that the emoncms folder doesn’t really need to be in a location with write access to function, only the datadir’s need write access, so we still do not know if it’s the right location, we are just trying to see if the path might work, it not working doesn’t mean it wouldn’t work in another location unfortunately.

[edit]
Actually, does your emoncms.log file exist? Is that being written to? If it is, then emoncms does have write permission to that location, try putting the datadir’s there until you fathom out the correct datadir path sysntax, then you can move them armed with knowing the correct path/syntax to be amended to the new location as needed.

1 Like
(Bjarni) #20

THAT WAS IT!! :smile:
thanks alot! you really saved my mental health for some days!
maybe you edit your last reply just if anybody else runs into this problem and reads this post. there is one extra ’ in front of dirname(

it should be

   'phpfina'=>array(
            'datadir' => dirname(__FILE__).'/data/phpfina/'
        ),

but not

   'phpfina'=>array(
            'datadir' => 'dirname(__FILE__).'/data/phpfina/'
        ),

(atleast it did not work for me until I figured out this extra “comma” :slight_smile:

(Bill Thomson) #21

Your “comma” is actually a quotation mark.
(specifically, a single quotation mark, as opposed to the " character,
often called a double quottation mark)

Side-by-side for comparison. Comma first, then quote mark ,'
(I made them them bold to make them a bit easier to see)