New bundled expo-cli start is returning a manifest that cannot be parsed by expo-dev-launcher - expo

We are currently going through the upgrade to expo SDK 47, following these instructions:
https://blog.expo.dev/expo-sdk-47-a0f6f5c038af
Part of the upgrade involves the recommended switch to using the bundled expo-cli, rather than the global instance.
When we make this change, and run npx expo start --dev-client, our android app throws an error when selecting the dev server, with the message:
Value ----------------------------224819657222108214122421 of type java.lang.String cannot be converted to JSONObject
When I hit the dev server url (eg. http://192.168.0.146:8081/?platform=android) manually to obtain the manifest, I can see it is indeed starting with the above value, as it contains some meta-data, eg.
----------------------------224819657222108214122421
Content-Disposition: form-data; name="manifest"
Content-Type: application/json
{"id":"f5c3b7be-999c-436e-b9c4-b453cf873af0","createdAt":"2023-01-12T10:13:41.499Z","runtimeVersion":"1.e","launchAsset":{"key":"bundle","contentType":"application/javascript","url":"http://10.20.0.174:8081/index.bundle?platform=android&dev=true&hot=false"},"asset
...
When I switch back to using the globally installed CLI as per the instructions in the upgrade blog, so changing the start command from npx expo start to expo-cli start, the same test results in the manifest being returned without the supplementary data, and the app can be loaded successfully.

Related

Bitnami Ghost CMS aws instance Config file is not valid JSON issue

I am setting up ghost cms on aws for a client and hit a wall. I am using the bitnami image for setting this up. I haven't touched the config file that comes default in bitnami image. Ghost is not starting up and it's showing this error in the log
Debug Information:
OS: Debian GNU/Linux, v10
Node Version: v10.20.1
Ghost-CLI Version: 1.14.0
Environment: production
Command: 'ghost log'
An error occurred.
Message: 'Cannot read property 'join' of undefined'
Stack: TypeError: Cannot read property 'join' of undefined
at instance.isRunning.then (/opt/bitnami/apps/ghost/lib/node_modules/ghost-cli/lib/commands/log.js:34:88)
at process._tickCallback (internal/process/next_tick.js:68:7)
OK it literally wasted hours of my life. And the problem was found. The reason was that in the config file the url of the blog was given as an IP address. But Ghost has said in it's setup documentation that this is likely to cause issues. So when I changed this to a URL instead of the IP address it was fixed. Hurraaay!!

trying to debug "502 Bad Gateway" error after deploying react app to gcp?

I've deployed a React app via "gcloud app deploy". The "gcloud app browse" command opens a browser which tries to load for a while but then displays a browser title of "502 Bad Gateway." I found the following troubleshooting page:
https://cloud.google.com/endpoints/docs/openapi/troubleshoot-response-errors#gae_errors
The following info on the troubleshoting page appears to be a good match for my scenario:
"An error code 502 with BAD_GATEWAY in the message usually indicates
that App Engine terminated the application because it ran out of
memory. The default App Engine flexible VM only has 1GB of memory,
with only 600MB available for the application container."
But I don't see any "out of memory" error reference in my logs for this. I think I probably need to ensure that I "gcloud app deploy" with a proper app.yaml file. I'm having problems identifying what is a valid minimum yaml file for my React app for which I can be assured that my "gcloud app deploy" will have the expected result. I found the following reference which appears to be a good starting point:
https://cloud.google.com/endpoints/docs/openapi/get-started-app-engine
^^^ This page refers to the following yaml sample code:
https://github.com/GoogleCloudPlatform/java-docs-samples/blob/master/endpoints/getting-started/src/main/appengine/app.yaml
But the url refers to "java-docs-sample" so not sure if this is a vaid yaml file for a React app deployment. Can you provide some guidance on this? I'm really just looking for the minimum yaml file that I can use for a successful deployment. This is the structure of the yaml file that I used for my initial "gcloud app deploy", and the deployment process appeared to indicate success, but not sure if there is any type of fatal flaw here or anything else that may be missing:
runtime: nodejs
env: flex
manual_scaling:
instances: 1
resources:
cpu: 1
From what I understand, you just want a minimal good app.yaml for react apps as the out of memory seems to be the issue if everything else is correct.
A sample app.yaml for react is the following:
# [START runtime]
runtime: nodejs
env: flex
# [END runtime]
# [START handlers]
handlers:
- url: /
static_files: index.html
upload: index.html
# [END handlers]
But you need to modify your handlers according to your needs/ configuration.
502 error sometimes indicates that your app has an issue itself. So it's better to test locally first and make sure your app is working.
Then for the memory part, you can try specifying the instance type to be one with a higher memory. If it still throws the same error then most likely the issue is within your app or dependencies.
I think there is something about react-scripts start that google cloud doesn't like; I've had trouble with this (react app + google cloud deployment) twice in completely different environments (one had docker and one did not); but the first time I never posted anything to stack overflow so I had to go through the pain again :p
Try changing the package.json file to not use react-scripts start when you run npm run start.
Note that this will overwrite the npm run start and npm start command, so if you use this, you can also update the package json with another keyword such as local and change your local running process to involve writing npm run local
"scripts": {
"start": "serve -s build",
"local": "react-scripts start",
"build": "react-scripts build",
...
},
A working repo

wso2 ​WSO2 Microservices Framework for Java petstore sample cannot run on ubuntu

I try to follow https://docs.wso2.com/display/MSS100/Running+as+an+MSA+Application to run petstore sample on ubuntu which is hosted on AWS.
I met several issues:
document is incorrect, it requires to download WSO2 Identity Server.
Unpack the .zip file and place the directory in the <MSS_HOME>/samples/petstore/deployment/packs directory. In fact, the
petstore.sh requires DAS 3.0. Just put wso2das-3.0.0.zip into<MSS_HOME>/samples/petstore/deployment/packs. The script will unzip
it.
kubectl. This script is not put into path, and cause it cannot be
executed when script changes to another folder.
cannot create docker, seems Creating Kube-System Namespace, Kube-DNS, Kube-UI
error: couldn't read version from server: Get http://localhost:8080/api: EOF
error: couldn't read version from server: Get http://localhost:8080/api: EOF
error: couldn't read version from server: Get http://localhost:8080/api: EOF
error: couldn't read version from server: Get http://localhost:8080/api: EOF
error: couldn't read version from server: Get http://localhost:8080/api: EOF
Hope you have done following
export KUBERNETES_MASTER=http://172.17.8.101:8080
Sometimes, if you previously tried out k8s, it will keep previous kubectl configuration under ~/.kube folder. Try removing that folder.
If you have installed some version of kubectl, remove it, otherwise kubectl client and server will not match. run.sh will download compatible kubectl version and install into /usr/local/bin/kubectl
Thanks for pointing out the documentation bug. We will fix it. Also please check out the instruction in https://github.com/wso2/msf4j/tree/v1.0.0/samples/petstore/deployment and ensure that all the prerequisites are met.
The docs are at https://docs.wso2.com/display/MSF4J100/Running+as+an+MSA+Application

ember firebase deploy -- events.js:85 -- throw er; // Unhandled 'error' event -- Error: spawn

I'm following the directions from Here to set up a new firebase hosted app. I get to the end of the instructions and the 'ember firebase deploy' command fails. Here are the steps I'm taking:
C:\workspace\npm install -g firebase-tools
C:\workspace\cd dashdash
C:\workspace\dashdash\firebase login
C:\workspace\dashdash\npm install --save-dev ember-cli-firebase-hosting
C:\workspace\dashdash\ember generate firebase-hosting
C:\workspace\dashdash\ember firebase deploy
It works fine up until the last step. Instead of getting a success message and the URL of my app, I get the following:
C:\workspace\dashdash>ember firebase deploy
version: 1.13.8
Built project successfully. Stored in "dist".
events.js:85
throw er; // Unhandled 'error' event
^
Error: spawn C:\workspace\dashdash\node_modules\ember-cli-firebase-hosting\node_modules\firebase-tools\bin\firebase ENOENT
at exports._errnoException (util.js:746:11)
at Process.ChildProcess._handle.onexit (child_process.js:1053:32)
at child_process.js:1144:20
at process._tickCallback (node.js:355:11)
I haven't changed the app in any way when I get to that step, and I can serve it successfully to http://localhost:4200/ and get the "Welcome to Ember" message.
I'm running Windows 7 Professional (SP1) and using Windows PowerShell (run as administrator) to give the commands. I've also tried in PHPStorm's terminal.
I'm just learning about Ember, so if I've left something out (I probably have,) let me know. I'm more than happy to gather any necessary information. Any help/advice will be much appreciated.
After emailing Firebase support, I was able to get the app deployed using "firebase deploy" rather than "ember firebase deploy."

WSO2 Identity Server SAML Error encrypting XMLObject at Example Travelocity

When setting in the sample app: Travelocity.properties
#Specify if SAM LAssertion element is encrypted
SAML.EnableAssertionEncryption=true
And also tick the Identity server configuration option:
Enable Assertion Encryption [ticked]
Certificate Alias: wso2carbon
I receive the following error at the server log:
Error at Log: 2015-05-05 15:56:10,282 Error encrypting XMLObject
Without the encryption feature enabled, the SAML authentication flow with the Travelocity sample code starts working.
Hints are welcome how to fix this issue.
Regards,
Claude
It seems like you are working on the installed java runtime for the first time. I am using ubuntu 14. The same problem came to me. For me it worked in the following way.
1. Download the respective files according to your runtime from here.
http://www.oracle.com/technetwork/java/javase/downloads/jce-7-download-432124.html
http://www.oracle.com/technetwork/java/javase/downloads/jce-6-download-429243.html
http://www.oracle.com/technetwork/java/javase/downloads/jce8-download-2133166.html
2. Extract the folder you downloaded. There will be two .jar files.
3. For ubuntu you can run echo $JAVA_HOME to find the java home. Copy above jar files into {JAVA_HOME}/jre/lib/security. You may need sudo access depending on you JAVA_HOME location. If so run the following from the location you extracted the zip file.
cp local_policy.jar /{JAVA_HOME}/jre/lib/security
cp US_export_policy.jar /{JAVA_HOME}/jre/lib/security
There should be only one slash (/) at /{JAVA_HOME}.
4. Restart wso2 identity server again and retry the procedure to login to travelocity.com
Hope this will fix your issue.