Not able to access External server from inside container - docker

I am running a docker window container which is running a window service . It is trying to load a file from On-Premise file server. I have tried to map the file server path inside container using "net use" command with different credentials who have access to the file server path. After that I have used "CMDKEY" commands to authenticate the file server. I am able to do that but while application is running it is not able to access that file. I am getting access denied error. Can anyone help me on this?
For more information, I have run the IIS as well to keep container alive.
Net Use command:
Net use * "" /user:<username> /p:yes
CMDKey command
cmd.exe /C "cmdkey /add: /user:<username> /pass:"
While doing the same thing with Console Application, I am able to access the file server path from inside container but not working for window service.

Related

Trying to sense files in smb server from airflow DAG using Filesensor

I have few files in smb server. My job is to sense everyday using filesensor if files exist in that path. If they exist, I have to process them and move them to S3 Bucket. But I am not able to connect with smb server.
1.I mounted smb server on my machine and tried to access files from it. It worked on my local.I could read and process.So I created a bash script with mounting commands and credentials and called that script from BashOperator in DAG.
Then realised that I must have to have a connection id to sense if files exist in that location using Filesensor.
2.So I installed samba provider on top of airflow and gave a connection by entering hostname, login and password. When I run the dag, I am getting this message.
WARNING - Unable to find an extractor. task_type=FileSensor airflow_dag_id=CSV_Upload_To_S3 task_id=Get_CDS_From_Qlik airflow_run_id=manual__2022-12-05T10:26:41.802952+00:00
[2022-12-05, 10:26:46 UTC] {factory.py:122} ERROR - Did not find openlineage.yml and OPENLINEAGE_URL is not set
[2022-12-05, 10:26:46 UTC] {factory.py:43} WARNING - Couldn't initialize transport; will print events to console.
Am I missing something in giving connection? Is there more to it?

Can't send HTTP Request from inside a docker container

I have a java application as JAR. This JAR application runs fine from my machine, meaning it can send and receive HTTP Requests to and from an API Endpoint (let's call this endpoint example.com/api/).
And then i built a docker image of this JAR Application, and tried to run the image as container from my docker desktop. But then i got this error.
the error i got
it seems like my application cant reach the url from inside the docker container. I tried to set the proxy in Settings -> Resources -> Proxies -> Manual proxies configuraton, and put my company proxy since i'm inside my company network. But still it doesn't work.
I tried to google this problem but almost nothing shows up (anything that shows up have little correlation with my problem). Anyone knows what seems to be the problem? What should I do?
First check if your container is able to communicate with the endpoint. Ping or curl it from the container shell. If you use proxy, set environment variables in container:
export http_proxy=http://server-ip:port
export https_proxy=https://server-ip:port

Spring Cloud DataFlow: access to application.jar

Spring Cloud DataFlow (SCDF) deployed and runned in docker-container.
Applications deployed at localhost.
The task is to register applications in SCDF.
When I use this URI file:///${HOME}/IdeaProjects/file_read_maven-0.0.1-SNAPSHOT, where {HOME} is an element of absolute path at localhost, I receive in log "Error: Unable to access jarfile."
When I change location of application from localhost to container, in which SCDF is deployed, I receive the same result.
What may be the possible solution?
To resolve local artifacts from your laptop from inside the running Docker daemon, you will have to mount the volume where the artifacts are hosted.
Either you can resolve from the mounted file-system or alternatively you can from the local Maven cache, as well.
More details here.

Login Issue with Weblogic in Docker

I created a Weblogic generic container for version 12.1.3 based on the official Docker images from Oracle at https://github.com/oracle/docker-images/tree/master/OracleWebLogic/dockerfiles
Command: buildDockerImage.sh -g -s -v 12.1.3
This creates the image oracle/weblogic:12.1.3-generic
Using a modified version of sample dockerfile for 1213-domain, I built the Weblogic container.
Note: changed the base image to be generic, instead of developer
docker build -t 1213-domain --build-arg ADMIN_PASSWORD="admin123" -f myDockerfile .
Pushed the built image to Amazon ECR and ran the container using the AWS ECS. Configured the port mappings as 0:7001, set memory soft limit as 1024, nothing else changed in default ECS settings. I have an application load balancer in the front, which receives traffic at 443 port and forwards to the containers. In the browser I get a login page for Weblogic, when I enter username as weblogic and password as admin123, I get the error:
Authentication Denied
Interestingly when I go to the container and connect to the weblogic using WLST, it works fine.
[ec2-user#ip-10-99-103-141 ~]$ docker exec -it 458 bash
[oracle#4580238db23f mydomain]$ /u01/oracle/oracle_common/common/bin/wlst.sh
Initializing WebLogic Scripting Tool (WLST) ...
Jython scans all the jar files it can find at first startup. Depending on the system, this process may take a few minutes to complete, and WLST may not return a prompt right away.
Welcome to WebLogic Server Administration Scripting Shell
Type help() for help on available commands
wls:/offline> connect("weblogic","admin123","t3://localhost:7001")
Connecting to t3://localhost:7001 with userid weblogic ...
Successfully connected to Admin Server "AdminServer" that belongs to domain "mydomain".
Warning: An insecure protocol was used to connect to the
server. To ensure on-the-wire security, the SSL port or
Admin port should be used instead.
wls:/mydomain/serverConfig>
Any hints on what can be going wrong?
Very interesting indeed. :) .. You are sure there is no special characters or so when you entering the username and password. Try typing the same if you are coping.
Also as backup, since you are able to login to WLST you can try two option.
Resetting the current password of weblogic or try adding new username and password.
below link will help
http://middlewarebuzz.blogspot.com/2013/06/weblogic-password-reset.html
or
http://middlewaremagic.com/weblogic/?p=4962

Unable to run Selenium RC server as windows service

I have followed this link to run Selenium Server as a windows service: http://www.claytonstechnobabble.com/2011/08/run-any-application-as-windows-service.html
The service gets installed successfully but when I try to run it it gives error:
"The SeleniumRC service on Local Computer started and then stopped. Some services stop automatically if they are not in use by other services or programs."
can you guys help me on that asap? what am I missing?
This is the selenium server file that I am trying to run: "selenium-server-standalone-2.5.0.jar"
Ali, you might try capturing the output from the service. Since the Java app is designed to be run in console mode, there is likely to be some useful explanation if you can capture std out and std err. Running the service with a wrapper like Java Service Launcher will provide that functionality to log the error information: http://jslwin.sourceforge.net/
Create a bat file containing
//cd Location of file
java -jar selenium-server-standalone-2.5.0.jar
then use this bat file to execute in service.

Resources