I am following the tutorial about Data Version Control using mingw32 on Windows 7.
I am getting very strange error when I try to use run:
$ dvc run -v echo "hello"
Debug: updater is not old enough to check for updates
Debug: PRAGMA user_version;
Debug: fetched: [(2,)]
Debug: CREATE TABLE IF NOT EXISTS state (inode INTEGER PRIMARY KEY, mtime TEXT NOT NULL, md5 TEXT NOT NULL, timestamp TEXT NOT NULL)
Debug: CREATE TABLE IF NOT EXISTS state_info (count INTEGER)
Debug: CREATE TABLE IF NOT EXISTS link_state (path TEXT PRIMARY KEY, inode INTEGER NOT NULL, mtime TEXT NOT NULL)
Debug: INSERT OR IGNORE INTO state_info (count) SELECT 0 WHERE NOT EXISTS (SELECT * FROM state_info)
Debug: PRAGMA user_version = 2;
Running command:
echo hello
/c: /c: Is a directory
Debug: SELECT count from state_info WHERE rowid=1
Debug: fetched: [(1,)]
Debug: UPDATE state_info SET count = 1 WHERE rowid = 1
Error: Traceback (most recent call last):
File "dvc\command\run.py", line 18, in run
File "dvc\project.py", line 265, in run
File "dvc\stage.py", line 435, in run
StageCmdFailedError: Stage 'Dvcfile' cmd echo hello failed
Error: Failed to run command: Stage 'Dvcfile' cmd echo hello failed
Question:
Where does the /c: /c: Is a directory come from? How can I fix it?
My findings
I supposed that it was resolving path to echo, but ech is a builtin.
$ type echo
echo is a shell builtin
I tried also with exit and cd but I am getting the same error.
Calling commands without dvc works fine.
dvc with --no-exec flag works fine, but when later executed with repro gives the same error.
I'm one of the dvc developers. Similar error has affected dvc running on cygwin. We've released a fix for it in 0.20.0. Please upgrade.
Related
I have an old script that does a number of things, renaming some files. But there error is that if there are no files, it just continues. So I added a hop that is followed on 'result false', and that is executed when there are no files there. This is the script, the first four lines are added by me:
IF NOT EXIST "${DATA_DIR}\*.*" (
ECHO NO FILES DOWNLOADED, ABORTING
ABORT
) ELSE (
IF EXIST "${DATA_DIR}\Bel_Main*.txt" (
RENAME "${DATA_DIR}\Bel_Main*.txt" Bel_Main.txt
)
IF EXIST "${DATA_DIR}\ParcomBE*.txt" (
RENAME "${DATA_DIR}\ParcomBE*.txt" ParcomBE.txt
)
IF EXIST "${DATA_DIR}\BalansBE*.txt" (
RENAME "${DATA_DIR}\BalansBE*.txt" BalansBE.txt
)
)
However, it seems to follow the 'abort path', just because it does not recognize the command 'ABORT'. This is the output:
2022/08/10 17:21:11 - rename files - (stdout) )
2022/08/10 17:21:11 - rename files - (stdout) NO FILES DOWNLOADED, ABORTING
2022/08/10 17:21:11 - rename files - ERROR (version 7.1-SNAPSHOT, build 1 from 2017-08-23 17.37.41 by olbicoserviceuser) : (stderr) 'ABORT' is not recognized as an internal or external command,
2022/08/10 17:21:11 - rename files - ERROR (version 7.1-SNAPSHOT, build 1 from 2017-08-23 17.37.41 by olbicoserviceuser) : (stderr) operable program or batch file.
2022/08/10 17:21:11 - DnB Data Preparation - Starting entry [Abort job]
2022/08/10 17:21:11 - Abort job - ERROR (version 7.1-SNAPSHOT, build 1 from 2017-08-23 17.37.41 by olbicoserviceuser) : Aborting job.
2022/08/10 17:21:11 - DnB Data Preparation - Finished job entry [Abort job] (result=[false])
2022/08/10 17:21:11 - DnB Data Preparation - Job execution finished
2022/08/10 17:21:11 - Spoon - Job has ended.
2022/08/10 17:21:47 - Spoon - Spoon
Now though it seems to work, I wonder if there is a cleverer way to let the 'false' hop to be chosen apart from just making it crash by an unknown command. I tried return false, false, set errorlevel. But I just cannot find the proper way.
'EXIT /B 1'
With the '1' indicating that the result of the batch file was false, so it hops to the 'red arrow' in spoon.
I run my dbt command in a loop and save its contents to a .yml file. This works well and generates a schema in my .yml file accurately:
for file in models/l30_mart/*.sql; do
table=$(basename "$file" .sql)
dbt run-operation generate_model_yaml --args "{\"model_name\": \"$table\"}" > test.yml
done
However, in the example above, I am just saving the test.yml file in the root directory. When I try to save the file in another path for example models/l30_mart/test.yml, it doesn't work:
for file in models/l30_mart/*.sql; do
table=$(basename "$file" .sql)
dbt run-operation generate_model_yaml --args "{\"model_name\": \"$table\"}" > models/l30_mart/test.yml
done
In this case, when I open the test.ymlfile, I see this:
12:06:42 Running with dbt=1.0.1
12:06:43 Encountered an error:
Compilation Error
The schema file at models/l30_mart/test.yml is invalid because no version is specified. Please consult the documentation for more information on schema.yml syntax:
https://docs.getdbt.com/docs/schemayml-files
It's probably a syntax mistake. Do I need any quotes to specify the path? or brackets? Why can't I save the .yml file in the same folder? Similarly, something like this and try to save different files with the tablename, it also doesn't work:
for file in models/l30_mart/*.sql; do
table=$(basename "$file" .sql)
dbt run-operation generate_model_yaml --args "{\"model_name\": \"$table\"}" > models/l30_mart/$table.yml
done
In this case, the files either have this output:
20:39:44 Running with dbt=1.0.1
20:39:45 Encountered an error:
Compilation Error
The schema file at models/l30_mart/firsttable.yml is invalid because no version is specified. Please consult the documentation for more information on schema.yml syntax:
https://docs.getdbt.com/docs/schemayml-files
or this (eg in the second tablename.yml file):
20:39:48 Running with dbt=1.0.1
20:39:49 Encountered an error:
Parsing Error
Error reading dbt_4flow: l30_mart/firstablename.yml - Runtime Error
Syntax error near line 2
------------------------------
1 | 20:39:44 Running with dbt=1.0.1
2 | 20:39:45 Encountered an error:
3 | Compilation Error
4 | The schema file at models/l30_mart/firsttablename.yml is invalid because no version is specified. Please consult the documentation for more information on schema.yml syntax:
5 |
Raw Error:
------------------------------
mapping values are not allowed in this context
in "<unicode string>", line 2, column 31
Note that the secondtablename.yml mentions the firsttablename.yml.
On running molecule to test my Ansible changes. I was receiving an error with the state.yml file. As shown:
$ molecule test
ERROR: while scanning a simple key
in "/tmp/molecule/my_module/default/state.yml", line 8, column 1
could not find expected ':'
in "/tmp/molecule/my_module/default/state.yml", line 9, column 1
ERROR: Job failed: exit status 1
It appears on the state.yml file had got corrupted on the remove gitlab runner some how. I deleted the file and re-ran the test job, and this passed.
I defined a trigger in postgresql as follow:
CREATE OR REPLACE FUNCTION test() RETURNS trigger AS
$BODY$
BEGIN
COPY (select 1) TO PROGRAM 'mkdir -m 700 -p mfdata';
RETURN NEW;
END;
$BODY$
LANGUAGE plpgsql;
Now I use this trigger when a record of table aircraft updated:
CREATE TRIGGER aircraft_test AFTER UPDATE ON aircraft
FOR EACH ROW EXECUTE PROCEDURE test();
This means when a record in aircraft table updated, mfdata directory created if not exist in postgres data directory. First record update, it create a folder whit mfdata name, but in second update record, it error:
for when doesn't create the folder if it exist, I'm using -p, but it error.
Why does it error? How can I fixe it?
Note:
I want to create sub folder dynamically later.
DB Log:
2018-01-27 08:24:40 IRST LOG: autovacuum launcher started
A subdirectory or file -m already exists.
Error occurred while processing: -m.
A subdirectory or file 700 already exists.
Error occurred while processing: 700.
A subdirectory or file -p already exists.
Error occurred while processing: -p.
A subdirectory or file mfdata already exists.
Error occurred while processing: mfdata.
2018-01-27 17:34:49 IRST ERROR: program "mkdir -m 700 -p mfdata" failed
2018-01-27 17:34:49 IRST DETAIL: child process exited with exit code 1
2018-01-27 17:34:49 IRST CONTEXT: SQL statement "COPY (select 1) TO PROGRAM 'mkdir -m 700 -p mfdata'"
PL/pgSQL function test() line 3 at SQL statement
For some reason I am having trouble with the make test statement while installing ```Vowpal Wabbit``. I am getting the following error:
RunTests: test 59: '/usr/bin/timeout 20 ../vowpalwabbit/vw -d train-sets/argmax_data -k -c --passes 20 --search_rollout oracle --search_alpha 1e-8 --search_task argmax --search 2 --holdout_off' failed (exitcode=1)
Anyone have a clue what this could be?
Just run the command which failed (in single quotes) directly from the test directory, and the reason would become obvious.
It is missing data file:
Reading datafile = test/train-sets/argmax_data
can't open: test/train-sets/argmax_data, error = No such file or directory
vw: std::exception
The issue was introduced in a recent check-in and should soon be fixed (hopefully).
Update (2014-05-31): fixed in the most recent commit.