Cakephp 3 upgrade tools unable to access file - cakephp

I try to use Cakephp 3 upgrade tool.
I installed composer, I made this:
cd /path/to/upgrade
bin/cake upgrade all /home/mark/Sites/my-app
Then I get tons of error like this in windows command shell.
error: Could not access ''C:\mydir\upgrade\tmp\upgrade\a2d4223f62e3499a84b6ca30be24bfdb4cb6de40''
Update C:\mydir\myapp\lib\Cake\View\Helper\CacheHelper.php
error: Could not access ''C:\mydir\upgrade\tmp\upgrade\7fbe7651712387f351b1eb670b14c18e1161fcb8''
Update C:\mydir\myapp\lib\Cake\View\Helper\HtmlHelper.php
error: Could not access ''C:\mydir\upgrade\tmp\upgrade\2301f9bed1167ddb29ca4e06706d0d21bd015766''
Update C:\mydir\myapp\lib\Cake\View\Helper\NumberHelper.php
error: Could not access ''C:\mydir\upgrade\tmp\upgrade\e71af0cbc7df7ff76e801c5fb06ec07ee7f45233''
Update C:\mydir\myapp\lib\Cake\View\Helper\PaginatorHelper.php
error: Could not access ''C:\mydir\upgrade\tmp\upgrade\1b04b5a763ca4e798d1e176111e49008b7486724''
Update C:\mydir\myapp\lib\Cake\View\Helper\TextHelper.php
error: Could not access ''C:\mydir\upgrade\tmp\upgrade\f8ead667c131610c1f70f38d10c7122b34d9a7fc''
Update C:\mydir\myapp\lib\Cake\View\Helper\TimeHelper.php
error: Could not access ''C:\mydir\upgrade\tmp\upgrade\4a2c2e7f3f7e9faf744d10e6e1f3ff24bead7f08''
Update C:\mydir\myapp\lib\Cake\View\HelperCollection.php
I run command shell as administrator. What would be the problem ? When I check folder during operation, I can see that temporary file exists in folder.

