Openfaas function keeps returning the same result even after redeploying - openfaas

I built a little Openfaas function using the tutorial. After initial build and deployment, it worked just fine and returned {"status":"done"}, just as I intended.
After the initial successful run, I made changes to the index.js handler (it's a node project). I rebuilt and redeployed using the following commands:
faas-cli build -f license.yml && faas-cli deploy -f license.yml
and invoke the function using the following command:
curl 127.0.0.1:8080/function/license -H 'Content-Type: application/json' --data-binary '{"hosts":["YYYXXXAAABBBCCC"]}'
In stead of returning a "status" object (see above), it should return a "licenseKey". However, no matter how often I build/deploy this function, it keeps returning the original object.
What do I have to do to make Openfaas use the new code?

I believe I made a rookie mistake. In stead of using handler.js as the main file I used index.js. I probably had a leftover handler.js from running the tutorial, but mv index.js handler.js did the trick (after rebuilding and deploying, of course).

Related

"fatal: bad tree object" error when pull from remote branch [duplicate]

Whenever I pull from my remote, I get the following error about compression. When I run the manual compression, I get the same:
$ git gc
error: Could not read 3813783126d41a3200b35b6681357c213352ab31
fatal: bad tree object 3813783126d41a3200b35b6681357c213352ab31
error: failed to run repack
Does anyone know, what to do about that?
From cat-file I get this:
$ git cat-file -t 3813783126d41a3200b35b6681357c213352ab31
error: unable to find 3813783126d41a3200b35b6681357c213352ab31
fatal: git cat-file 3813783126d41a3200b35b6681357c213352ab31: bad file
And from git fsck I get this ( don't know if it's actually related):
$ git fsck
error: inflate: data stream error (invalid distance too far back)
error: corrupt loose object '45ba4ceb93bc812ef20a6630bb27e9e0b33a012a'
fatal: loose object 45ba4ceb93bc812ef20a6630bb27e9e0b33a012a (stored in .git/objects/45/ba4ceb93bc812ef20a6630bb27e9e0b33a012a) is corrupted
Can anyone help me decipher this?
I had the same problem (don't know why).
This fix requires access to an uncorrupted remote copy of the repository, and will keep your locally working copy intact.
But it has some drawbacks:
You will lose the record of any commits that were not pushed, and will have to recommit them.
You will lose any stashes.
The fix
Execute these commands from the parent directory above your repo (replace 'foo' with the name of your project folder):
Create a backup of the corrupt directory:
cp -R foo foo-backup
Make a new clone of the remote repository to a new directory:
git clone git#www.mydomain.de:foo foo-newclone
Delete the corrupt .git subdirectory:
rm -rf foo/.git
Move the newly cloned .git subdirectory into foo:
mv foo-newclone/.git foo
Delete the rest of the temporary new clone:
rm -rf foo-newclone
On Windows you will need to use:
copy instead of cp -R
rmdir /S instead of rm -rf
move instead of mv
Now foo has its original .git subdirectory back, but all the local changes are still there. git status, commit, pull, push, etc. work again as they should.
Your best bet is probably to simply re-clone from the remote repository (i.e., GitHub or other). Unfortunately you will lose any unpushed commits and stashed changes, however your working copy should remain intact.
First make a backup copy of your local files. Then do this from the root of your working tree:
rm -fr .git
git init
git remote add origin [your-git-remote-url]
git fetch
git reset --mixed origin/master
git branch --set-upstream-to=origin/master master
Then commit any changed files as necessary.
Working on a VM, in my notebook, battery died, got this error;
error: object file .git/objects/ce/theRef is empty error: object
file .git/objects/ce/theRef is empty fatal: loose object theRef
(stored in .git/objects/ce/theRef) is corrupt
I managed to get the repo working again with only 2 commands and without losing my work (modified files/uncommitted changes)
find .git/objects/ -size 0 -exec rm -f {} \;
git fetch origin
After that I ran a git status, the repo was fine and there were my changes (waiting to be committed, do it now..).
git version 1.9.1
Remember to backup all changes you remember, just in case this solution doesn't works and a more radical approach is needed.
Looks like you have a corrupt tree object. You will need to get that object from someone else. Hopefully they will have an uncorrupted version.
You could actually reconstruct it if you can't find a valid version from someone else by guessing at what files should be there. You may want to see if the dates & times of the objects match up to it. Those could be the related blobs. You could infer the structure of the tree object from those objects.
Take a look at Scott Chacon's Git Screencasts regarding git internals. This will show you how git works under the hood and how to go about doing this detective work if you are really stuck and can't get that object from someone else.
My computer crashed while I was writing a commit message. After rebooting, the working tree was as I had left it and I was able to successfully commit my changes.
However, when I tried to run git status I got
error: object file .git/objects/xx/12345 is empty
fatal: loose object xx12345 (stored in .git/objects/xx/12345 is corrupt
Unlike most of the other answers, I wasn't trying to recover any data. I just needed Git to stop complaining about the empty object file.
Overview
The "object file" is Git's hashed representation of a real file that you care about. Git thinks it should have a hashed version of some/file.whatever stored in .git/object/xx/12345, and fixing the error turned out to be mostly a matter of figuring out which file the "loose object" was supposed to represent.
Details
Possible options seemed to be
Delete the empty file
Get the file into a state acceptable to Git
Approach 1: Remove the object file
The first thing I tried was just moving the object file
mv .git/objects/xx/12345 ..
That didn't work - Git began complaining about a broken link. On to Approach 2.
Approach 2: Fix the file
Linus Torvalds has a great writeup of how to recover an object file that solved the problem for me. Key steps are summarized here.
$> # Find out which file the blob object refers to
$> git fsck
broken link from tree 2d9263c6d23595e7cb2a21e5ebbb53655278dff8
to blob xx12345
missing blob xx12345
$> git ls-tree 2d926
...
10064 blob xx12345 your_file.whatever
This tells you what file the empty object is supposed to be a hash of. Now you can repair it.
$> git hash-object -w path/to/your_file.whatever
After doing this I checked .git/objects/xx/12345, it was no longer empty, and Git stopped complaining.
Try
git stash
This worked for me. It stashes anything you haven't committed and that got around the problem.
A garbage collection fixed my problem:
git gc --aggressive --prune=now
It takes a while to complete, but every loose object and/or corrupted index was fixed.
simply running a git prune fixed this issue for me
I encountered this once my system crashed. What I did is this:
(Please note your corrupt commits are lost, but changes are retained. You might have to recreate those commits at the end of this procedure)
Backup your code.
Go to your working directory and delete the .git folder.
Now clone the remote in another location and copy the .git folder in it.
Paste it in your working directory.
Commit as you wanted.
I just experienced this - my machine crashed whilst writing to the Git repo, and it became corrupted. I fixed it as follows.
I started with looking at how many commits I had not pushed to the remote repo, thus:
gitk &
If you don't use this tool it is very handy - available on all operating systems as far as I know. This indicated that my remote was missing two commits. I therefore clicked on the label indicating the latest remote commit (usually this will be /remotes/origin/master) to get the hash (the hash is 40 chars long, but for brevity I am using 10 here - this usually works anyway).
Here it is:
14c0fcc9b3
I then click on the following commit (i.e. the first one that the remote does not have) and get the hash there:
04d44c3298
I then use both of these to make a patch for this commit:
git diff 14c0fcc9b3 04d44c3298 > 1.patch
I then did likewise with the other missing commit, i.e. I used the hash of the commit before and the hash of the commit itself:
git diff 04d44c3298 fc1d4b0df7 > 2.patch
I then moved to a new directory, cloned the repo from the remote:
git clone git#github.com:username/repo.git
I then moved the patch files into the new folder, and applied them and committed them with their exact commit messages (these can be pasted from git log or the gitk window):
patch -p1 < 1.patch
git commit
patch -p1 < 2.patch
git commit
This restored things for me (and note there's probably a faster way to do it for a large number of commits). However I was keen to see if the tree in the corrupted repo can be repaired, and the answer is it can. With a repaired repo available as above, run this command in the broken folder:
git fsck
You will get something like this:
error: object file .git/objects/ca/539ed815fefdbbbfae6e8d0c0b3dbbe093390d is empty
error: unable to find ca539ed815fefdbbbfae6e8d0c0b3dbbe093390d
error: sha1 mismatch ca539ed815fefdbbbfae6e8d0c0b3dbbe093390d
To do the repair, I would do this in the broken folder:
rm .git/objects/ca/539ed815fefdbbbfae6e8d0c0b3dbbe093390d
cp ../good-repo/.git/objects/ca/539ed815fefdbbbfae6e8d0c0b3dbbe093390d .git/objects/ca/539ed815fefdbbbfae6e8d0c0b3dbbe093390d
i.e. remove the corrupted file and replace it with a good one. You may have to do this several times. Finally there will be a point where you can run fsck without errors. You will probably have "dangling commit" and "dangling blob" lines in the report, these are a consequence of your rebases and amends in this folder, and are OK. The garbage collector will remove them in due course.
Thus (at least in my case) a corrupted tree does not mean unpushed commits are lost.
The solution offered by Felipe Pereira (above) in addition to Stephan's comment to that answer with the name of the branch I was on when the objects got corrupted is what worked for me.
find .git/objects/ -size 0 -exec rm -f {} \;
git fetch origin
git symbolic-ref HEAD refs/heads/${BRANCH_NAME}
The answer of user1055643 is missing the last step:
rm -fr .git
git init
git remote add origin your-git-remote-url
git fetch
git reset --hard origin/master
git branch --set-upstream-to=origin/master master
Runnning git stash; git stash pop fixed my problem
I followed many of the other steps here; Linus' description of how to look at the git tree/objects and find what's missing was especially helpful. git-git recover corrupted blob
But in the end, for me, I had loose/corrupt tree objects caused by a partial disk failure, and tree objects are not so easily recovered/not covered by that doc.
In the end, I moved the conflicting objects/<ha>/<hash> out of the way, and used git unpack-objects with a pack file from a reasonably up to date clone. It was able to restore the missing tree objects.
Still left me with a lot of dangling blobs, which can be a side effect of unpacking previously archived stuff, and addressed in other questions here
I was getting a corrupt loose object error as well.
./objects/x/x
I successfully fixed it by going into the directory of the corrupt object. I saw that the users assigned to that object was not my git user's. I don't know how it happened, but I ran a chown git:git on that file and then it worked again.
This may be a potential fix for some peoples' issues but not necessary all of them.
To me this happened due to a power failure while doing a git push.
The messages looked like this:
$ git status
error: object file .git/objects/c2/38824eb3fb602edc2c49fccb535f9e53951c74 is empty
error: object file .git/objects/c2/38824eb3fb602edc2c49fccb535f9e53951c74 is empty
fatal: loose object c238824eb3fb602edc2c49fccb535f9e53951c74 (stored in .git/objects/c2/38824eb3fb602edc2c49fccb535f9e53951c74) is corrupt
I tried things like git fsck but that didn't help.
Since the crash happened during a git push, it obviously happened during rewrite on the client side which happens after the server is updated. I looked around and figured that c2388 in my case was a commit object, because it was referred to by entries in .git/refs. So I knew that I would be able to find c2388 when I look at the history (through a web interface or second clone).
On the second clone I did a git log -n 2 c2388 to identify the predecessor of c2388. Then I manually modified .git/refs/heads/master and .git/refs/remotes/origin/master to be the predecessor of c2388 instead of c2388.
Then I could do a git fetch.
The git fetch failed a few times for conflicts on empty objects. I removed each of these empty objects until git fetch succeeded. That has healed the repository.
We just had the case here. It happened that the problem was the ownership of the corrupt file was root instead of our normal user. This was caused by a commit done on the server after someone has done a "sudo su --".
First, identify your corrupt file with:
$> git fsck --full
You should receive a answer like this one:
fatal: loose object 11b25a9d10b4144711bf616590e171a76a35c1f9 (stored in .git/objects/11/b25a9d10b4144711bf616590e171a76a35c1f9) is corrupt
Go in the folder where the corrupt file is and do a:
$> ls -la
Check the ownership of the corrupt file. If that's different, just go back to the root of your repo and do a:
$> sudo chown -R YOURCORRECTUSER:www-data .git/
Hope it helps!
I solved this way:
I decided to simply copy the uncorrupted object file from the backup's clone to my original repository. This worked just as well. (By the way: If you can't find the object in .git/objects/ by its name, it probably has been [packed][pack] to conserve space.)
I got this error after my (Windows) machine decided to reboot itself.
Thankfully my remote repository was up to date, so I just did a fresh Git clone...
This seems to be an issue with Dropbox or symlinking folders out of Dropbox for me. Probably the same for any of the other similar services. When I go to git push I'd get the Corrupt loose object error. For me, on macOS Big Sur, the fix was simply to make a recursive copy of the repo to a directory outside of Dropbox. I believe this caused Dropbox to pull the live files for the broken dynamic references. After the copy I was immediately able to git push without error.
I have had the same issue before.
I simply get passed it by removing the object file from the .git/objects directory.
For this error below.
$ git fsck
error: inflate: data stream error (invalid distance too far back)
error: corrupt loose object '45ba4ceb93bc812ef20a6630bb27e9e0b33a012a'
fatal: loose object 45ba4ceb93bc812ef20a6630bb27e9e0b33a012a (stored in .git/objects/45/ba4ceb93bc812ef20a6630bb27e9e0b33a012a) is corrupted
Solution:
Go to your top directory and unhide the .git folder
On windows, you can do this by running this command on cmd: attrib +s +h .git
Then go to .git/objects folder
As mentioned on the error message above (stored in .git/objects/45/ba4ceb93bc812ef20a6630bb27e9e0b33a012a) is corrupted
you can see that the object is found on a director called "45". Therefore, go to the directory .git/objects/45/
Finally find the object named ba4ceb93bc812ef20a6630bb27e9e0b33a012a and delete it.
Now, you can go ahead and check with git status or git add . your change and proceed.
I had this same problem in my bare remote git repo. After much troubleshooting, I figured out one of my coworkers had made a commit in which some files in .git/objects had permissions of 440 (r--r-----) instead of 444 (r--r--r--). After asking the coworker to change the permissions with "chmod 444 -R objects" inside the bare git repo, the problem was fixed.
I just had a problem like this. My particular problem was caused by a system crash that corrupted the most recent commit (and hence also the master branch). I hadn't pushed, and wanted to re-make that commit. In my particular case, I was able to deal with it like this:
Make a backup of .git/: rsync -a .git/ git-bak/
Check .git/logs/HEAD, and find the last line with a valid commit ID. For me, this was the second most recent commit. This was good, because I still had the working directory versions of the file, and so the every version I wanted.
Make a branch at that commit: git branch temp <commit-id>
re-do the broken commit with the files in the working directory.
git reset master temp to move the master branch to the new commit you made in step 2.
git checkout master and check that it looks right with git log.
git branch -d temp.
git fsck --full, and it should now be safe to delete any corrupted objects that fsck finds.
If it all looks good, try pushing. If that works,
That worked for for me. I suspect that this is a reasonably common scenario, since the most recent commit is the most likely one to be corrupted, but if you lose one further back, you can probably still use a method like this, with careful use of git cherrypick, and the reflog in .git/logs/HEAD.
When I had this issue I backed up my recent changes (as I knew what I had changed) then deleted that file it was complaining about in .git/location. Then I did a git pull. Take care though, this might not work for you.
Create a backup and clone the repository into a fresh directory
cp -R foo foo-backup
git clone git#url:foo foo-new
(optional) If you are working on a different branch than master, switch it.
cd foo-new
git checkout -b branch-name origin/branch-name
Sync changes excluding the .git directory
rsync -aP --exclude=.git foo-backup/ foo-new
This problem usually occures when using various git clients with different versions on the same git checkout. Think of:
Command line
IDE build-in git
Inside docker / vm container
GIT gui tool
Make sure you push with the same client that created the commits.
What I did not to lose other unpushed branches:
A reference to the broken object should be in refs/heads/<current_branch>. If you go to .git\logs\refs\heads\<current_branch> you can see that the last commit has the exactly same value. I copied the one from the previous commit to the first file and it solved the problem.
I had a similar issue on a Windows 10 computer with onedrive backing up my documents folder where I have my git repositories.
Looking at the object in the git object directory I did not see a green checkmark but the blue sync icon for that file. All other object files appeared to have the green checkmark. Playing around, trying things, I tried selecting the option always keep this folder on this device but got an error: error 0x80071129 the tag present in the reparse point buffer is invalid.
This link (https://answers.microsoft.com/en-us/msoffice/forum/all/error-0x80071129-the-tag-present-in-the-reparse/b8011cee-98c5-4c33-ba99-d0eec7c535a0) suggests to run chkdsk /r /f as an admin to fix the issue (have to reboot computer). I did that and it fixed my issue.
Have the same issue after my linux mint crash, and I press power button to shutdown my laptop, that's why my .git is corrupt
find .git/objects/ -empty -delete
After that, I get error fatal: Bad object head. I just Reinitialized my git
git init
And fetch from remote repo
git fetch
To check your git, use
git status
And it's work again. I don't lose my local changes, so I can commit without rewriting code
I had the exact same error and managed to get my repo back without losing my changes.
I do not know if it could work for others as corruption reason can be multiple, but it's worth trying
I:
Made several backups of the corrupt git repository just in case
Cloned the lasted pushed version from the remote repository
Copied all the files from the corrupt .git folder EXCEPT all files related to HEAD, FETCH_HEAD, ORG_HEAD etc ... the most important are the refs, obj, and index
Ended up with a valid history, but corrupt index, applied the solution from this post How to resolve "Error: bad index – Fatal: index file corrupt" when using Git
And my repository was back working ...
To make sure I did not push anything wrong, I cloned again from the remote, checked-out the changes I wanted to save from the restored repository, and comited them fresh.

Problems when it comes to committing changes to git after running 'npm run deploy' on my react app

So I have successfully deployed my react project on GitHub pages, there are a lot of useful guides on how to do this. However I am having issues when it comes to updating the project (it is harder to find good guides on this)
So lets say I make a change to my project on the code as it exists in folders on my computer.
Then I will run 'npm run deploy'. After doing this, I can see my changes have been successfully implemented on my online deployed site, so all good.
Then I run the following code to push the changes into the repository:
git add .
git commit -m "update"
That works fine, but I get an error at the next step:
git push -u origin master
When I do this I always get the same error message in the terminal:
error: failed to push some refs to 'https://github.com/redacted/redacted.github.io.git'
hint: Updates were rejected because the remote contains work that you do
hint: not have locally. This is usually caused by another repository pushing
hint: to the same ref. You may want to first integrate the remote changes
hint: (e.g., 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
Can anyone please explain what is happening here, and what this error message means.
In the error message, does 'remote' mean the code as it exists in the GitHub repo, and 'local' mean the code on my computer? Why does the remote code and local code diverge after running 'npm run deploy'? In future, what is the best way for me to update the repository so that I don't keep running into this problem.
If it's important, here are my scripts on the package.json file:
"predeploy": "npm run build",
"deploy": "gh-pages -b master -d build",
hint: Updates were rejected because the remote contains work that you do
not [...] have locally.
There are commits on the remote that you don't have locally. To see them, you can use git diff. First, update the local representation of remote references in your repo:
git fetch
Now that you have an up-to-date local representation of what's on origin/master, you can see the differences with:
git diff origin/master
Git diff is one of the most important parts of the git tooling, so become acquainted with its syntax. This should show you what changes you've missed. you can also pull up the log of origin/master which will show the commit messages, authors, and dates with:
git log origin/master
If this loads up in an editor you don't recognize and the lower left of the screen is a : colon character, type q to quit. This program is called less.
All that helps you introspect the remote changes that you haven't incorporated locally. When you're ready to pull them into your own branch, simply issue:
git pull
This will apply missing commits to your local branch. If the local commits change the same lines as the remote commits, you'll end up with a git conflict. In this case you'll have to look at the conflicts and decide how to combine the two changes. Often, remote changes can be incorporated without causing any conflicts, but of course it depends on what's been changed on both sides.
A final note. What you absolutely do not want to do is git push -f. This will force push your changes to master, replacing its current history - in other words, you'll destroy the remote changes. Never do this. There's a time and a place for it, and once you get more comfortable with git diff and its behavior as a distributed change control system, you can revisit that advice.

Jenkins Pipeline withCredentials secret file odd behavior

I'm using Jenksin v2.5.0 with Credentials plugin v 2.1.16 and CredentialsBinding plugin v1.13 (both latest available) and while it appears to work as intended, it exhibits and odd repeating behavior as I continue to re-run my pipeline.
The following pipeline syntax is in use:
withCredentials([file(credentialsId: '<credID>', variable: 'KEY_FILE')]) {
...steps here create ${workspace}/ssh script using KEY_FILE...
sh(script: "docker exec ${containerName} /bin/bash -c 'cd ${entryPoint} && GIT_SSH='${workspace}/ssh' git fetch --tags --progress git#gitserver.com:${group}/${project}.git +refs/h eads/${branch}:refs/remotes/origin/${branch}'")
} //credentials
It evaluates as expected and is functional, as shown here:
[Build] Running shell script
+ docker exec <container> /bin/bash -c 'cd /<buildRoot>/build && GIT_SSH=/<workspace>/ssh git fetch --tags --progress git#gitsserver.com:<group>/<project>.git +refs/heads/staging:refs/remotes/origin/staging'
Warning: Identity file /<workspace>/<job>#tmp/secretFiles/a36b7edb-2914-419a-8be0-478603d1b031/keyfile.txt not accessible: No such file or directory.
Permission denied, please try again.
Permission denied, please try again.
Received disconnect from gitserver.com port 22:2: Too many authentication failures for git
Connection to gitsserver.com closed by remote host.
Warning: Identity file /<workspace>/<job>#tmp/secretFiles/ccb1e11c-18f5-4697-b5c1-e4514c1ab1c7/keyfile.txt not accessible: No such file or directory.
*** The part where it states that it can't find the file during the git operation (that is using SSH underneath) is what continues to repeat, each time with a different secret files GUID in the path (shown above are two of the repeats). The underlying implementation appears to implement a loop of sorts over the 'git fetch' command, trying a new credentials path each time.
Both how/why Jenkins:
1) Creates these new paths each time
2) Knows to keep looping over the single failed git command until it finally delivers the secret file that enables the authentication and git succeeds
are mysteries to me.
Any insight would be appreciated.
PS> I'm already aware that newer versions of git not (yet) available in my environment have different methods for providing SSH options. I'd like this question to focus on the odd withCredentials behavior.
PPS> I've also already tried higher level constructs for the pipeline including at least the 'git' SCM plugin specialization and the 'docker' node type with it's "inside()" functionality, but many iterations of those constructs always left me with some oddity that, again, is not the focus of this question.
Turns out that this is not a problem with Jenkins or any of the plugins at all.
The temporary script that was written to the Jenkins workspace was continuously being appended to, meaning it was the source of all the invalid secret file paths and the "loop"...the last command in that script would always be the one with the correct path and it would succeed.

CakePHP error on Heroku when Debug set to zero

I have a CakePHP application setup on Heroku using the Heroku PHP buildpack (https://github.com/heroku/heroku-buildpack-php).
With Debug set to 1, the application uses the file cache and reduces the lifespan of the cache. In addition, the DebugKit toolbar appears.
With Debug set to 0, the application uses APC.
When I have Debug set to 1, it works properly, but the DebugKit toolbar shows up and the caching is essentially shutoff. When I set Debug = 0 I get the standard "Internal Error" message. Running "heroku logs" only shows me errors relating to php not being able to write to the tmp directory (specifically for error logs). I attempted to have cakePHP write to stdout, but that didn't help.
To see what exactly was causing the problem, I removed DebugKit from the installation and made the caching for Debug=1 match Debug=0. I thought this would cause the app to error again, but it's still working. Is there anything else that happens when Debug is turned off that could be causing this, or did I miss something with the error logs error?
I managed to get this working eventually. The answer was to make sure the app/tmp directory and all of the children directories were being created by the buildpack. I was under the impression that cakePHP wouldn't worry about them if it didn't need them, but I was incorrect.
I wanted to keep them out of the repo, so in the buildpack compile file I added:
CAKEPHP_APP_TMP_PATH="www/app/tmp"
# make tmp dir
echo "-----> Creating CakePHP tmp directories"
mkdir -p $CAKEPHP_APP_TMP_PATH/cache/models
mkdir -p $CAKEPHP_APP_TMP_PATH/cache/persistent
mkdir -p $CAKEPHP_APP_TMP_PATH/cache/views
mkdir -p $CAKEPHP_APP_TMP_PATH/logs
mkdir -p $CAKEPHP_APP_TMP_PATH/sessions
mkdir -p $CAKEPHP_APP_TMP_PATH/tests
chmod -R 777 $CAKEPHP_APP_TMP_PATH
With that, the directories were in place, but they never appear to be used. The app is now properly running with Debug set to 0.
It would be ideal if you could get write access to the tmp folder so that you can see the logs.
These Internal Error with Cake are usually related to the caching of the models. So in APC you may have and old cache that does not really match up with your database.
Try clearing the APC cache and see if that helps.
PS: The cake app has a couple of caches, so you'll have to make sure what uses what... you have the default, _cake_core_ and _cake_model_ at least! The last two could be the source of your problems.

Google App Engine endpointscfg.py command starting 1.8.6 does not accept argument -f

This problem just started in Google App Engine version 1.8.6:
When executing command (based on instruction https://developers.google.com/appengine/docs/python/endpoints/gen_clients):
endpointscfg.py get_client_lib java -o . -f rest your_module.YourApi
We get error:
endpointscfg.py: error: unrecognized arguments: -f
The command with argument -f execute without any issue for Google App Engine version 1.8.5.
With 1.8.6, I don't know how to generate client end point library, because of this error. If you have a workaround, please help.
When you use get_client_lib to generate client library, rest format is the only option. So if you intend to generate a Rest client library, simply remove ".f rest" option. And you will get your Rest client without any problem.
If you want to use RPC client (which is currently only supported in iOS client). Please refer to https://developers.google.com/appengine/docs/python/endpoints/consume_ios for instruction.
I think one piece might be missing from the documentation above. In order to get the api-v1-rpc.discovery, you need to run get_discovery_doc command like following:
endpointscfg.py get_discovery_doc -o . -f rpc your_module.YourApi
Hope it helps.

Resources