Google App Engine Make a rollback with appcfg.sh - java

I'm trying to make a rollback due a deploy failed, my server code is on java, and also i'm using App Engine Eclipse PlugIn for. my appcfg.sh file is located at /Applications/eclipse/plugins/com.google.appengine.eclipse.sdkbundle_1.7.5/appengine-java-sdk-1.7.5/bin/appcfg.sh
but i get "Command not Found" when i try this sudo /Applications/eclipse/plugins/com.google.appengine.eclipse.sdkbundle_1.7.5/appengine-java-sdk-1.7.5/bin/appcfg.sh rollback /Documents/workspace/server_side/war
I can't realize what's wrong. i don`t know if is the right appcfg, because there is appcfg.cmd and appcfg.sh, i'm using an imac(Unix enviro) so i use the appcfg.sh to made the rollback. i've tried in several different ways. and nothing good happen. maybe i'm missing something.
thanks!

It does not have execute permission by default:
-rw-r--r-- 1 yorkw staff 558 11 Dec 06:01 appcfg.sh
Run chmod 755 appcfg.sh to change the permission:
-rwxr-xr-x 1 yorkw staff 558 11 Dec 06:01 appcfg.sh
Then you should be able to run it in terminal.

I also encountered the same problem as the original poster of this question, but I still got a permission denied error when attempting to rollback, even after changing the permissions of the appcfg.sh file.
It turned out I also needed to chmod 755 run_java.sh (located in the same directory as appcfg.sh), and then I was able to rollback without problems.
I thought I would post this in case anyone encountered the same set of issues that I did.

For anyone else who stumbles upon this and wants more detail...
In Terminal go to GAE-SDK-PATH/bin (where appcfg.sh is located) for instance:
/Applications/Eclipse/plugins/com.google.appengine.eclipse.sdkbundle_1.8.3/appengine-java-sdk-1.8.3/bin
You may not have enabled permissions with appcfg.sh, so do what #yorkw suggested if you are getting 'Permission Denied', in the bin directory type:
chmod 755 appcfg.sh
then to rollback type
./appcfg.sh --email=PROJECT_EMAIL --passin rollback ROOT_PROJECT_FOLDER/war
You will be prompted to enter the password for the project email, and then it should work!
Google doc: https://developers.google.com/appengine/docs/java/tools/uploadinganapp

Maybe you made the same silly oversight as me and left out "sh" at the beginning?
i.e.
sh /Applications/eclipse/plugins/com.google.appengine.eclipse.sdkbundle_1.7.5/appengine-java-sdk-1.7.5/bin/appcfg.sh rollback /Documents/workspace/server_side/war

Use the following commands on OSX. Note the appcfg.sh doesn't have execute permission by default so you need to add it via chmod.
cd /Users/Labuser/Downloads/appengine-java-sdk-1.9.22/bin
chmod 755 appcfg.sh
sh appcfg.sh rollback /Users/Labuser/Ducuments/AndroidWS/AndroidStudioProjects/AndroidProject/modulebackend/src/main/webapp/

Related

Unable to create directory path [/User/Desktop/db2/logs] for Neo4j store

I am trying to use a tool that, in two steps, analyzes code smells for android.
In the first step, the tool parses an apk and generates within a directory .db files that should then be converted to CSV files in the next step; however, whenever I try to run the second step, the console returns the following error:
java.io.IOException: Unable to create directory path [/User/Desktop/db2/logs] for Neo4j store.
I think it is a Neo4J configuration problem.
I am currently running the tool with the following Java configuration:
echo $JAVA_HOME
/home/User/openlogic-openjdk-11.0.15
update-alternatives --config java
* 0 /usr/lib/jvm/java-11-openjdk-amd64/bin/java 1111 auto mode
To be safe, I also started Neo4J, which returned the following output
sudo systemctl status neo4j.service
neo4j.service - Neo4j Graph Database
Loaded: loaded (/lib/systemd/system/neo4j.service; enabled; vendor preset: enabled)
Active: active (running) since Wed 2022-07-06 20:11:04 CEST; 16min ago
Main PID: 1040 (java)
Tasks: 57 (limit: 18901)
Memory: 705.4M
CPU: 16.639s
CGroup: /system.slice/neo4j.service
└─1040 /usr/bin/java -cp "/var/lib/neo4j/plugins:/etc/neo4j:/usr/share/neo4j/lib/*:/var/lib/neo4j/plugins/*" -XX:+UseG1GC -XX:-OmitStackTraceInFastThrow -XX:+AlwaysPreTouch -XX:+UnlockExper>.
How can I solve this?
You posted this error:
java.io.IOException: Unable to create directory path [/User/Desktop/db2/logs] for Neo4j store.
From that error, it looks like:
Neo4j was installed at "/User/Desktop/db2"
The permissions for that directory do not have "write" permission
I tried to reproduce this locally using Neo4j Community 4.4.5, following the steps below.
I do see an IOException related to "logs", but it's slightly different from what you posted. Perhaps we're on different versions of Neo4j.
Open terminal into install directory: cd neo4j
Verify "neo4j" is stopped: ./bin/neo4j stop
Rename existing "logs" directory: mv logs logs.save
Remove write permission for the Neo4j install: chmod u-w .
Start neo4j in console mode: ./bin/neo4j console
Observe errors in console output
2022-07-08 03:28:38.081+0000 INFO Starting...
ERROR StatusLogger Unable to create file [****************************]/neo4j/logs/debug.log
java.io.IOException: Could not create directory [****************************]/neo4j/logs
...
To fix things, try:
Get a terminal into your Neo4j directory:
cd /User/Desktop/db2
Set write permissions for the entire directory tree:
chmod u+w -R .
Start neo4j in console mode:
./bin/neo4j console
If this works and you're able to run neo4j fine, it points to an issue with user permissions when running neo4j as a system service.
The best steps from there depend on the system, your access, how comfortable you are making changes, probably other things. An easy, brute-force hammer would be to manually create each directory you discover (such as "/User/Desktop/db2/logs") and grant premissions to all users (chmod ugo+w .), then try re-running the service, see what errors pop up. Repeat that until you're able to run the service without errors.

When starting Apollo, run start Error reporting during up

pid - 808 just quit unexpectedly, please check logs under /opt/logs/100003171 and /tmp for more information![enter image description here][1]
lsLinHaiZhao ~/Desktop/apollo/apollo-configservice/target/apollo-configservice-2.0.0-SNAPSHOT-github/scripts (master)
$ sh startup.sh
mkdir: cannot create directory ‘/opt’: Permission denied
Windows new JAVA_HOME is: /c/PROGRA~1/Java/JDK18~1.0_4
2022年02月22日 16:18:17 ==== Starting ====
LOG_FOLDER /opt/logs/100003171/ does not exist. Falling back to /tmp
Started [808]
Waiting for server startup.
pid - 808 just quit unexpectedly, please check logs under /opt/logs/100003171 and /tmp for more information!
lsLinHaiZhao ~/Desktop/apollo/apollo-configservice/target/apollo-configservice-2.0.0-SNAPSHOT-github/scripts (master)
$
1.Database password cannot be used: special characters can be used to modify the database password!
2.If the database is not started, the same error will be reported. Restart the database!
3.Not here Configure the contents of relevant databases in the properties file or YML file, and comment out the unnecessary or redundant configuration information, and restart it!
There are three possible mistakes, each of which can lead to the above mistakes. Carefully examine your own problems. Using these three solutions can solve your problems!!!

Karaf command not found exception how to troubleshoot?

Downloaded karaf 4.0.9 just following getting started doc but keep getting this
org.apache.felix.gogo.runtime.CommandNotFoundException: Command not found: feature:install
whenever i try to do feature:install wrapper from shell
Finding it very difficult to find any help or doc how to trouble shoot? is it a permissions thing? I chowned everything to the same user for simplicity...
Is distribution missing a library? Where do i get it/put it?
New to karaf... Following this: http://karaf.apache.org/manual/latest/#_installation
Just trying to get some basic JDBC/JMS stuff working, install drivers, recieve some msgs, query db, etc
Spent a few hours of reading docs + trial and error to figure this out:
ssh karaf#localhost -p 8101
Will get you full admin shell, apparently this isn't available if you just ./shell from KARAF_HOME/bin
You can check your configurations in users.properties in karaf/etc folder .
Open karaf shell using admin rights.
Start Karaf shell from its bin folder.
Now run karaf console using below command.
ssh username#localhost -p8101
now you can run any command of karaf shell.

SVG generation with FOP doesn't work

On one server, and on my Windows laptop, producing PDFs with this method works fine:
http://www.databasesandlife.com/svg-to-pdf/
But on the other server I get this error:
org.apache.batik.transcoder.TranscoderException: Error while setting up PDFDocumentGraphics2D
Enclosed Exception:
Error while setting up fonts
at org.apache.fop.svg.PDFTranscoder.transcode(PDFTranscoder.java:189)
at org.apache.batik.transcoder.XMLAbstractTranscoder.transcode(Unknown Source)
at org.apache.batik.transcoder.SVGAbstractTranscoder.transcode(Unknown Source)
at org.apache.batik.apps.rasterizer.SVGConverter.transcode(Unknown Source)
at org.apache.batik.apps.rasterizer.SVGConverter.execute(Unknown Source)
I have been Googling and searching for hours, but to no avail. What can I do?
I tried installing the following packages but they didn't help:
sudo apt-get install gsfonts gsfonts-x11 gsfonts-other batik \
libbatik-java libxmlgraphics-commons-java \
libxmlgraphics-commons-java fop sun-java6-fonts
My situation is:
Debian 6.0.3
Sun Java version "1.6.0_26"
JARs: avalon-framework-4.2.0.jar batik-all-1.7.jar commons-io-1.3.1.jar commons-logging-1.0.4.jar fop-0.95.jar log4j-1.2.15.jar xml-apis-ext.jar xmlgraphics-commons-1.3.1.jar
Sincerely it is not a good idea to create such temporary files inside the jetty structure from the Debian package. In case of an update, you may get into troubles. Such a cache directory should be located in /var, like /var/tmp for instance.
According to documentation, FOP is supposed to use the temporary directory in case of failure. Probably your finding deserves a bug report.
Until it is fixed, you should set cache-file option Disabling cache with use-cache is another way but probably with performance impacts.
The approach to solving this problem is in log4j.properties I turned up the level to TRACE.
There I saw the extra log before the TranscoderException that I'd seen previously:
2012-02-28 11:51:24,863 DEBUG: org.apache.fop.fonts.FontCache:
Writing font cache to /usr/share/jetty/.fop/fop-fonts.cache
org.apache.batik.transcoder.TranscoderException:
Error while setting up PDFDocumentGraphics2D
Horray for logs! (And writing a log about what the program is about to do, not just once it has done it, so that if the operation fails, then you know what it was trying to do while it failed.)
On Debian, the Jetty webserver runs under the user jetty and has its home directory at /usr/share/jetty/. However, the jetty user does not have write-access to its own home directory, therefore this ~/.fop directory could not be created.
adrian#10770-02:~$ grep jetty /etc/passwd
jetty:x:107:111::/usr/share/jetty:/bin/false
adrian#10770-02:~$ ls -ld /usr/share/jetty
drwxr-xr-x 7 root root 4096 Feb 28 11:52 /usr/share/jetty/
I don't know whether this is by design, or a bug, but creating this directory so that Jetty could write it...
sudo mkdir -p -m 0777 /usr/share/jetty/.fop
...solved the problem.

new to mac.Permission issue with applications

now i'm desparate. I feel like i'm turning round. when i believe solve something then i break something else.
started using this mac this week.In the process of setting up my environment i face some challenge.I got a maven project which uses cargo plugin to publish to tomcat working fine.for that i had to google to create the /etc/launchd.conf file.For some reasons web applications created in netbeans cannot publish to tomcat server i thought it was due to tomcat permission but when i set chmod 777 /Library/tomcat020
sh-3.2# ls -l /Library/tomcat6020
total 136
-rw-r--r--# 1 highjo admin 6148 Nov 4 16:03 .DS_Store i have this for file
drwxr-xr-x# 26 highjo admin 884 Nov 4 16:03 bin and this for folder
i was expecting to be rwxrwxrwx.that's the first problem.
second the first project in maven that was working is not any more.
showing
org.apache.maven.surefire.booter.SurefireExecutionException: Unable to create file for report: /myproject/target/surefire-reports/com.myproject.dao.hibernate.someDAOImplTest.txt (Permission denied); nested exception is java.io.FileNotFoundException: /myproject/target/surefire-reports/com.myproject.dao.hibernate.someDAOImplTest.txt (Permission denied); nested exception is org.apache.maven.surefire.report.ReporterException: Unable to create file for report: /myproject/target/surefire-reports/com.myproject.dao.hibernate.someDAOImplTest.txt (Permission denied); nested exception is java.io.FileNotFoundException: /myproject/target/surefire-reports/com.myproject.dao.hibernate.someDAOImplTest.txt (Permission denied)
same Exception and permission denied anytime i need to run a web app which is supposed to be published on tomcat.
Is Netbeans lacking privileges to access those files?I 'm running late to set up the developement environment.I need help! thanks for reading this
As for the chmod, you seem to be expecting recursive behavior (since you're looking at the permissions what's IN the directory that you chmod, rather than the directory itself). In that case, you should be using chmod -R.
You say chmod 777 /Library/tomcat020, but then ls /Library/tomcat6020 ( note extra 6 )

Categories

Resources