Invalid dispatch configuration - google-app-engine

I'm attempting to update an application which takes advantage of two modules (default and batchratings).
After running 'appcfg update app.yaml batchratings.yaml', I receive the following output:
Error 400: --- begin server output ---
Validation error: Invalid dispatch configuration - module 'batchratings' does not exist. Upload a version of this module and try again.
Given that that's precisely what I'm attempting to do by following the steps outlined in the Modules walkthrough, I'm fairly certain I'm overlooking something obvious.
The source is available here:
https://dl.dropboxusercontent.com/u/7537204/literumble.zip, if that helps anyone.
I'd be very appreciative if anyone had some insight to provide regarding which direction I should be looking to ferret out the issue.

I had the same issue, I was trying to do something like:
appcfg.py update <my_app_dir> app.yaml batchratings.yaml
but the appcfg.py help update shows that if you pass a directory it will always take app.yaml. To take the other modules you need to use the file path for each:
appcfg.py update <my_app_dir>/app.yaml
appcfg.py update <my_app_dir>/batchratings.yaml
To figure this out, it helped me to pass -v to make sure it was updating the module i passed.

If your app has modules then, rather than running appcfg.py my_app_dir, you can instead cd my_app_dir and then run appcfg.py app.yaml mod1.yaml mod2.yaml etc.
Do not run appcfg.py *.yaml otherwise you risk including dispatch.yaml, if present, because that will fail with "Unexpected attribute 'dispatch' for object of type AppInfoExternal".
And be sure to run appcfg.py update_dispatch . afterwards, to upload dispatch entries.

I first thought it had something to do with the app.yaml not having the modules, but that's incorrect as per the examples I'm looking at.
I think it may actually be a very silly thing, in which your dispatch.yaml is pointing to 'batchratings' but your actual module name is 'BatchRankings.py'. Notice the capitalization.

Related

Vespa Tutorial – HTTP API use-case fails to activate with IllegalArgumentException

I'm currently following the Vespa tutorials, and ran into an issue with the HTTP API use-case. Everything works fine from the mvn install package to the vespa-deploy prepare target/application.zip.
The call to vespa-deploy activate returns normally, but the application then never gets available on localhost:8080. Looking at /opt/vespa/logs/vespa/vespa.log (in the VM) one finds the following stack trace:
Container.com.yahoo.jdisc.core.StandaloneMain error Unexpected:
exception=
java.lang.IllegalArgumentException: Could not create a component with id 'com.mydomain.demo.DemoComponent'.
Tried to load class directly, since no bundle was found for spec: sample-app-http-api-searcher.
If a bundle with the same name is installed, there is a either a version mismatch or the installed bundle's version contains a qualifier string.
at com.yahoo.osgi.OsgiImpl.resolveFromClassPath(OsgiImpl.java:48)
...
This occurred using a fresh Docker image with a clean clone of the sample-apps git repository. Preparing and activating the basic sample as well as the other http example did work seamlessly.
I checked the sources and the xml files for obvious problems but don't have any clue about what is failing and where.
target/application.zip contains
application/components/http-api-using-searcher-1.0.1-deploy.jar
application/hosts.xml
application/searchdefinitions/basic.sd
application/services.xml
And the jar itself does contain a com/mydomain/demo/DemoComponent.class file (among other things).
Potentially related issue on the github tracker: https://github.com/vespa-engine/vespa/issues/3479 I'll be posting a link to this question there as well, but I still think it's worth a SO question, at least to get some action behind the vespa tag :)
The bundle id in the application's services.xml file was wrong. Please pull the application from git and try again now. See also PR: https://github.com/vespa-engine/sample-apps/pull/18
Brief explanation: The bundle id given in the bundle="<id>" declaration in services.xml must match the 'Bundle-SymbolicName' in the bundle's manifest. When the bundle has been built with the Vespa bundle-plugin, the symbolic name is by default the same as the project's artifactId. Hence, in most cases you just have to verify that the bundle id matches the artifactId.

Errors in Routes requests

