Coming from GIT and SVN background, I've set up my P4V in windows, managed to get the content of my repository into my local folder (somehow), but once I made modification and create new files in my local folder, I cant submit it back to Perforce. It gives error:
//depot/main/p4config.txt - warning: cannot submit from non-stream client
No files to submit.
Submit failed -- fix problems above then use 'p4 submit -c 6'.
My depot hierarchy:
C:\Perforce\kernelpanic\main>p4 client -S //depot/main -o
# A Perforce Client Specification.
#
# Client: The client name.
# Update: The date this specification was last modified.
# Access: The date this client was last used in any way.
# Owner: The user who created this client.
# Host: If set, restricts access to the named host.
# Description: A short description of the client (optional).
# Root: The base directory of the client workspace.
# AltRoots: Up to two alternate client workspace roots.
# Options: Client options:
# [no]allwrite [no]clobber [no]compress
# [un]locked [no]modtime [no]rmdir
# SubmitOptions:
# submitunchanged/submitunchanged+reopen
# revertunchanged/revertunchanged+reopen
# leaveunchanged/leaveunchanged+reopen
# LineEnd: Text file line endings on client: local/unix/mac/win/share.
# ServerID: If set, restricts access to the named server.
# View: Lines to map depot files into the client workspace.
# Stream: The stream to which this client's view will be dedicated.
# (Files in stream paths can be submitted only by dedicated
# stream clients.) When this optional field is set, the
# View field will be automatically replaced by a stream
# view as the client spec is saved.
#
# Use 'p4 help client' to see more about client views and options.
Client: kernelpanic
Update: 2012/10/04 15:35:16
Access: 2012/10/04 15:59:39
Owner: me.kernelpanic
Host: kernelpanic
Description:
Created by me.kernelpanic.
Root: C:/Perforce/kernelpanic
Options: noallwrite noclobber nocompress unlocked nomodtime normdir
SubmitOptions: submitunchanged
LineEnd: local
View:
//depot/... //kernelpanic/...
//depot/main/doc/... //kernelpanic/main/doc/...
//depot/* //kernelpanic/*
//depot/main/* //kernelpanic/main/*
If possible, I'd like to add the files in C:\Perforce\kernelpanic\main\src as well...
Please help, I can't understand Perforce. I've tried doing a check out both before or after making modification, but both ways also failed to submit the change to server. I'd love to stick to GIT but our client is using Perforce so we have to play nice with them. Thanks a lot for your help!
It's possible that P4V has guided you to create a stream depot and a mainline, but has somehow created a non-stream workspace for you. From what I've heard, that's likely to happen for first-time P4V users due to something in the setup.
To see if that's the problem, go to Connection/Edit Workspace and look in the 'Stream' field. Is it empty? If so, use Browse to select the stream. This will turn your current workspace into a stream workspace.
If you prefer to work with the command-line, you can add a stream to your client as follows:
Show available streams:
$ p4 streams
Stream //stream/...1
Stream //stream/...2
Stream //stream/...3
…
Check your current client config:
$ p4 client -o
...
In my case, there was no stream mentioned there. Then edit the client config:
$ p4 client
and add:
Stream: //stream/...1
Check that it worked by rerunning p4 client -o.
Now retry p4 submit.
Related
I am trying to connect to a Spark cluster on Databricks and I am following this tutorial: https://docs.databricks.com/dev-tools/dbt.html. And I have the dbt-databricks connector installed (https://github.com/databricks/dbt-databricks). However, no matter how I configure it, I keep getting "Database error, failed to connect" when I run dbt test / dbt debug.
This is my profiles.yaml:
databricks_cluster:
outputs:
dev:
connect_retries: 5
connect_timeout: 60
host: <my_server_hostname>
http_path: <my_http_path>
schema: default
token: <my_token>
type: databricks
target: dev
This is my dbt_project.yml:
# Name your project! Project names should contain only lowercase characters
# and underscores. A good package name should reflect your organization's
# name or the intended use of these models
name: 'dbt_dem'
version: '1.0.0'
config-version: 2
# This setting configures which "profile" dbt uses for this project.
profile: 'databricks_cluster'
# These configurations specify where dbt should look for different types of files.
# The `model-paths` config, for example, states that models in this project can be
# found in the "models/" directory. You probably won't need to change these!
model-paths: ["models"]
analysis-paths: ["analyses"]
test-paths: ["tests"]
seed-paths: ["seeds"]
macro-paths: ["macros"]
snapshot-paths: ["snapshots"]
target-path: "target" # directory which will store compiled SQL files
clean-targets: # directories to be removed by `dbt clean`
- "target"
- "dbt_packages"
# Configuring models
# Full documentation: https://docs.getdbt.com/docs/configuring-models
# In this example config, we tell dbt to build all models in the example/ directory
# as tables. These settings can be overridden in the individual model files
# using the `{{ config(...) }}` macro.
models:
dbt_dem:
# Config indicated by + and applies to all files under models/example/
example:
+materialized: view
I have also tried using the spark connector, but I still get the same error using that. Any ideas as to why I can't connect to the Databricks cluster?
These are the logs corresponding to the error:
============================== 2022-02-18 08:43:22.123066 | 4b91f9d3-28ad-4f5a-93db-f431b6d9af14 ==============================
08:43:22.123066 [info ] [MainThread]: Running with dbt=1.0.1
08:43:22.123841 [debug] [MainThread]: running dbt with arguments Namespace(cls=<class 'dbt.task.debug.DebugTask'>, config_dir=False, debug=None, defer=None, event_buffer_size=None, fail_fast=None, log_cache_events=False, log_format=None, partial_parse=None, printer_width=None, profile=None, profiles_dir='/Users/keremaslan/.dbt', project_dir=None, record_timing_info=None, rpc_method=None, send_anonymous_usage_stats=None, single_threaded=False, state=None, static_parser=None, target=None, use_colors=None, use_experimental_parser=None, vars='{}', version_check=None, warn_error=None, which='debug', write_json=None)
08:43:22.124057 [debug] [MainThread]: Tracking: tracking
08:43:22.143750 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'invocation', 'label': 'start', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x7fb751ef42e0>, <snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x7fb751ef4eb0>, <snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x7fb751eca730>]}
08:43:22.236001 [debug] [MainThread]: Executing "git --help"
08:43:22.264682 [debug] [MainThread]: STDOUT: "b"usage: git [--version] [--help] [-C <path>] [-c <name>=<value>]\n [--exec-path[=<path>]] [--html-path] [--man-path] [--info-path]\n [-p | --paginate | -P | --no-pager] [--no-replace-objects] [--bare]\n [--git-dir=<path>] [--work-tree=<path>] [--namespace=<name>]\n <command> [<args>]\n\nThese are common Git commands used in various situations:\n\nstart a working area (see also: git help tutorial)\n clone Clone a repository into a new directory\n init Create an empty Git repository or reinitialize an existing one\n\nwork on the current change (see also: git help everyday)\n add Add file contents to the index\n mv Move or rename a file, a directory, or a symlink\n restore Restore working tree files\n rm Remove files from the working tree and from the index\n sparse-checkout Initialize and modify the sparse-checkout\n\nexamine the history and state (see also: git help revisions)\n bisect Use binary search to find the commit that introduced a bug\n diff Show changes between commits, commit and working tree, etc\n grep Print lines matching a pattern\n log Show commit logs\n show Show various types of objects\n status Show the working tree status\n\ngrow, mark and tweak your common history\n branch List, create, or delete branches\n commit Record changes to the repository\n merge Join two or more development histories together\n rebase Reapply commits on top of another base tip\n reset Reset current HEAD to the specified state\n switch Switch branches\n tag Create, list, delete or verify a tag object signed with GPG\n\ncollaborate (see also: git help workflows)\n fetch Download objects and refs from another repository\n pull Fetch from and integrate with another repository or a local branch\n push Update remote refs along with associated objects\n\n'git help -a' and 'git help -g' list available subcommands and some\nconcept guides. See 'git help <command>' or 'git help <concept>'\nto read about a specific subcommand or concept.\nSee 'git help git' for an overview of the system.\n""
08:43:22.265387 [debug] [MainThread]: STDERR: "b''"
08:43:22.272505 [debug] [MainThread]: Acquiring new databricks connection "debug"
08:43:22.273434 [debug] [MainThread]: Using databricks connection "debug"
08:43:22.273833 [debug] [MainThread]: On debug: select 1 as id
08:43:22.274044 [debug] [MainThread]: Opening a new connection, currently in state init
08:43:22.888586 [debug] [MainThread]: Databricks adapter: Error while running:
select 1 as id
08:43:22.889031 [debug] [MainThread]: Databricks adapter: Database Error
failed to connect
08:43:22.889905 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'invocation', 'label': 'end', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x7fb751f7eaf0>, <snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x7fb752113040>, <snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x7fb7521130a0>]}
08:43:24.130154 [debug] [MainThread]: Connection 'debug' was properly closed.
Check your profiles.yml (usually found here: ~/.dbt/profiles.yml) and make sure there is:
No https:// in the host name and
A leading slash in the http_path
For example:
host: server.name.com # instead of https://server.name.com
http_path: /sql/protocolv1/o/0/0000-000000-text000 # note the leading slash
These are easy mistakes to make if, like me, you copied the http_path straight out of the cluster config page and the host straight out of your browser URL.
Another example of profiles.yml from the dbt-databricks ReadMe: https://github.com/databricks/dbt-databricks
I had not specified this in the original question, but I had used conda to set up a virtual environment. Somehow that doesn't work, so I'd recommend following the tutorial to the letter and use pipenv.
I need to get all the mainline streams of a project. I tried this in the terminal
p4 streams -F "Type=mainline" //someproject
and got the following error,
//ConMod - must refer to client 'dummy'.
How can I resolve this and is there any better way. I want to this same task in p4Pyton
Use the correct path for the stream depot (with a wildcard):
p4 streams -F "Type=mainline" //ConMod/...
I am building a web application for an online "build your own" card game. In the application, I have a cards.json file that holds custom card data. This file is changed with fs whenever a user creates a card. Whenever I push local changes, the cards.json file gets overwritten on deploy. That means all the remote data gets lost on every deploy. How can I include a cards.json file remotely but not change the file whenever I push changes using git push heroku master?EDIT: I guess for clarification reasons, I have tried using a .gitignore as well as removing the file from the staging area. I'm not entirely sure, but I think the issue is that when the application is deployed the file is overwritten there.
So I just found out that the data created during runtime will always be deleted/reset.
https://devcenter.heroku.com/articles/dynos#ephemeral-filesystem
I guess the best fixes for anyone else who has this same issue are:
a) Look into Databases and Heroku Add-ons, or
b) This is very workaround, and there might be better ways to do it, but:
// Go into a new directory, and use
$ heroku ps:copy <FILENAME> --app <APPNAME>
// Then, copy+paste the data from this file into your main repo.
/* Now, each time you do this, you need to make sure you delete that file from the
* extra directory you created as ps:copy only works when the file doesnt exist locally.
*/
I think git fetch doesn't work in this instance, as it only pulls that unchanged file, rather than the changed one from the dyno.
Look up the .gitignore file in git, seems to me that's exactly what you're looking for.
If it doesn't recognize .gitignore properly at first:
git add [uncommitted changes you want to keep] && git commit
git rm -r --cached .
git add .
git commit -m "fixed untracked files"
In .gitignore add the cards.json along with the path .
eg. src/test/resources/testdata/cards.json
hi i am trying to link source control to perforce in redgate tool for sql server management studio but it throws error like
Command:
P4 -c C:\myworkspace_name-LT_2632\webteam\SANDBOXES\sandboxname -s sync "C:\myworkspace_name-LT_2632..."
Output:
error: Client 'C:\myworkspace_name-LT_2632\webteam\SANDBOXES\sandboxname' unknown - use 'client' command to create it.
exit: 1
The -c argument to p4 specifies the name of a client workspace. As the error message indicates, you are telling it to run the sync command in a client named 'C:\myworkspace_name-LT_2632\webteam\SANDBOXES\sandboxname'. From your comment on the original question, I think you need to change myworkspace in the example to the name of the client workspace that maps the path you listed.
Suddenly, when I run p4 info in terminal, I notice that the client root is not set (not sure why it got unset all of a sudden. Following is the output which shows "client unknown" in place of client root. What is the command through which I can set the same? I have tried p4 client and p4 set but may be, with wrong syntaxes.
BANL121b92746:Applications bagarwal2$ p4 info
User name: bagarwal2
Client name: BANL121b92746
Client host: BANL121b92746.local
Client unknown.
Current directory: /Applications
And is the value of this client root be the same as "Workspace Root" set in my P4V client under Connections->Edit Workspace . My P4V client is working perfectly. I found this problem with p4 info when my Intellij IDEA started showing connection problems in P4. On testing the connection in IDEA, below is the error screenshot, which is same as when I do p4 info in terminal.
Regarding my p4settings.txt config, below are the configs which were working for months till now:
P4HOST=<hidden hostname>:2500
P4CLIENT=bagarwal2_BANL121b92746_trunk
P4USER=bagarwal2
P4POST=<hidden hostname>:2500
My P4V connection (which works all fine), uses the same details/config which are mentioned above, still I find this problem in terminal and hence in Intellij IDEA.
Try p4 set p4client=my_client.
This stores your preferred client in the registry. There are other ways to set your client, with different precedence and scope:
environment variables (potentially different per process)
P4CONFIG files (potentially different per filesystem location)
command-line options (potentially different for every invocation of p4.exe)
but for simplicity, using p4 set is all you should need.
BTW, P4V uses its own setting (there's a dialog that comes up by default when you start P4V).
It looks like your p4settings.txt config file isn't being used; otherwise the client name returned by "p4 info" would match the P4CLIENT value in the config file. Run:
p4 set P4CONFIG=p4settings.txt
and make sure that when you run "p4 info" you're doing it from a directory underneath ~/dev/trunk. (Your "p4 info" output in the question shows your current directory as /Applications, so that might explain the problem on its own -- just do "cd ~/dev/trunk" and try again.)
The "client unknown" error suggests that maybe your client spec got deleted (this is assuming you're connecting to the same server and using the same client name you were successfully using before). If that's what happened you can create a new one with the same name by running:
p4 client
UNIX: bash, ksh, sh,
P4CLIENT=value ; export P4CLIENT
UNIX: csh
setenv P4CLIENT value
Mac OS X (bash)
P4CLIENT=value ; export P4CLIENT
Windows
p4 set P4CLIENT=value
Windows administrators running Helix Server as a service can set variables for use by a specific service with p4 set -S svcnamevar=value, or set variables for all users on the local machine with p4 set -s var=value.
More details here:
https://www.perforce.com/manuals/cmdref/Content/CmdRef/envars.html
SET P4PORT in the environment variable.
then when you try P4 info
client unknown error will be gone & it will show the p4root value which is set in perforce.
It worked for me.
I ran into this issue, and come to find out the perforce registry keys under Computer\HKEY_CURRENT_USER\SOFTWARE\Perforce\Environment are case sensitive! Somehow, someway, the P4CLIENT key was set to p4client. Setting it to upper case and then running p4 client command solved the issue for me.