So i create a default meteor app.
Its runs great.
Now I add a simple insert in the startup function.
its is now giving me exceptions.
Here is my app.js code:
Book = new Meteor.Collection("book");
if (Meteor.isClient) {
Template.hello.greeting = function () {
return "Welcome to app_01.";
};
Template.hello.events({
'click input' : function () {
// template data, if any, is available in 'this'
if (typeof console !== 'undefined')
console.log("You pressed the button");
}
});
}
if (Meteor.isServer) {
Meteor.startup(function () {
if (Book.find().count() === 0) {
var names = ["Ada Lovelace",
"Grace Hopper",
"Marie Curie",
"Carl Friedrich Gauss",
"Nikola Tesla",
"Claude Shannon"];
for (var i = 0; i < names.length; i++)
Book.insert({name: names[i], score: Math.floor(Math.random()*10)*5});
}
});
}
And here is the exception I am getting:
No dependency info in bundle. Filesystem monitoring disabled.
Errors prevented startup:
Exception while bundling application:
Error: ENOTEMPTY, directory not empty 'C:\Users\Office\Workspace\Code\Meteor\app_01\.meteor\local\build\server'
at Object.fs.rmdirSync (fs.js:456:18)
at Object.module.exports.rm_recursive (C:\Program Files (x86)\Meteor\app\lib\files.js:256:10)
at C:\Program Files (x86)\Meteor\app\lib\files.js:254:15
at Array.forEach (native)
at Function._.each._.forEach (C:\Program Files (x86)\Meteor\lib\node_modules\underscore\underscore.js:79:11)
at Object.module.exports.rm_recursive (C:\Program Files (x86)\Meteor\app\lib\files.js:252:9)
at _.extend.write_to_directory (C:\Program Files (x86)\Meteor\app\lib\bundler.js:493:11)
at Object.exports.bundle (C:\Program Files (x86)\Meteor\app\lib\bundler.js:685:12)
at exports.run.restart_server (C:\Program Files (x86)\Meteor\app\meteor\run.js:615:26)
at C:\Program Files (x86)\Meteor\app\meteor\run.js:726:9
Please fix the problem and restart.
The console gives me no useful information at all.
Some more info:
I am using the windows version of meteor 0.5.4
My code has both tabs and spaces as indentation (should that be a problem?)
to add to my perplexity:
If i run the leaderboard example, it runs perfectly.
When I run the default project with my modified startup code, i get the exception. >.<
More info:
when the server crashed, the mongod service was still running in windows. In my infinite wisdom, i thought I'll kill it and maybe try a fresh restart of it.
now i get a new error:
PS C:\Users\Office\Workspace\Code\Meteor\app_01> meteor
[[[[[ C:\Users\Office\Workspace\Code\Meteor\app_01 ]]]]]
Unexpected mongo exit code 100. Restarting.
Unexpected mongo exit code 100. Restarting.
Unexpected mongo exit code 100. Restarting.
Can't start mongod
MongoDB had an unspecified uncaught exception.
Check to make sure that MongoDB is able to write to its database directory.
Edit: now deleted the .meteor/local/db contents. we are now back to the ENOTEMPTY error.
It is because the directory is not getting deleted during the bundling operation.
So when this happens, Stop your server with ctrl + c.
Then delete the contents of .meteor\local\db directory as well as .meteor\local\builds directory and run the server again using meteor command.
Not an ideal way, but it works.
Just tested this on my mac and on my Windows machine, it works fine for me. (Copied and pasted your code into app.js, did not change anything anywhere else, as I understood this is what you did).
There are two ways to go on:
You try meteor reset. Warning: This will empty any databases you had within this app, but I think there isn't anything all to important in there at the moment?
You delete the app and make a new one using meteor create appname, and copy the source code from above into app.js.
I think investing too much time and effort is not worth it, since it is not an app close to production stage. If, however, creating a new app causes the same problem, it will get interesting =)
EDIT: Just searched around and found this: https://github.com/TomWij/meteor/issues/18
Scroll down to the answer; apparently it might be your antivirus scanner preventing Meteor from rebuilding it. Is that possible?
Also, are you starting Meteor from anything else than cmd.exe? I just read through the issue on GitHub, and things seem to be pretty gnarly when using anything else than cmd.exe (eg the GitHub Bash Shell)
Once my pull request goes in, this issue should be resolved:
https://github.com/TomWij/meteor/pull/56
Related
I am trying to get RODBC to work on heroku. I have a rails app that calls an R script from RinRuby, which then queries the production database in order to do some analysis. It all works fine on my local Mac, so I thought the best approach was to use the binary compiled on my Max (psqlodbcw.so) into my repo, and reference it in production as well. Unfortunately, when I try to make the connection in production using this connection string:
> library(RODBC)
> dbhandle <- odbcDriverConnect('driver=./psqlodbcw.so;database=nw_server_production;trusted_connection=true;uid=nw_server')
Warning messages:
1: In odbcDriverConnect("driver=./psqlodbcw.so;database=<db_name>;trusted_connection=true;uid=<user>") :
[RODBC] ERROR: state 01000, code 0, message [unixODBC][Driver Manager]Can't open lib './psqlodbcw.so' : file not found
2: In odbcDriverConnect("driver=./psqlodbcw.so;database=<db_name>;trusted_connection=true;uid=<user>?") :
ODBC connection failed
I have seen this error in a similar post online here, but using SQL server instead of postgres. But the accepted answer on that post doesn't explain why the file isn't found, despite being in the app directory. I did follow the same approach and made my own custom buildpack (available here: https://github.com/NovaWulf/r-rodbc-buildpack). I replaced the .so file with the one I compiled on my mac, and simply deleted the .rll file and the code that copies it, since I don't have that file (and hopefully don't need it for psqlodbc?). When I run that buildpack it runs without error on heroku, but then when I reference the .so file copied from the buildpack, I get the same "file not found" error.
Is this happening because the .so file was compiled on the wrong system architecture? I tried compiling psqlodbc on linux, but I do not get a psqlodbcq.so file when I do that (let alone an .rll file). The closest thing I get is a file called libodbcpsqlS.so, which is a setup file, not a driver file.
Could someone please help me understand the best approach to this problem? Why is heroku not seeing the file that is not there? And what is the best solution? Is there a simple way to just download the correct driver file somewhere?
Any help is much appreciated!
Best,
Paul
Using Phoenix on Windows 8, when I go to run mix phoenix.server, it starts Brunch but gives the error
Copying of web\static\assets\images\Thumbs.db failed. Error: EPERM: operation not permitted,
open C:\Users\myname\phoenix\appname\priv\static\images\Thumbs.db`.
Then it does a never-ending info: compiling loop, and I get various errors with my javascript.
As I was writing this I tried it again without changing anything, and now I get the error
(File.CopyError) could not copy recursively from "C:/.../test/priv" to
"C:/.../test/_build/dev/lib/test/priv". C:/.../Thumbs.db: permission denied
This sprang up all of a sudden--not sure what I did that could have caused it. Does anyone have any ideas, such as perhaps somehow giving correct permissions, or ignoring Thumbs.db in brunch, or something else? Thanks
Edit: Well I think I correctly got Thumbs.db ignored in brunch with conventions.ignored, since I am able to do a standalone brunch build and it compiles, but I still get the above (File.CopyError). Looking into eradicating all Thumbs.db files, but surely there's a better solution.
Editedit: I deleted all Thumbs.db (or at least tried to with the Disk Cleanup / 'Delete thumbnails'), also disabled thumbnails, but I still get the second error. Perhaps time to get a new os?
Well, starting over with a new phoenix project (with old code pasted in) fixed it. Any thoughts as to what caused it or other ways to solve it are still welcome.
I'm very new to SGX and wanted to start with something simple. Fortunately, I found this very basic tutorial. Unfortunately, as simple as it is, I can't get it to work. The code executes, but there are errors in the output.
[sgx_create_enclavew ..\urts\win\urts.cpp:195] Couldn't open file with CreateFile()
error 0x200f, failed to create enclave.
Buffertests:
Buffer before change: Hello World!
Buffer after change: Hello World!
Stringtests:
Returned Secret:
Saved Secret: My secret string
Load Secret:
Integertests:
secretIntValue first load: 0
saved a 1337 to the enclave.
secretIntValue second load after 1337 was saved: 0
error, failed to destroy enclave.
image of output
the tutorial says:
If you get the error SGX couldn't find the enclave file. The solution is to move the enclave_test_save.signed.dll into the same folder where the app_test_save.exe is located.
which I've tried, but it didn't solve the problem.
when I try to create the enclave using:
sgx_create_enclave(ENCLAVE_FILE, SGX_DEBUG_FLAG, &token, &updated, &eid, NULL);
it returns: SGX_ERROR_ENCLAVE_FILE_ACCESS
could the problem be a result of using a different version of Visual Studio? (The tutorial uses VS 2012, while I'm using VS 2015)
Did you run the application through command prompt or from IDE?
If you are using IDE, You need to change the debugging properties to $(OutDir) from $(ProjecttDir) under Project Properties->Configuration Properties->Debugging->Working Directory.(Both Enclave and Application) Select the Intel(R) SGX Debugger.
Disclaimer: I had the same error although under a different setting (Ubuntu, eclipse) so I am not sure to what extent this will help.
Before initialize_enclave() is called (which in turn calls sgx_create_enclave()), a chdir(absolutePath) command needs to be executed, where absolutePath needs to be the absolute path to where your executable is.
My error was due to a wrong path I used.
Thanks, I solved it. turns out I had to place enclave_test_save.signed.dll in the root folder with the .edl file and not with the .exe file.
I'm running Qt 5.3.1 on Mac OS X 10.8 and 10.9 I'm trying to use the macdeployqt tool to bundle libraries and plugins with my executable, but it's apparently trying to include everything on my hard drive.
I invoke it with:
/Applications/Qt/5.3.1/5.3/clang_64/bin/macdeployqt /Users/adamwilt/Desktop/temp/DesktopPixie.app -verbose=2
-qmldir=/Users/adamwilt/Desktop/temp/DesktopPixie.app/Contents/Resources/qml/DesktopPixie
and get lots of normal, expected log messages like:
Log: copy: "/Applications/Qt/5.3.1/5.3/clang_64/qml/QtQuick/Controls/Styles/Base/images" "/Users/adamwilt/Desktop/temp/DesktopPixie.app/Contents/Resources/qml/QtQuick/Controls/Styles/Base/images"
...and all runs fine until I start getting messages like:
Log: copy: "" "/Users/adamwilt/Desktop/temp/DesktopPixie.app/Contents/Resources/qml/MessageBoxUI/Enums"
ERROR: file copy failed from "/do-gst"
ERROR: to "/Users/adamwilt/Desktop/temp/DesktopPixie.app/Contents/Resources/qml/MessageBoxUI/Enums/do-gst"
ERROR: file copy failed from "/rescuepro.properties"
ERROR: to "/Users/adamwilt/Desktop/temp/DesktopPixie.app/Contents/Resources/qml/MessageBoxUI/Enums/rescuepro.properties"
ERROR: file copy failed from "/rescuepro34act.lic"
and then the fun begins:
Log: copy: "/Applications" "/Users/adamwilt/Desktop/temp/DesktopPixie.app/Contents/Resources/qml/MessageBoxUI/Enums/Applications"
Log: copied: "/Applications/License.rtf"
Log: to "/Users/adamwilt/Desktop/temp/DesktopPixie.app/Contents/Resources/qml/MessageBoxUI/Enums/Applications/License.rtf"
Log: copy: "/Applications/0xED-1.0.7.app" "/Users/adamwilt/Desktop/temp/DesktopPixie.app/Contents/Resources/qml/MessageBoxUI/Enums/Applications/0xED-1.0.7.app"
It appears it's trying to copy everything (that is, "") into the app, but I ^C out of it while I still have disk space left!
It didn't do this at first; then it did so for a week; then it stopped; now it's back. This is a distributed development project; I'm doing the QML stuff and folks elsewhere are doing the C++. It's possible the other folks are changing a configuration somewhere that's causing this to occur, but I'm the only one doing Mac deployments, so I'm the only one who sees this.
Is there a config file of some sort for macdeployqt where this might be getting triggered? Or is it more likely a problem related to the C++ object MessageBoxUI, which defines several Q_ENUMs (apparently correctly, as it compiles without warnings or errors, and appears to run properly), since that's the target directory when it starts going mad?
Sussed it (well enough that I can go on):
The Qt app I'm trying to deploy lives in ~/Desktop/temp. If I set my current directory to ~/Desktop or ~/Desktop/temp before I run macdeployqt, it runs as expected.
If I run it from from my home directory ~, or ~/Documents, macdeployqt tries to pull in everything it finds in /Applications, /opt, and/or other directories unassociated with the app.
Setting cwd to most other paths, including ~/Downloads, /Applications, subdirectories of ~/Documents, etc. also seems to work; it's only running macdeployqt from ~ and ~/Documents that causes the problem.
No proper explanation as to why this is happening, but just a warning in case someone else sees this sort of weird behavior: try changing to the apps's location before running macdeployqt.
I just upgraded my Windows Meteor from 0.5.4 to 0.6.4.1. I am on Windows 7. After upgrade my
working code crashed with the following error messages:
Errors prevented startup:
Exception while bundling application:
TypeError: Cannot read property 'raw' of undefined
at C:\Program Files (x86)\Meteor\packages\meteor\package.js:15:15
at _.extend.add_file (C:\Program Files (x86)\Meteor\app\lib\bundler.js:201:5)
at self.api.add_files (C:\Program Files (x86)\Meteor\app\lib\bundler.js:102:16)
at Array.forEach (native)
at Function..each..forEach (C:\Program Files (x86) \Meteor\lib\node_modules\underscore\underscore.js:78:11)
at self.api.add_files (C:\Program Files (x86)\Meteor\app\lib\bundler.js:101:11)
at Array.forEach (native)
at Function..each..forEach (C:\Program Files (x86) \Meteor\lib\node_modules\underscore\underscore.js:78:11)
at Object.self.api.add_files (C:\Program Files (x86)\Meteor\app\lib\bundler.js:100:9)
at null.on_use_handler (C:\Program Files (x86)\Meteor\packages\underscore\package.js:7:7)
Your application is crashing. Waiting for file change.
As the two stack trace entries for bundler.js don't seem to tally with what I would expect for 0.6.4.1, there is a possibility that the MSI upgrade didn't work properly (MSI uses hashes to determine if text files are up-to-date).
I would suggest that you try:
Uninstalling Meteor from Control Panel -> Add/Remove programs.
Check that you have no files left in program files \Meteor.
Re-install using the 0.6.4.1 installer.
Check the installation works on the todos example (see below)
Try your app.
To check that the install is working sensibly, create one of the example apps and check it runs:
meteor create --example todos
cd todos
meteor
Since 0.5.4 there have been a couple of changes. The big one being variable scoping.
If there is a variable in a file & you want to access that variable from another file you have to scope it globally.
i.e if you have
var x = true;
You have to change it to
x = true;
The same for a function:
function foo() { return "bar"; }
//or
var foo = function() { return "bar;"}
becomes
foo = function() { return "bar"; };
You have to go through your files an alter these.
Alternatively you could move your files to a new /compatibility directory where they wont be variable scoped.