I got the very same issue. Here's a description of the issue :
This is a Git error
Git command that fails is called by /upgradeTool/src/Shell/Task/StageTask.php on line 176 by exec() php function (seems different for you)
command to run git looks like this : git diff --no-index 'T:\Logiciels\CakePHP_3_upgradeTool\tmp\upgrade\c5d0aaadb3484d4bfe56bdfc4553b444f6789e66' 'T:\Logiciels\CakePHP_3_upgradeTool\tmp\upgrade\4a6662f82cd03d46b515c28f7d77ef8a64c08cfd'
EDIT (2015-07-12)
As ndm noted, "the source of the problem is the single quote usage in the arguments for the git command, the Windows CLI will pass them as if they belong to the file path"
I changed this line (/upgradeTool/src/Shell/Task/StageTask.php on line 176) from :
exec("git diff --no-index "$oPath" "$uPath"', $output);
to :
exec('git diff --no-index "'.$oPath.'" "'.$uPath.'"', $output);
Now the process seems complete. Many many thanks !

After tryouts I found solution. As DarXnake noted, problem is git.
When you install git it asks whether you want to use git from command line or not. Default option is Use Git Bash only. I had selected that option.
Now I updated git and when setup asked for install type, I selected Run Git from the Windows Command Prompt. Then I retried cakephp upgrade and I didn't get any access error.

Related

opam init fails - unable to create temp file

I have installed opam 2.1.0 on a Linux Virtualbox VM. When I try opam init, I get the following error:
<><> Fetching repository information ><><><><><><><><><><><><><><><><><><><><><>
[ERROR] Could not update repository "default": OpamDownload.Download_fail(_, "Curl
failed: \"/snap/bin/curl --write-out %{http_code}\\\\n --retry 3
--retry-delay 2 --user-agent opam/2.1.0 -L -o
/tmp/opam-32196-d33843/index.tar.gz.part --
https://opam.ocaml.org/index.tar.gz\" exited with code 23")
[ERROR] Initial download of repository failed.
Running with --disable-sandboxing doesn't help. I know that its a problem creating/writing to /tmp/opam-... directory because if I replace that with my current directory or home directory the command by itself runs fine. It also runs fine with /tmp/opam-... if I use the --create-dirs option in curl but I don't have any way of getting opam init to use that option. Any ideas?
thanks
Update
The reason opam init failed for me was because curl was installed with snap on my system. This exactly what is going on with your VM.
Try to run opam init -verbose and that could reveal more about why you ran into an error.
In my case I needed to install other things with opam and it kept failing every time. So snap uninstall curl and then sudo apt install curl fixed things. (Was only able to figure this out with help from my professor)
Workaround
I ran into the same issue and I found a workaround on the OCaml forum: here. (Credits to UnixJunkie)
You can run:
opam init github git+https://github.com/ocaml/opam-repository.git
This should avoid the certificate issues. This worked for me.
I tried to fix the certificate issues using this answer as well. You could try doing that, but it seems complicated when the workaround is to simply point it to the github repo directly.
This question is similar to this one.

Jenkins Pipeline withCredentials secret file odd behavior

I'm using Jenksin v2.5.0 with Credentials plugin v 2.1.16 and CredentialsBinding plugin v1.13 (both latest available) and while it appears to work as intended, it exhibits and odd repeating behavior as I continue to re-run my pipeline.
The following pipeline syntax is in use:
withCredentials([file(credentialsId: '<credID>', variable: 'KEY_FILE')]) {
...steps here create ${workspace}/ssh script using KEY_FILE...
sh(script: "docker exec ${containerName} /bin/bash -c 'cd ${entryPoint} && GIT_SSH='${workspace}/ssh' git fetch --tags --progress git#gitserver.com:${group}/${project}.git +refs/h eads/${branch}:refs/remotes/origin/${branch}'")
} //credentials
It evaluates as expected and is functional, as shown here:
[Build] Running shell script
+ docker exec <container> /bin/bash -c 'cd /<buildRoot>/build && GIT_SSH=/<workspace>/ssh git fetch --tags --progress git#gitsserver.com:<group>/<project>.git +refs/heads/staging:refs/remotes/origin/staging'
Warning: Identity file /<workspace>/<job>#tmp/secretFiles/a36b7edb-2914-419a-8be0-478603d1b031/keyfile.txt not accessible: No such file or directory.
Permission denied, please try again.
Permission denied, please try again.
Received disconnect from gitserver.com port 22:2: Too many authentication failures for git
Connection to gitsserver.com closed by remote host.
Warning: Identity file /<workspace>/<job>#tmp/secretFiles/ccb1e11c-18f5-4697-b5c1-e4514c1ab1c7/keyfile.txt not accessible: No such file or directory.
*** The part where it states that it can't find the file during the git operation (that is using SSH underneath) is what continues to repeat, each time with a different secret files GUID in the path (shown above are two of the repeats). The underlying implementation appears to implement a loop of sorts over the 'git fetch' command, trying a new credentials path each time.
Both how/why Jenkins:
1) Creates these new paths each time
2) Knows to keep looping over the single failed git command until it finally delivers the secret file that enables the authentication and git succeeds
are mysteries to me.
Any insight would be appreciated.
PS> I'm already aware that newer versions of git not (yet) available in my environment have different methods for providing SSH options. I'd like this question to focus on the odd withCredentials behavior.
PPS> I've also already tried higher level constructs for the pipeline including at least the 'git' SCM plugin specialization and the 'docker' node type with it's "inside()" functionality, but many iterations of those constructs always left me with some oddity that, again, is not the focus of this question.
Turns out that this is not a problem with Jenkins or any of the plugins at all.
The temporary script that was written to the Jenkins workspace was continuously being appended to, meaning it was the source of all the invalid secret file paths and the "loop"...the last command in that script would always be the one with the correct path and it would succeed.

Nagios Plugin Error: (No output on stdout) ... failed. errno is 2: No such file or directory

I am using custom Nagios plugins for the first time and am running into this error when I create a service for the plugin.
(No output on stdout) stderr: execvp(/usr/local/nagios/libexec/check_load.py, ...) failed. errno is 2: No such file or directory
The plugin works when I run it on the command line, however does not work when it runs within Nagios.
I followed these steps to get the plugin into Nagios
https://assets.nagios.com/downloads/nagiosxi/docs/Managing-Plugins-in-Nagios-XI.pdf
Here is what it looks like in the Nagios UI
The plugin is in the correct path: /usr/local/nagios/libexec and the resource.cfg file has the same path within it.
I tried two separate plugins, both which work on the command line, and the result is the same error.
The error indicates the file location is incorrect, however the plugin is in the specified directory and runs with no errors within that directory.
I am totally stumped and appreciate any help.
For anyone reading this, I solved the problem.
The first time I added the plugin, I forgot to add the python extension. When I updated the already created plugin, Nagios still threw the error.
Once I completely deleted the plugin and re-created it the 'file not found', error went away.
I faced a similar issue when I was trying to add a custom plugin ( I had custom plugins in ruby and python ).
The issue was the missing shebang line at the start of the script (which determines the script's ability to be executed like a standalone executable).
For example, if you have a python plugin custom-plugin.py then make sure this script has shebang at the start of script #!/usr/bin/env python3. Also if you have other scripts (ruby, bash etc.) make sure to add the appropriate path at the start of your scripts.
Also, check the path for plugins Nagios version. For my setup path was /usr/local/nagios/libexec/ and make sure your custom plugin is executable and has correct ownership permissions.
Sample custom template I used :
define command {
command_name check_switch_health
command_line /usr/local/nagios/libexec/check_snmp.rb --host $HOSTADDRESS$ --model "$ARG1$" --community "$ARG2$"
}
The above workaround worked for me.

Error arose when using Pkg.add() in Julia

I have a problem when trying to add a package in the terminal using Pkg.add, the terminal gives me the following error message:
fatal:your current branch 'master' does not have any commits yet
Error: failed process: Process(`git' --git-dir=````)
How do I fix it?
I've had the same issue with Gadfly. Installation failed and I couldn't load nor reinstall the package.
After looking at the documentation.
Turns out there is a cache folder (with the same name as the package) hidden in Users\my_username\.julia\v0.4\.cache\ I removed this folder and the package installed fine from Julia running Pkg.add("Gadfly").
Try removing the folder and install the package again.
Please give more information about where this package comes from. Github? Your hard drive? A zip file?
If this is one of your packages, just create a commit.
git add .
git commit -m 'First commit'
This should work.

Getiing error message 'Failed Installing JBAS50SVC' whle running service.bat file in Windows 7

I need to run Jboss 7 as service.
Followed these steps :-
Copied my Jboss to C:\Program Files <86>
Downloaded Jboss-native-2.0.10-windows-x64-ssl and copied the contenst of bin catalog to %JBOSS_HOME%/bin
Changes done on service.bat as per link instructions
https://community.jboss.org/message/724488
Changed my dir location to my Jboss bin
and given command service.bat install
C:\Program Files \jboss7>bin>service.bat install
Failed installing JBAS50SVC
Access is Denied.
Service JBoss Application Server 7.1.1 installed.
I'm not able to rectify this problem .
It appears to be windows access issue.
Try the following:
Does the windows ID you are using have Administrator privileges? If no, get a Admin ID else if Yes, proceed to step 2.
Try to do the same but in some other drive (not c: )
UPDATE #1 : OP says he can not see the output of service.bat file
Follow the following steps
Open start menu
Search for "cmd"
Right click "cmd" and run as Administrator
type in following command
cd C:\Program Files \jboss7\bin
Type service.bat and observe the output
On a 2008 Windows Server this occurs because you're not running the command line as an administrator. Those of us who have spent considerable amounts of time on 2003 server, and others before that, keep forgetting that your logged in ADMIN level account does NOT get passed to the command line automatically like with previous versions of Windows.
With any additional errors, past this one, I would keep going back to the service.bat file and looking at the path statements, throughout that file, to ensure that they are all correct to reach what is correct for your installation.
Also, don't forget to create a log folder under standalone (unless you're doing a domain install). Failure to do that will also cause issues as well.
yoda

Resources