Search code examples
node.jsroutesexpressdotcloud

Missing javascript file, expressJS on dotcloud "failed to load resource." Routing issue?


I deployed an express app to dotcloud, and I get an error here: http://valgomat-nilsnh.dotcloud.com/valgomat . All my other javascript files included in the html seem to get loaded except questiondata.js.

In the chromium console it says,

GET http://valgomat-nilsnh.dotcloud.com/javascripts/questiondata.js 404 (Not Found)

What might be the problem here? Yes, I've tried to check & re-check all my paths and such. The file gets included when I run this locally, but when uploaded I'm missing that file.

After looking around at other questions somewhat related, I suspect there might be an issue with express's routing? Though, other resources seem to get loaded nicely.

From the logs:

$ dotcloud logs valgomat.www

tail -F /var/log/supervisor/*.log

==> /var/log/supervisor/node-stderr---supervisor-rGnBOT.log <== buf.push(''); __jade.shift(); __jade.shift();
__jade.shift(); buf.push(''); __jade.shift(); __jade.shift(); buf.push(''); __jade.shift(); __jade.shift();

==> /var/log/supervisor/node-stdout---supervisor-MkuIsc.log <== GET /stylesheets/bootstrap/css/bootstrap.min.css 304 3ms GET /stylesheets/style.css 304 3ms GET /images/logo-uib-small.gif 200 2ms - 4.49kb GET /valgomat 304 19ms GET /stylesheets/bootstrap/css/bootstrap.min.css 304 4ms GET /stylesheets/style.css 304 2ms GET /javascripts/jquery-1.8.0.min.js 304 1ms debug: served static content /socket.io.js GET /javascripts/coffee-script.js 304 1ms GET /javascripts/questiondata.js 404 2ms

==> /var/log/supervisor/supervisord.log <== 2012-08-25 09:39:23,281 WARN Included extra file "/home/dotcloud/current/supervisord.conf" during parsing 2012-08-25 09:39:23,373 INFO RPC interface 'supervisor' initialized 2012-08-25 09:39:23,373 WARN cElementTree not installed, using slower XML parser for XML-RPC 2012-08-25 09:39:23,373 CRIT Server 'unix_http_server' running without any HTTP authentication checking 2012-08-25 09:39:23,378 INFO daemonizing the supervisord process 2012-08-25 09:39:23,379 INFO supervisord started with pid 140 2012-08-25 09:39:24,388 INFO spawned: 'node' with pid 147 2012-08-25 09:39:26,148 INFO success: node entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)

Hope someone can help.

Cheers, Nils


Solution

  • "Random file is missing when I push to dotCloud" generally rhymes with "I'm coding from a git or hg repository and I forgot to add/commit said random file".

    First thing: check what uploader is used when you push to dotCloud. At the very beginning of the dotcloud push output, you will see something like # hg, # git, or #rsync. If you see hg or git, then, double-check that questiondata.js is indeed in your repository. If it is not, you can add it, or, alternatively, if you do not want to create a commit each time you want to push a little difference to dotCloud, you can add the --all flag to the dotcloud push command: it will force the use of the rsync uploader.