Skip to content
This repository has been archived by the owner on Jan 22, 2021. It is now read-only.

Template file could not be read on modulus #62

Open
vjain20 opened this issue Apr 24, 2016 · 7 comments
Open

Template file could not be read on modulus #62

vjain20 opened this issue Apr 24, 2016 · 7 comments

Comments

@vjain20
Copy link

vjain20 commented Apr 24, 2016

Hi,

I am using lookback:meteor-emails package and it works fine on my laptop, but it throws an error when I try to deploy my project to modulus.io. In the Template , i just use the name of the file as path (welcome.html). But I am always getting a "Could not read template file" error . Following is the log:

> [email protected] start /mnt/app/bundle/programs/server
> node ../../main

Could not read template file: /mnt/app/programs/server/assets/app/welcome.html mailer
Inside create user
email addreess = [email protected]
Sending Welcome Email
Could not render email before sending: Can't render undefined mailer
Now using node v0.10.41 (npm v3.8.7)
Found package.json: ./bundle/programs/server/package.json
Running command: npm start

> [email protected] start /mnt/app/bundle/programs/server
> node ../../main

Could not read template file: private/welcome.html mailer
Now using node v0.10.41 (npm v3.8.7)
Found package.json: ./bundle/programs/server/package.json
Running command: npm start

> [email protected] start /mnt/app/bundle/programs/server
> node ../../main

Could not read template file: welcome.html mailer
Now using node v0.10.41 (npm v3.8.7)
Found package.json: ./bundle/programs/server/package.json
Running command: npm start

> [email protected] start /mnt/app/bundle/programs/server
> node ../../main

Could not read template file: welcome.html mailer
@johanbrook
Copy link
Contributor

Hm, I wonder if this is related to XervoIO/docker-build-meteor#14 and thus fixed by #61.

Are you able to try the solution in #61 ?

@vjain20
Copy link
Author

vjain20 commented Apr 25, 2016

@johanbrook - Thanks for responding.
I tried setting APP_DIR /mnt/app/bundle. However, the error still persists. It seems like multiple paths
were tried but none of them is working.
I am pasting the log below:


Now using node v0.10.41 (npm v3.8.6)
Found package.json: ./bundle/programs/server/package.json
Running command: npm start

> [email protected] start /mnt/app/bundle/programs/server
> node ../../main

Now using node v0.10.41 (npm v3.8.6)
Found package.json: ./bundle/programs/server/package.json
Running command: npm start

> [email protected] start /mnt/app/bundle/programs/server
> node ../../main

> [email protected] start /mnt/app/bundle/programs/server
> node ../../main

Inside create user
Now using node v0.10.41 (npm v3.8.6)
Found package.json: ./bundle/programs/server/package.json
Running command: npm start

> [email protected] start /mnt/app/bundle/programs/server
> node ../../main

Now using node v0.10.41 (npm v3.8.7)
Found package.json: ./bundle/programs/server/package.json
Running command: npm start

> [email protected] start /mnt/app/bundle/programs/server
> node ../../main

Could not read template file: welcome.html mailer
Inside create user
email addreess = [email protected]
Sending Welcome Email
Could not render email before sending: Can't render undefined mailer
Now using node v0.10.41 (npm v3.8.7)
Found package.json: ./bundle/programs/server/package.json
Running command: npm start

> [email protected] start /mnt/app/bundle/programs/server
> node ../../main

Could not read template file: /mnt/appwelcome.html mailer
Inside create user
email addreess = [email protected]
Sending Welcome Email
Could not render email before sending: Can't render undefined mailer
Now using node v0.10.41 (npm v3.8.7)
Found package.json: ./bundle/programs/server/package.json
Running command: npm start

> [email protected] start /mnt/app/bundle/programs/server
> node ../../main

Could not read template file: /mnt/app/private/welcome.html mailer
Now using node v0.10.41 (npm v3.8.7)
Found package.json: ./bundle/programs/server/package.json
Running command: npm start

> [email protected] start /mnt/app/bundle/programs/server
> node ../../main

Could not read template file: /mnt/app/techshare/private/welcome.html mailer
Now using node v0.10.41 (npm v3.8.7)
Found package.json: ./bundle/programs/server/package.json
Running command: npm start

> [email protected] start /mnt/app/bundle/programs/server
> node ../../main

Could not read template file: /mnt/app/bundle/private/welcome.html mailer
Now using node v0.10.41 (npm v3.8.7)
Found package.json: ./bundle/programs/server/package.json
Running command: npm start

> [email protected] start /mnt/app/bundle/programs/server
> node ../../main

Could not read template file: /mnt/app/bundle/programs/private/welcome.html mailer
Now using node v0.10.41 (npm v3.8.7)
Found package.json: ./bundle/programs/server/package.json
Running command: npm start

> [email protected] start /mnt/app/bundle/programs/server
> node ../../main

Could not read template file: /mnt/app/bundle/welcome.html mailer
Now using node v0.10.41 (npm v3.8.7)
Found package.json: ./bundle/programs/server/package.json
Running command: npm start

> [email protected] start /mnt/app/bundle/programs/server
> node ../../main

Could not read template file: /mnt/app/bundle/welcome.html mailer
Now using node v0.10.41 (npm v3.8.7)
Found package.json: ./bundle/programs/server/package.json
Running command: npm start

> [email protected] start /mnt/app/bundle/programs/server
> node ../../main