im working in a project using angularjs and laravel, but i have a bug i think in my application, im not sure since it happens sometimes, not always. Basically when i open or run my application are made some requests to some routes, but sometimes give me a 500 error, and than the error that is shown in the preview is:
RuntimeException in ApiServiceProvider.php line 88:
Unable to boot ApiServiceProvider, configure an API domain or prefix.
I searched online this error and didnt find much info related with this error, does someone have a idea what could it be?
Yes I have solved the problem, the thing is that you are missing configurations.
The way to solve it you have to make a copy of .env.example file and rename it to .env
Do not forget to change you database configurations.
The problem was missing domain or prefix. which is in your case is:
API_PREFIX=api
I`m sure that it should solve your problem.
Helpful hint turn on your debugging environment in config/app.php to 'debug' => env('APP_DEBUG', true)
so you can be more specific with error messages.
I had same problem even if API_PREFIX was set in my .env file.
Simple solution that I found after long struggle was to clear cache:
php artisan chache:clear
php artisan config:cache

App Engine - Remove file change detection from dev_appserver log

In a recent SDK update, it seems that Google has added a INFO level log into the dev_appserver that prints out each and every time a file change is detected.
This, in my opinion, just clutters up the log with information I already know thus I don't want it to be printed out on my console.
INFO 2014-11-27 09:52:43,876 module.py:391] [default] Detected file changes:
/Users/michael/app/templates/home
/Users/michael/app/templates/home/index.html
Is there any way to remove these lines from the log? Since this is a INFO level log, I can't really remove the INFO from the log_level as other INFO logs come in handy many times...
Any suggestions?
It's now an issue on the App Engine issue tracker. Vote it up for quicker resolution.
https://code.google.com/p/googleappengine/issues/detail?id=11662
This issue started to bug me also, so here's my quick-fix until devs find more permanent solution:
in path-to-SDK\google\appengine\tools\devappserver2\module.py comment out lines 424-426.
424 # logging.info(
425 # '[%s] Detected file changes:\n %s', self.name,
426 # '\n '.join(sorted(file_changes)))
Just have to remember to do it again when the build changes, if they don't fix it. (I'm working with 1.9.20 atm) (:
As Derek Perkins pointed out, this was sent to the App Engine Issue tracker. Since I had the same problem I starred the issue. I was happily surprised to see it was actually sent up to engineering and they updated the tracker today with a workaround. I rewrote parts of it and added a bit of formatting :)
Root cause of the problem
The main reason behind why every file in a project's folder is tracked is because the reload logic is naïve and has no way of knowing which files are actually being in use.
In the event that some data file contents are changed, but only loaded at module import time (for instance templates in some frameworks), it's difficult for the devserver to accurately detect such changes.
Workaround for Git and Mercurial
If you put your project folder anywhere but the root of your git repo, it will make all the .git files appear outside of your project's dir, so the changes to the files should not be seen and therefore shouldn't trigger a webserver reload. For instance build your project's structure this way :
myproject/
myproject/.git/
myproject/.gitignore
myproject/myapp/
myproject/myapp/app.yaml
myproject/README
Then run the devserver inside of myproject/myapp instead of "myproject".
There is also a mention that this has been tested on Git and Mercurial, but it won't work on CVS or SVN.

Typing the command "cake" in console shows no output

Typing the command "cake" in console shows no output, no errors or anything like that. It just prints about 4 blank lines.
Has anyone else experience this problem before and how did you fix it?
C:\xampp\htdocs\project\app>cake
C:\xampp\htdocs\project\app>
I have had similar problem a moment ago and I found the solution. the problem was not the path for me. I have turn on the debug from 0 to 2. and it shows some error instead of empty output and I try to fix the error (which was in the core.php) and it works now.
So try to debug it like me and fix the error.
Hope it helps.
cake is not directly available in app - while you are in the right folder you still need to call the cake command relative from there:
\app>.\Console\cake
Note that this syntax is unique to Windows
For UNIX use
\app>Console/cake
In case you are using an old app version or didnt bake your application with the Console folder (which you should, though), you can also call the cake core version of it relatively from the APP dir:
\app>..\lib\Cake\Console\cake
(WIN)
\app>../lib/Cake/Console/cake
(UNIX)
Either way the cake file needs to have sufficient execution rights (UNIX mainly) and PHP must be in the system env path. Then it will all work out of the box.
Run this command in Cake/Console folder. I think you are not running it in the right folder.
In this directory:
C:\xampp\htdocs\project\app>
type this command:
php Console/cake.php
which will output:
Current Paths:
-app: app
-working: C:\xampp\htdocs\project\app
-root: C:\xampp\htdocs\project
-core: C:\xampp\htdocs\project\lib
Changing Paths:
Your working path should be the same as your application path. To change your path use the '-app' param.
Example: -app relative/path/to/myapp or -app /absolute/path/to/myapp
....
Similar issue encountered where Console wasn't outputting anything after installing Cake via Composer instead of git clone - no error, just returning a blank line. To solve it I made a backup of app/ (mv app/ app.bak/) and then used vendor/bin/cake -app app bake to bake a brand new app/ folder. Once that process was complete running Console from app/Console/cake started working again. Then just moved my app.bak/ code back in place. I'm assuming over time the paths present or code in app/Console had become unworkable.
Bringing back in the old code I was able to narrow down the issue to using Apc as a cache engine. Reverting to $engine = 'File'; in core.php and bootstrap.php solved the problem and Console worked as expected.
I guess you are using a composer powered cakephp which has console command in Vendor folder. If so, try this ;
AppRoot/Vendor/bin/cake
or you may try with full path to fw;
PATH_TO_APP\Vendor\cakephp\cakephp\lib\Cake\Console\cake.bat

CakePHP searching for DebugKit at wrong path

I am trying to import DebugKit and CakePHP is producing the following error: DebugKit.ToolbarComponent could not be found.
Right below it, it says:
Create the class ToolbarComponent below in file:
/Users/SomeUser/Sites/SomeProject/app/Plugin/DebugKit//Controller/Component/ToolbarComponent.php
If you notice though, there are two slashes between DebugKit and Controller for some reason, and that's obviously not a real directory. The server running PHP 5.4.17. I have followed the exact installation instructions listed here. Any suggestions?
I had the same problem and solved it by changing the permissions to 755 to folders within DebugKit.
When I encountered this problem, I realized I had a Plugin/DebugKit folder structure in my project's root, and under the app directory. The one under app was empty, save for a blank file called empty. Strange. I have no idea how this happened. (Perhaps from accidentally running composer as non-root?) I deleted app/Plugin/DebugKit, and moved the one from the project root into app. No more error.
DebugKit does not currently seem to be compatible with cakephp 3.0 even though it is the example in the documentation.
The latest version still seems to use the 2.x methods.
I will also submit a ticket regarding this to update their documentation to prevent confusion.
If there is something I missed regarding this issue and it is actually possible to install this, let me know.

Resources