Why isn't my luminus app working on Heroku? - postgresql

I'm a complete beginner and following this book: https://pragprog.com/titles/dswdcloj3/web-development-with-clojure-third-edition/
I followed the instructions about deploying to Heroku from the book and from here: https://luminusweb.com/docs/deployment.html#heroku_deployment but I'm having some issues.
Here is my problem and the steps I've taken. I'm using the source code from guestbook-controllers here and modifying it, just trying to get the app working in Heroku (ie able to make an account, log in and post a message). Here is my repo: https://github.com/johnbradens/guestbook-heroku
Here are my steps:
git init
git add .
git commit -m "initial commit"
I added a bin/build file and ran chmod u+x bin/build (based on instructions from https://folcon.github.io/post/2020-04-12-Fulcro-on-Heroku/, because it was saying that react wasn't installed)
I added heroku buildpacks nodejs & clojure (otherwise it said it couldn't read the npm from bin/build)
heroku addons:create heroku-postgresql
git push heroku main
This is what I see when I look at the Heroku app:
Error 1
Error 2
When I run heroku run lein run migrate I get the following error:
Syntax error compiling at (/tmp/form-init6415984187052473661.clj:1:73).
could not find a non empty configuration file to load. looked in the classpath (as a "resource") and on a file system via "conf" system property
I tried editing the env/prod/resources/config.edn but I'm not sure what to do with it. I tried a lot of things and none of them worked.
Here's an example of something I tried, in changing the env/prod/resources/config.edn file. One of the links above says to just have {:prod true} so that's what I have right now, but I also tried:
{:prod true
:port (System/getenv "PORT")
:database-url (System/getenv "JDBC_DATABASE_URL")
}
EDIT: I found out thanks to the clojure slack that my env folder is being ignored, and to create a prod-config.edn file where I have the above text in that file. I tried pushing to Heroku again and I still get the same errors as in the images on the web app, and I still get the same error message when I run heroku run lein run migrate that the config file is not being found.
What should I do?

Ok everyone this is what finally fixed it. I found this in this github post: https://github.com/luminus-framework/luminus/issues/231
it seems that
heroku run lein run migrate
from the documentation is not going to work.
Migration could be done running the generated jar file:
heroku run java -cp target/uberjar/<app name>.jar clojure.main -m guestbook.core migrate
Leaving this here in case anyone else has the same issue.

Related

WOPI Validator Application Not Working. It returns 404 Not Found

I am trying to integrate with WOPI online through the Office Cloud Storage Program Partner Program
To do that integration, you have to use the validation application URL by using .wopitest file. It was working fine before but today it gives me 404 Not Found
My Testing URL: https://ffc-onenote.officeapps.live.com/hosting/WopiTestFrame.aspx?ui=en-US&rs=en-US&dchat=1&hid=951a6eb2-6cd8-4c6d-9258-95f2d420b241&sc=746e9e3b-8a2e-4bc1-810c-01ce605911d1&wopisrc=https://<-myRestAPIURL->/wopi/files/1051&IsLicensedUser=edit&testcategory=All
Is there anyone having the same issue or it is an implementation issue?
Note: for word documents, it is working but I need to run the full test for other issues
It still not working but you can run the validation locally. Here are the steps on windows:
Make sure you have at least.net core 2.2.1
Download the validator project from github https://github.com/Microsoft/wopi-validator-core
Rebuild the project and open the command line
Navigate to the bin folder netcoreapp2.0 folder
Run the command dotnet run --project
./src/WopiValidator/WopiValidator.csproj --framework netcoreapp2.0
-- -t MyAccessToken -l 0 -w http://localhost:5000/wopi/files/1 -e OfficeOnline -s
Note:
Provide a valid access token and your WOPI REST end point URL
Maybe you will need to disable the Proofkeys validation on your end point to make it run
All steps mentioned on the project home page at github

Cannot start the application. TypeError: Cannot read property 'definition' of undefined at getFieldsJsonSchemaFor

I'm getting an extremely weird error when trying to npm start my loopback application. I literally did nothing to the code and then this all of a sudden started to happen
Cannot start the application. TypeError: Cannot read property
'definition' of undefined
at getFieldsJsonSchemaFor (/Users/vikramkhemlani/Desktop/loopback/node_modules/#loopback/repository-json-schema/dist/filter-json-schema.js:101:64)
I have the same exact code in another file (which i actually created a git repo from using this repo) but this one is throwing this error for some reason
I went through the same issue.
Apparently there are caches which need to clean up before starting the application. (Expired caches also appear in openapi before I get into this issue)
The project needs to be clean and re-install packages by following:
npm run clean
npm install
I have the same problem.
However, I solved it when I tried the following.
delete node_modules directory.
npm install.
Hello from the LoopBack team 👋
This may be a bug in LoopBack introduced by recent changes. Please create a small application reproducing the problem (see our Bug reporting instructions) and open a new GitHub issue in https://github.com/strongloop/loopback-next/issues/new

Squarespace Local Development doesnt seem to want to work

I am following the developers.squarespace.com documentation and I am trying to use a local dev environment to make my static website into a squarespace template. As far as getting the server started, everything is working fine until I get to the point of installing the squarespace server to my system. To beging, I use this command in my Mac's terminal:
npm install -g #squarespace/server
After I enter this, everything once again seems to be working correctly because I am met with this (which doesn't show any errors as I have seen for others):
Executing: npm run bundle
> #squarespace/server#1.1.2 bundle /Users/Squid/.npm-global/lib/node_modules/#squarespace/server
> node scripts/bundlejre.js --accept --clear -tz -j 8u131 -o build/distributions/runtimes/jre
Bundling compatible JRE (This may take a while)
> #squarespace/server#1.1.2 cleanupscript /Users/Squid/.npm-global/lib/node_modules/#squarespace/server
> node scripts/execif.js --os=win32 --exists=build node scripts/vetolines.js build/distributions/local-developer/bin/run.bat #!
+ #squarespace/server#1.1.2
updated 1 package in 56.891s
Following that, I clone my site into a folder on my desktop from git and then navigate to the folder in terminal. At this point, I attempt to start the Dev Server, by running the following command(with the "site-name" changed to my site's name:
squarespace-server https://site-name.squarespace.com
My problem begins here, I am met with the following response from the terminal:
-bash: squarespace server: command not found
My mac doesn't recognize the server, even though I found the folder manually on my computer (but I don't know what to do with it).
So far I have attempted a couple troubleshooting methods:
I have a trial site so I tried to use the --auth flag as suggested on the documentation.
I restarted the whole process, so I removed all node and squarespace related files from my system and started again.
After looking online for answers, I installed homebrew to make sure that I am installing node and git correctly to my system.
Finally, I have attempted to change permissions for npm (but I'm not sure that I did this part correctly or not since I don't receive any permission errors).
Also, thank you so much for reading through all this. I just really wanted to make sure you all understood where I was at in this whole process.
I think you can solve this by adding an export path to your profile.
Open the terminal
Enter the following command
touch ~/.bash_profile
(this creates the bash profile)
open ~/.bash_profile
(this opens the bash profile you just created)
Your bash profile will open in a text editor.
Add the following line, then save:
export PATH=~/.npm-global/bin:$PATH
Restart terminal and try using the command again. < This part is important. If you don't restart your terminal it won't recognise the profile.
https://docs.npmjs.com/resolving-eacces-permissions-errors-when-installing-packages-globally

java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory at org.apache.nifi.bootstrap.RunNiFi.main

i use intellij idea to run the nifi source code from bootstrap/.../RunNiFi.main("start"): github link, but it get wrong like this: picture here
can you help me ?
thanks
and should i run the code from bootstrap/.../RunNiFi.main("start")?
You won't be able to launch a single Java class from your IDE to start NiFi, the classpath won't be setup correctly.
You'll need to run a full build and get the assembly from nifi-assembly/target and then run NiFi from the built assembly by using "bin/nifi.sh start".
You can run it directly from the unpacked assembly target, for example:
cd nifi-assembly/target/nifi-1.6.0-SNAPSHOT-bin/nifi-1.6.0-SNAPSHOT
./bin/nifi.sh start
EDIT: You can still use debugger, but it will be debugging a remote Java application. In NiFi's bootstrap.conf, uncomment the following line and restart NiFi:
#java.arg.debug=-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=8000
This tells the NiFi JVM to listen for incoming debug requests on port 8000.
In your IDE, create a Remote debugging configuration and connect to localhost port 8000. Your break points should work like normal.
if you can read chinese, you can read my personal blog link here
I found the methods,
if you want remote debug nifi, please follow remote debug link.
if you want local debug, you can follow bellow.
(I used Intellij idea in windows to debug)
1.
$ git config --global core.longpaths true
$ git config --global core.autocrlf false
open intellij idea to git clone https://github.com/apache/nifi,
picture here,
set the import configure as default, next...
after opened the project, the nifi may get wrong message, just ignore it.
mvn -T 2 clean install -DskipTests
configure debugger
picture here,
picture here
acknowledge:
nifi quick start link: https://nifi.apache.org/quickstart.html
Running NiFi in Debug mode link: https://cwiki.apache.org/confluence/display/NIFI/Contributor+Guide#ContributorGuide-RunningNiFiinDebugmode

Gcloud components update -> can't find import

Our code base has been compiling just fine up until now. Today, gcloud started pestering me with its update message again, so I ran a "gcloud components update" and it updated successfully.
However, now when I try to deploy our project using "gcloud preview app deploy .", I get the following error:
can't find import: "github.com/dgrijalva/jwt-go"
The line hasn't changed since it was properly deploying before the update. I've already tried a "go get -u github.com/dgrijalva/jwt-go", which worked (though I'm not sure if local packages affect the deployment anyway). Anyone know what's going on here?
Apparently gcloud is in a state of transition for the go tools. It does work with appcfgy.py under the latest (Cloud SDK 0.9.57).
/path/to/your/google-cloud-sdk/bin/appcfg.py update --oauth2 <my_module>/app.yaml -A <application id> -V <version>