LocalDeployer: app working directory - spring-cloud

I have an app that creates a file temporarily, does not delete it. I was hopping to see the contents of the file while running.
The app is deployed using the local deployer, does any body knows where would it create the file??
I tried the temp path, and also the working directory where the out and error logs are... nothing, the app does seem to be erroring, that would be on my normal console log.
Running on unix, temp is at /tmp.
thanks

You can control this location via the local deployer property workingDirectoriesRoot and deleteFilesOnExit.
For more information, you can refer this doc:
https://docs.spring.io/spring-cloud-dataflow/docs/current/reference/htmlsingle/#configuration-deployer

Actually looking at the code of the local deployer, it seems the location it defaults to is the system temp path (System.getProperty(“java.io.tmpdir”)) and adds the stream id, plus the app id, etc. It is the same folder where the console and error streams write to.
thanks!

Related

Jetty stops responding after some period of time

I have a project with jetty webserver.
The app is up and works fine. After some period (don't know exactly when) if I try to access the app I receive:
"The page you are looking for is temporarily unavailable. Please try
again later."
The app has schedulers set as well. I would be suspicious for timeout but it's not the case. By analyzing the logs I noticed: 2017-12-08
12:45:24.566:WARN:oejsh.ErrorHandler:qtp1555845260-195: Error page
loop /error/not-found.faces.
I don't see any other logs which can cause the issue. Any suggestions for solution?
The likely case is that you have the default work/temp directory setup in your Jetty deployment and there is a process on your machine that periodically cleans up the system temp directory.
Would suggest you specify the work directory or the temp directory (either jvm temp, jetty.base temp, or webapp temp).
See previous answers on how to configure the work / temp directory.
How to change the temporary directory in jetty9?
Jetty: Starts in C:\Temp

Talend: Using tfilelist to access files from a shared network path

I have a Talend job that searches a directory and then uploads it to our database.
It's something like this: dbconnection>twaitforfile>tfilelist>fileschema>tmap>db
I have a subjobok that then commits the data into the table iterates through the directory and movies files to another folder.
Recently I was instructed to change the directory to a shared network path using the same components as before (I originally thought of changing components to tftpfilelist, etc.)
My question being how to direct it to the shared network path. I was able to get it to go through using double \ but it won't read any of the new files arriving.
Thanks!
I suppose if you use tWaitForFile on the local filesystem Talend/Java will hook somehow into the folder and get a message if a new file is being put into it.
Now, since you are on a network drive first of all this is out of reach of the component. Second, the OS behind the network drive could be different.
I understand your job is running all the time, listening. You could change the behaviour to putting a tLoop first which would check the file system for new files and then proceed. There must be some delta check in how the new files get recognized.

cloudfoundry error pushing to bluemix

I am working my way through an online course from IBM on getting to know Bluemix. The exercise shows how to push an application to Bluemix.
I am running:
cf version 6.18.1+a1103f0-2016-05-24 on a Mac running OS X El Capitan
10.11.5 (15F34)
This is the command I entered:
cf push leonardbMyFirstDeploy3 -c "node app.js" -m 128M --no-manifest --no-start
This is the error I am getting (I have substituted my user name and digits on Mobile Documents folder name).
*FAILED
Error processing app files in '/Users/myname': read
/Users/myname/Library/Mobile
Documents.###########/com~apple~TextInput/Dictionaries/.baseline/UserDictionary/SAlQVUhF7208e6_gvZx_zdKx1U1AzKGem3HO2pLKjgY=/baseline.zip:
bad file descriptor*
I checked the file and yes the file seems to be corrupted. As I understand, this directory is my local location for iCloud sharing on my local disk. I don't know how this dictionary file got there and probably don't need it.
But my questions are these:
For the cloud foundry push command is there a way to generate a trace to get more information?
Why would the push be even looking at or using the file that is giving it problems? This seems like a significant overreach to even be anywhere this this folder. So does anyone know why?
Can anyone advise how to fix this?
I did try to configure a .cfignore using the Mobile Documents.########## directory but this did not seem to change the outcome any as the error recurred.
If the push command gives you OK on certain steps are there any cleanup or rollback commands that need to be executed before running again?
When you run cf push without the -p option, it will recursively push everything in the current directory and under it. So if you were running in /Users/myname when you ran the push, it will have pushed everything underneath it. Try creating a separate directory which contains just your app files and push from there instead.
If you run the cf command without any arguments it will dump a bunch of usage info, including the following environment variable to control debug tracing:
CF_TRACE=true Print API request diagnostics to stdout
Finally you do not have to clean anything up explicitly. If you do as I suggested above and move just your application files into their own directory and run the push from there, it will simply overwrite what you did before.

Copy file - Access denied

I have a batch file where I copy file from a different server. I have no issues running it on the server. But when I try to run it from a web application, the file does not copy. I keep getting access denied error. I have used xcopy, copy and robocopy.
I have provided full access to source and destination folder for all users.
No luck. Keep getting the same error :
copy /y \N01APW280\d$\Oracle\Middleware\user_projects\epmsystem1\diagnostics\logs\essbase\essbase_0\app\PLPLAN\PLPLAN.LOG D:\Hyperion\ERPI_Actuals_Load\Logs\
It is rather awkward to try and use a command-line utility, such as copy, from a web app; you should rather be using the programmatic abilities within your web application instead.
Aside from that, you main issue is that web apps are typically executed with very limited privileges, using local machine accounts that have no way of accessing administrative level shares on remote machines such as \N01APW280\d$. Another possible issue is that the local account that is being used by the web app cannot write to D:\Hyperion\ERPI_Actuals_Load\Logs\ folder. And finally, your app may have enough privileges to instantiate an external process such as copy.exe.

Windows Service ran by domain account cannot access file while full control

I have created a C# service that:
- Picks up and opens a local text file
- Opens an Excel-file used as template (saved locally)
- Fills in the data from the text file in the excel file
- Saves the Excel file to a network folder.
The service runs using a domain account (I cannot give the local system account rights on the network from our network admin...). When the service tries to open the template, I get an access denied error:
Microsoft Excel cannot access the file 'C:\BloxVacation\Template\BloxTemplate.xlsm'. There are several possible reasons:
• The file name or path does not exist.
• The file is being used by another program.
• The workbook you are trying to save has the same name as a currently open workbook.
The file does exist and the path is correct.
The file is not used by another user or program.
I try to OPEN the workbook (no other workbook is open), not SAVE it.
I have received the same error using the system account. The reason for this is that, when using interopservices, the system account needs a desktop folder (bug in Windows 7: http://forums.asp.net/t/1585488.aspx).
C:\Windows\System32\config\systemprofile\Desktop
C:\Windows\SysWOW64\config\systemprofile\Desktop
Create those 2 files and the error disappears for the system account.
I have given the domain user rights to those folders and the error disappears as well however, the service hangs on the code line where I open the excel file. When I execute the exact same code with the system account, the code execute well (Note: I save the file locally).
objXL.Workbooks.Open(BloxVacationService.ExcelTemplateFilePath)
Has anybody an idea how to solve this issue without having to rewrite the entire service in OpenXML? Thank you very much in advance.
If you have done all the things described in the question and it still doesn't work (as it was with me), the answer is pretty simple:
Make the domain user local admin on the machine that runs the service. It solved the problem.