Could not read template file: /mnt/app/programs/server/assets/app/welcome.html mailer
Inside create user
email addreess = [email protected]
Sending Welcome Email
Could not render email before sending: Can't render undefined mailer
Now using node v0.10.41 (npm v3.8.7)
Found package.json: ./bundle/programs/server/package.json
Running command: npm start

> [email protected] start /mnt/app/bundle/programs/server
> node ../../main

Could not read template file: /mnt/app/bundle/programs/server/assets/app/welcome.html mailer
Now using node v0.10.41 (npm v3.8.7)
Found package.json: ./bundle/programs/server/package.json
Running command: npm start

> [email protected] start /mnt/app/bundle/programs/server
> node ../../main

Could not read template file: /mnt/app/bundle/programs/server/assets/app/welcome.html mailer
Now using node v0.10.41 (npm v3.8.7)
Found package.json: ./bundle/programs/server/package.json
Running command: npm start

> [email protected] start /mnt/app/bundle/programs/server
> node ../../main

Could not read template file: /mnt/app/bundle/programs/server/assets/app/private/welcome.html mailer
Now using node v0.10.41 (npm v3.8.7)
Found package.json: ./bundle/programs/server/package.json
Running command: npm start

> [email protected] start /mnt/app/bundle/programs/server
> node ../../main

Could not read template file: /mnt/app/programs/server/assets/app/private/welcome.html mailer
Now using node v0.10.41 (npm v3.8.7)
Found package.json: ./bundle/programs/server/package.json
Running command: npm start

> [email protected] start /mnt/app/bundle/programs/server
> node ../../main

Could not read template file: /mnt/app/programs/server/assets/app/private/welcome.html mailer
Now using node v0.10.41 (npm v3.8.7)
Found package.json: ./bundle/programs/server/package.json
Running command: npm start

> [email protected] start /mnt/app/bundle/programs/server
> node ../../main

Could not read template file: /mnt/app/programs/server/assets/app/welcome.html mailer
Inside create user
email addreess = [email protected]
Sending Welcome Email
Could not render email before sending: Can't render undefined mailer
Now using node v0.10.41 (npm v3.8.7)
Found package.json: ./bundle/programs/server/package.json
Running command: npm start

> [email protected] start /mnt/app/bundle/programs/server
> node ../../main

Could not read template file: private/welcome.html mailer
Now using node v0.10.41 (npm v3.8.7)
Found package.json: ./bundle/programs/server/package.json
Running command: npm start

> [email protected] start /mnt/app/bundle/programs/server
> node ../../main

Could not read template file: welcome.html mailer
Now using node v0.10.41 (npm v3.8.7)
Found package.json: ./bundle/programs/server/package.json
Running command: npm start

> [email protected] start /mnt/app/bundle/programs/server
> node ../../main

Could not read template file: welcome.html mailer
Now using node v0.10.41 (npm v3.8.7)
Found package.json: ./bundle/programs/server/package.json
Running command: npm start

> [email protected] start /mnt/app/bundle/programs/server
> node ../../main

Could not read template file: welcome.html mailer


@johanbrook
Copy link
Contributor

Hm, I see two different logs here:

Could not read template file: /mnt/app/programs/server/assets/app/welcome.html

and

Could not read template file: welcome.html

That's kinda weird. There's always the full path that's being logged when there's an error. Did you set the APP_DIR correctly?

@vjain20
Copy link
Author

vjain20 commented Apr 25, 2016

In Mailer.js, I see the following:

Utils.Logger.error(Could not read template file: ${template.path}, TAG);

Looks like this should log only 'template.path' which is just the file name.
I have set the APP_DIR to /mail/app/bundle
By default it is /mail/app. Not sure if I did it right.

On Mon, Apr 25, 2016 at 2:25 AM, Johan Brook [email protected]
wrote:

Hm, I see two different logs here:

Could not read template file: /mnt/app/programs/server/assets/app/welcome.html

and

Could not read template file: welcome.html

That's kinda weird. There's always the full path that's being logged when
there's an error. Did you set the APP_DIR correctly?


You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub
#62 (comment)

Thanks
Vaibhav Jain

@vjain20
Copy link
Author

vjain20 commented Apr 26, 2016

Update: The previous log that I posted was not correct. I re-dployed and restarted the app.
This is the log that I get now:


Now using node v0.10.41 (npm v3.8.6)
Found package.json: ./bundle/programs/server/package.json
Running command: npm start

> [email protected] start /mnt/app/bundle/programs/server
> node ../../main
Could not read template file: welcome.html mailer

I tried changing APP_DIR to /mnt/app/bundle in code by setting process.env.APP_DIR just before
Mailer.init. But that did't help and I get the same log as above.


 process.env.APP_DIR = '/mnt/app/bundle';
 Mailer.init({
        templates: Templates,     // Global Templates namespace, see lib/templates.js.
        helpers: TemplateHelpers, // Global template helper namespace.
        layout: {
            name: 'emailLayout',
            path: 'layout.html'  // Relative to 'private' dir.
        }
    });



@bsbechtel
Copy link

I don't know if our issue is related, but we are seeing a similar error, but with a deploy to Meteor's Galaxy servers. One interesting thing we saw was that if we changed the name of the missing template file, the error switched to a different template file in our /private directory. This tells me it is something related to the load order of our templates, but I am struggling to identify the issue.

@bsbechtel
Copy link

@vjain20 I was able to figure out the root cause of our issue...we had two email templates that had the exact same html contents. When they compiled, meteor got confused as to which template mapped to which html. Not sure if this is your issue as well, but you might want to check that :)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

3 participants