-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
General discussion #284
Comments
I really haven't tried with jdk 17 but there seems to be an unknown jvm option involved. The recommended way is to leverage https://sdkman.io/ and pick the jdk from https://github.com/wiringbits/scala-webapp-template/blob/master/.sdkmanrc (which seems out of date),
It does print some warnings but the logs you shared show the problem:
I'd bet you are using an incompatible yarn version, I'd suggest to use https://github.com/nvm-sh/nvm to pick the supported node version (https://github.com/wiringbits/scala-webapp-template/blob/master/.nvmrc), then, install yarn (I have If you get more issues, feel free to comment, I'm in the process to update the docs. |
@nickcoast please check the docs and let us know if you get into any other issues: https://github.com/wiringbits/scala-webapp-template/blob/master/docs/setup-dev-environment.md |
Thanks for getting back and sharing the useful insights, I'll take your suggestions and update the docs again.
I included this a couple of hours ago.
People commonly fails to connect to the database before creating the extension, there is a chance you experienced the same.
Oh, good catch! most emails are sent through a background job but it seems this is not the case when you are creating an account.
Which section are you referring to?
There are some native dependencies required, I tried making that clear on the new docs,
I'm actually trying to make the process as simple as possible, we have had this project mostly for internal usage, hence, the support has been handled through our internal chats. |
Now I finally remember why it was done this way, most emails are sent through the background job unless they include sensitive information, for example, the token used to verify an email or to recover a password, I created #285 to simplify this process, now, there are no more errors when an account is created but AWS is not used. |
That makes sense, works great. Your new docs for Architecture are extremely helpful. I've added some models but am was getting a Nothing is logged in The error went away after I added https://github.com/nickcoast/fbn-scala Also, by the way, in case you will be adding any IDE docs, I will share a couple things I found helpful in IntelliJ. I created 1 run configuration each for Also, I added |
Glad you liked that, there is still work to be done to adapt the code to make such separations clear.
Logs are printed to stdout, could it be anything related to your compound IDE settings? I tend to run the app by launching 3 terminals, the one where I execute
This is actually weird, I'd bet there is something else going on but it is hard to tell without logs. I see you got into some trouble with sql parsers, feel free to ask questions about those. |
Thank you! I don't know if my parsers, etc, are really working until I try some read/write but at least there are no compile or runtime errors yet. So, the server seems to be working and my next steps will be creating new widgets and/or pages. By the way, the Thanks so much for your help! |
Which makes sense, in any case, I'd expect it to cause a failure.
It is hard to know without logs.
Usually, you write a simple test to verify that (check tests for repositories).
Usually, the UI should work but I tend to update |
Hi Alex, I added some routes, a controller, actions, repos. I'm getting an error related to Thank you Output from
|
Oh, I have saw similar errors, please remove any swagger annotations you changed/added to your controller, there are tricky cases that I must document. |
I've made a lot of progress since removing those annotations. They were indeed causing that issue. Could you please give me a hint about creating a modal dialog in scala.js? Do I need to add a new library to build.sbt? Thank you much |
The project already has everything from https://v3.mui.com/ available, in particular, check dialogs, I have another project where such a component is used. Good luck! |
Thanks! One more quick question if you have the time. Should I be using UUID primary keys for all DB tables? Seems the Admin interface only allows viewing individual records for tables with UUID primary keys. |
It's been a while since I checked the react-admin backend we built but I wouldn't be surprised if that's the case, most of the work we are doing on top of this template defaults to I'm documenting the project slowly, some day, I'll get to the admin integration, in the mean time, feel free to raise any other questions. |
Thank! For deployment, there's lots of sensitive data that needs to go in |
I commonly use any of these approaches:
|
Great, thanks, I will try the ansible-vault. Seems like a good solution. |
EDIT: I had some question but made some progress. Deleting for now. Made some progress in debugging. Issues with environment variables and 'host not allowed' warnings. |
This seems weird.
Check logs (
Indeed.
While it is doable, I wouldn't recommend you to do that, backend settings can be encrypted with ansible-vault while hosts file is usully tracked by git If you check the backend settings, there is a line At last, |
Could there be some problem loading the environment variables with the I tried running the
I can also log in to Posgresql from cli with the user name/password from
|
That would be weird but I have experienced something similar in different ubuntu versions, when the app starts, it prints logs with the loaded settings, can you please check those and verify if the variables are being picked up? |
It turned out I had a typo in my In your
It seems that
...everything gets deployed to the second I changed the name under Is it not supposed to work that way? Ansible docs seem to suggest that I did some experiments. Using the same name ("test-server") causes the frontend and backend to all get merged under Here I am running this command with the
And now again, after changing
Maybe this is all due to some other mistake I've made but changing one |
I'd say that you basically found a bug in the scripts, thanks for sharing your details! |
Given that this has become a general discussion, I'm reopening and pinning the ticket. Previously, I mentioned that current swagger integration is tricky, I added some docs just in case you are interested in this. If you have questions about any other topic, please let me know to prioritize documenting those topics. |
In I would tweak it myself but I'm not sure how to deal with compiled sources (I'm new to Java).
|
We believe that there shouldn't be so many changes involved, still, the sources are not in this repository, they are at https://github.com/wiringbits/wiringbits-webapp-utils A simple solution would be to use the module settings to specify the type for the primary key field, then, we can update queries accordingly. |
@nickcoast I have created wiringbits/wiringbits-webapp-utils#138 to track this improvement. |
Deployment question. I changed my subdomain in my hosts.ini for the web app and redeployed now I'm getting So I can load the homepage of the web app, but api requests fail. Can't sign in anymore. And admin is blank since rendering depends on the api response. Do you think this is an nginx config issue? |
Did you ran the |
Yeah I ran all the nginx and other ymls:
Then
Repeated several times. Perhaps I should delete all Also, no changes in |
That's weird, I remember changing domain names previously without issues. The steps you performed seem correct, I'd double check that
The related files are at You are right that if you uninstall nginx, the ansible playbooks would get it installed again.
Actually, there is an entry propagated from hosts file to the - name: Build the application
shell: ./scripts/build-web.sh {{ web_api_url }}
delegate_to: 127.0.0.1 Still, this value is logged when you load
This occurs when nginx can't connect to the backend api, I remember that you were using different servers, please verify that:
|
Yes, I looked there and removed the old files just in case but it had no effect.
Okay, so on my development machine, I don't need to run
I changed it to single-server deployment a couple weeks ago. Frontend and admin were both working fine yesterday. Deployed with my changes to the webapp utils and loaded data with integer primary keys and could view tables and records in admin, and frontend responses were working. I ran
|
All the api requests fail. But, again, it was all working and all I did was: Change subdomain from Admin domains were not changed, but the admin api still isn't working. |
It is hard to tell without looking into it, I don't mind taking a short screen-sharing session to see what's going on (there is a link to my calendar in the repo main page).
No, similar to - name: Build the application
retries: 10
delay: 5
shell: "./scripts/build-server.sh {{ app_source_name }}"
delegate_to: 127.0.0.1
Like I said above, it is hard to tell what's going on without digging further, when I break the servers, I usually just recreate them because that's usually faster. Everything points that nginx has issues contacting the backend code.
Correct, what you shared is the systemd status, can you check the app logs? I think they are at Have you tried invoking
Given this log, I would believe that the app is in an infinite restart loop due to an error, which would explain that nginx can't contact backend.
No, invoke
Same reason, backend is most likely in a restart loop. |
Log for yesterday is huge 6.5M. Probably because of the restart loop.
I just tried it and it failed. You are correct.
I checked
If I can't figure this out, that'd be great! Thanks! |
You need to make sure to check the official docs (https://www.playframework.com/documentation/2.8.x/Evolutions), looks like your server has applied evolution scripts that were removed/updated after a deployment, which causes this effect, if your current server data is not important, simpler way is to just recreate the database and restart the server, it must work after that. Otherwise, you will need to mark the evolution as applied in the database and make sure to apply the schema changes manually. |
Hmmm, but does the log indicate that's what is making the server keep restarting? I did read those docs before. I created that new evolution, which adds columns in Ups and removes them in downs, etc, and deployed those a couple of days ago and all the changes were applied successfully. Then I loaded more data and the site still worked. So, it seemed like all the evolutions were working well but I understand your point and will check on that. It's just odd if that would be the problem, when everything worked in the days before. |
Changed all my DNS and my hosts.ini to point to a different AWS server. Ran all the
Not sure if it's worth debugging the other server. Could maybe be interesting? |
I wonder if there was a time where you deployed to this server, then, migrated to the new one after making changes to evolution scripts, this could explain why going back to previous server got issues applying evolutions. I'd bet these two servers use different databases. Assuming there is no useful data a your server db, just recreate the database and everything should be back to normal. |
Yes, this log you pasted complains about unapplied evolutions, the app will refuse to start without that.
This happens when you create evolution scripts like |
I'm new to Scala and Java so I'm sure the answer should be obvious but I've been struggling with it so I thought I'd ask for some help.
I did some Googling and found that CMSClassUnloadingEnabled option was deprecated before Java 14.
Is that true?
What version of Java should I use?
https://stackoverflow.com/questions/70214788/unrecognized-vm-option-cmsclassunloadingenabled-after-switching-to-java-17
I tried this:
$ sdk use java 11.0.16-tem
$ sbt dev-web
And got a about 8 warnings and some errors.
The text was updated successfully, but these errors were encountered: